{"version":3,"sources":["dev/j/mkt/about/gamma.js"],"names":["getHiddenProp","prefixes","document","i","length","isHidden","prop","String","prototype","queryStringToJSON","params","this","substring","indexOf","replace","eval","decodeURIComponent","split","json","n","param","key","value","e","keys","path","cmd","$","each","ii","jsonCLOSUREGLOBAL","valueCLOSUREGLOBAL","extend","expr","inViewport","el","scrollTop","documentElement","body","elOffsetTop","offset","top","elH","height","winH","window","innerHeight","Gamma","$window","$body","$document","Modernizr","transEndEventNames","WebkitTransition","MozTransition","OTransition","msTransition","transition","transEndEventName","prefixed","defaults","columns","speed","easing","overlayAnimated","nextOnClickImage","circular","svImageTransitionSpeedFade","svImageTransitionEasingFade","svImageTransitionSpeedResize","svImageTransitionEasingResize","svMarginsVH","vertical","horizontal","keyboard","swipe","interval","historyapi","init","settings","callback","_config","_layout","_initMasonry","container","removeClass","items","show","_goto","_initEvents","call","overlay","find","controls","children","gallery","itemsCount","isAnimating","svMargins","History","enabled","supportTransitions","csstransitions","_createSingleView","singleview","nav","_createSingleViewNavigation","appendTo","svclose","svplay","insertAfter","svnavnext","svnavprev","anim","id","getState","url","isSingleview","undefined","isSV","_closesingleview","$item","eq","Math","abs","svImage","_setTransition","_applyAnimation","opacity","remove","_singleviewitem","svDescription","empty","_saveState","pushState","$items","_setMasonry","hide","$picEl","sources","_getImgSources","source","_chooseImgSource","outerWidth","description","data","maxwidth","maxheight","addClass","html","attr","alt","title","src","$el","theSources","$source","push","width","pos","containerW","viewport","len","css","floor","imagesLoaded","masonry","itemSelector","columnWidth","containerWidth","_reloadMasonry","timeout","clearTimeout","masonrytimeout","setTimeout","w","_toggleControl","$control","status","animStyle","_onnavigate","dir","slideshow","_navigate","current","_resize","_resizeGrid","_svResizeImage","finalConfig","_getFinalImgConfig","imgMaxW","imgMaxH","wrapper","image","finalSizePosition","currentSrc","finalStyle","left","off","h","l","position","t","load","$img","next","insertBefore","properties","_getFinalSizePosition","checksource","ratio","_singleview","index","fly","outerHeight","style","display","offsetHeight","styleCSS","scrollLeft","cond","_loadSVItemFromGrid","wrap","loadingtimeout","$this","imageSize","wrapperSize","finalW","finalH","imgW","imgH","wrapperW","wrapperH","_stopSlideshow","not","wst","is","diff","zIndex","_visChange","_prepareSlideshow","slideshowtimeout","right","_startSlideshow","_preloadNext","pause","type","on","visProp","evtname","addEventListener","event","keyCode","which","arrow","up","down","swipeleft.gamma","swiperight.gamma","property","fncomplete","fn","applyStyle","animate","stop","duration","complete","add","$newitems","append"],"mappings":"AA2HA,QAASA,iBACL,GAAIC,IAAY,SAAS,MAAM,KAAK,IAGpC,IAAI,UAAYC,UAAU,MAAO,QAGjC,KAAK,GAAIC,GAAI,EAAGA,EAAIF,EAASG,OAAQD,IACjC,GAAKF,EAASE,GAAK,UAAaD,UAC5B,MAAOD,GAASE,GAAK,QAI7B,OAAO,MAEX,QAASE,YACL,GAAIC,GAAON,eACX,OAAKM,GAEEJ,SAASI,IAFE,EAnHtBC,OAAOC,UAAUC,kBAAoBF,OAAOC,UAAUC,mBAAqB,WAG1E,GAAIC,QAASH,OAAOI,KAOpB,IALAD,OAASA,OAAOE,UAAUF,OAAOG,QAAQ,KAAK,GAG9CH,OAASA,OAAOI,QAAQ,MAAO,OAEA,MAA1BJ,OAAOE,UAAU,EAAE,IAAoD,MAAtCF,OAAOE,UAAUF,OAAON,OAAO,GAEpE,MAAOW,MAAKC,mBAAmBN,QAGhCA,QAASA,OAAOO,MAAM,aAGtB,KAAM,GAFFC,SAEMf,EAAI,EAAGgB,EAAIT,OAAON,OAAYe,EAAJhB,IAASA,EAC7C,CAEC,GAAIiB,OAAQV,OAAOP,IAAM,IACzB,IAAe,OAAViB,QACLA,MAAQA,MAAMH,MAAM,KACL,OAAVG,OAAL,CAIA,GAAIC,KAAMD,MAAM,IAAM,IACtB,IAAa,OAARC,KACoB,mBAAbD,OAAM,GAAlB,CACA,GAAIE,OAAQF,MAAM,EAIlBC,KAAML,mBAAmBK,KACzBC,MAAQN,mBAAmBM,MAC3B,KAEIA,MAAQP,K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,OAC/B8E,EAAS0L,GACTlG,MAKD5F,KAAOA,EACP6L,IAAMA","file":"gamma.js","sourcesContent":["/**\n * gamma.js v1.0.0\n * http://www.codrops.com\n *\n * Licensed under the MIT license.\n * http://www.opensource.org/licenses/mit-license.php\n * \n * Copyright 2012, Codrops\n * http://www.codrops.com\n */\n \n/**\n * Return a new JSON object of the old string.\n * Turns:\n * \t\tfile.js?a=1&b.c=3.0&b.d=four&a_false_value=false&a_null_value=null\n * Into:\n * \t\t{\"a\":1,\"b\":{\"c\":3,\"d\":\"four\"},\"a_false_value\":false,\"a_null_value\":null}\n * @version 1.1.0\n * @date July 16, 2010\n * @since 1.0.0, June 30, 2010\n * @package jquery-sparkle {@link http://www.balupton/projects/jquery-sparkle}\n * @author Benjamin \"balupton\" Lupton {@link http://www.balupton.com}\n * @copyright (c) 2009-2010 Benjamin Arthur Lupton {@link http://www.balupton.com}\n * @license GNU Affero General Public License version 3 {@link http://www.gnu.org/licenses/agpl-3.0.html}\n */\nString.prototype.queryStringToJSON = String.prototype.queryStringToJSON || function ( )\n{\t// Turns a params string or url into an array of params\n\t// Prepare\n\tvar params = String(this);\n\t// Remove url if need be\n\tparams = params.substring(params.indexOf('?')+1);\n\t// params = params.substring(params.indexOf('#')+1);\n\t// Change + to %20, the %20 is fixed up later with the decode\n\tparams = params.replace(/\\+/g, '%20');\n\t// Do we have JSON string\n\tif ( params.substring(0,1) === '{' && params.substring(params.length-1) === '}' )\n\t{\t// We have a JSON string\n\t\treturn eval(decodeURIComponent(params));\n\t}\n\t// We have a params string\n\tparams = params.split(/\\&(amp\\;)?/);\n\tvar json = {};\n\t// We have params\n\tfor ( var i = 0, n = params.length; i < n; ++i )\n\t{\n\t\t// Adjust\n\t\tvar param = params[i] || null;\n\t\tif ( param === null ) { continue; }\n\t\tparam = param.split('=');\n\t\tif ( param === null ) { continue; }\n\t\t// ^ We now have \"var=blah\" into [\"var\",\"blah\"]\n\n\t\t// Get\n\t\tvar key = param[0] || null;\n\t\tif ( key === null ) { continue; }\n\t\tif ( typeof param[1] === 'undefined' ) { continue; }\n\t\tvar value = param[1];\n\t\t// ^ We now have the parts\n\n\t\t// Fix\n\t\tkey = decodeURIComponent(key);\n\t\tvalue = decodeURIComponent(value);\n\t\ttry {\n\t\t // value can be converted\n\t\t value = eval(value);\n\t\t} catch ( e ) {\n\t\t // value is a normal string\n\t\t}\n\n\t\t// Set\n\t\t// window.console.log({'key':key,'value':value}, split);\n\t\tvar keys = key.split('.');\n\t\tif ( keys.length === 1 )\n\t\t{\t// Simple\n\t\t\tjson[key] = value;\n\t\t}\n\t\telse\n\t\t{\t// Advanced (Recreating an object)\n\t\t\tvar path = '',\n\t\t\t\tcmd = '';\n\t\t\t// Ensure Path Exists\n\t\t\t$.each(keys,function(ii,key){\n\t\t\t\tpath += '[\"'+key.replace(/\"/g,'\\\\\"')+'\"]';\n\t\t\t\tjsonCLOSUREGLOBAL = json; // we have made this a global as closure compiler struggles with evals\n\t\t\t\tcmd = 'if ( typeof jsonCLOSUREGLOBAL'+path+' === \"undefined\" ) jsonCLOSUREGLOBAL'+path+' = {}';\n\t\t\t\teval(cmd);\n\t\t\t\tjson = jsonCLOSUREGLOBAL;\n\t\t\t\tdelete jsonCLOSUREGLOBAL;\n\t\t\t});\n\t\t\t// Apply Value\n\t\t\tjsonCLOSUREGLOBAL = json; // we have made this a global as closure compiler struggles with evals\n\t\t\tvalueCLOSUREGLOBAL = value; // we have made this a global as closure compiler struggles with evals\n\t\t\tcmd = 'jsonCLOSUREGLOBAL'+path+' = valueCLOSUREGLOBAL';\n\t\t\teval(cmd);\n\t\t\tjson = jsonCLOSUREGLOBAL;\n\t\t\tdelete jsonCLOSUREGLOBAL;\n\t\t\tdelete valueCLOSUREGLOBAL;\n\t\t}\n\t\t// ^ We now have the parts added to your JSON object\n\t}\n\treturn json;\n};\n\n// checks if an element is partially inside the viewport\n// inspired by James Padolsey's snippet (http://remysharp.com/2009/01/26/element-in-view-event-plugin/#comment-127058)\n$.extend( $.expr[':'], {\n\n\tinViewport : function( el ) {\n\n\t\tvar scrollTop = ( document.documentElement.scrollTop || document.body.scrollTop ),\n\t\t\telOffsetTop = $( el ).offset().top,\n\t\t\telH = $( el ).height()\n\t\t\twinH = ( window.innerHeight && window.innerHeight < $( window ).height() ) ? window.innerHeight : $( window ).height();\n\n\t\treturn ( elOffsetTop + elH ) > scrollTop && elOffsetTop < ( scrollTop + winH );\n\n\t}\n\n});\n\n// HTML5 PageVisibility API\n// http://www.html5rocks.com/en/tutorials/pagevisibility/intro/\n// by Joe Marini (@joemarini)\nfunction getHiddenProp(){\n var prefixes = ['webkit','moz','ms','o'];\n \n // if 'hidden' is natively supported just return it\n if ('hidden' in document) return 'hidden';\n \n // otherwise loop over all the known prefixes until we find one\n for (var i = 0; i < prefixes.length; i++){\n if ((prefixes[i] + 'Hidden') in document) \n return prefixes[i] + 'Hidden';\n }\n\n // otherwise it's not supported\n return null;\n}\nfunction isHidden() {\n var prop = getHiddenProp();\n if (!prop) return false;\n \n return document[prop];\n}\n\nvar Gamma = (function() {\n\n\tvar $window = $( window ),\n\t\t$body = $( 'body' ),\n\t\t$document = $( document ),\n\t\tModernizr = window.Modernizr,\n\t\t// https://github.com/twitter/bootstrap/issues/2870\n\t\ttransEndEventNames = {\n\t\t\t'WebkitTransition' : 'webkitTransitionEnd',\n\t\t\t'MozTransition' : 'transitionend',\n\t\t\t'OTransition' : 'oTransitionEnd',\n\t\t\t'msTransition' : 'MSTransitionEnd',\n\t\t\t'transition' : 'transitionend'\n\t\t},\n\t\ttransEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ],\n\t\t// default settings\n\t\tdefaults = {\n\t\t\t// default value for masonry column count\n\t\t\tcolumns : 4,\n\t\t\t// transition properties for the images in ms (transition to/from singleview)\n\t\t\tspeed : 300,\n\t\t\teasing : 'ease',\n\t\t\t// if set to true the overlay's opacity will animate (transition to/from singleview)\n\t\t\toverlayAnimated : true,\n\t\t\t// if true, the navigate next function is called when the image (singleview) is clicked\n\t\t\tnextOnClickImage : true,\n\t\t\t// circular navigation\n\t\t\tcircular : true,\n\t\t\t// transition settings for the image in the single view.\n\t\t\t// These includes:\n\t\t\t// - ajusting its position and size when the window is resized\n\t\t\t// - fading out the image when navigating\n\t\t\tsvImageTransitionSpeedFade : 300,\n\t\t\tsvImageTransitionEasingFade : 'ease-in-out',\n\t\t\tsvImageTransitionSpeedResize : 300,\n\t\t\tsvImageTransitionEasingResize : 'ease-in-out',\n\t\t\tsvMarginsVH : {\n\t\t\t\tvertical : 140,\n\t\t\t\thorizontal : 120\n\t\t\t},\n\t\t\t// allow keybord and swipe navigation\n\t\t\tkeyboard : true,\n\t\t\tswipe : true,\n\t\t\t// slideshow interval (ms)\n\t\t\tinterval : 4000,\n\t\t\t// if History API is not supported this value will turn false\n\t\t\thistoryapi : true\n\t\t},\n\t\tinit = function( settings, callback ) {\n\n\t\t\tGamma.settings = $.extend( true, {}, defaults, settings );\n\n\t\t\t// cache some elements..\n\t\t\t_config();\n\t\t\t// build the layout\n\t\t\t_layout();\n\t\t\t// init masonry\n\t\t\t_initMasonry( function() {\n\n\t\t\t\t// remove loading status\n\t\t\t\tGamma.container.removeClass( 'gamma-loading' );\n\t\t\t\t// show items\n\t\t\t\tGamma.items.show();\n\n\t\t\t\t// opens the single view if an image id is passed in the url\n\t\t\t\t// we will assume for this demo that the id is the index of the item \n\t\t\t\t// where the image is\n\t\t\t\t// example: http://www.sitename.com/gamma/?img=12\n\t\t\t\tif( Gamma.settings.historyapi ) {\n\n\t\t\t\t\t_goto();\n\n\t\t\t\t}\n\n\t\t\t\t// init window events\n\t\t\t\t_initEvents( 'window' );\n\n\t\t\t\tif( callback ) {\n\n\t\t\t\t\tcallback.call();\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t},\n\t\t_config = function() {\n\n\t\t\tGamma.container = $( '#gamma-container' );\n\t\t\tGamma.overlay = Gamma.container.find( 'div.gamma-overlay' );\n\t\t\tGamma.controls = Gamma.container.children( 'div.gamma-options' );\n\t\t\tGamma.gallery = Gamma.container.children( 'ul.gamma-gallery' );\n\t\t\tGamma.items = Gamma.gallery.children();\n\t\t\tGamma.itemsCount = Gamma.items.length;\n\t\t\tGamma.columns = Gamma.settings.columns;\n\t\t\t// true if any animation (including preloading an image) running\n\t\t\tGamma.isAnimating = true;\n\t\t\tGamma.svMargins = Gamma.settings.svMarginsVH;\n\t\t\tvar History = window.History; // Note: We are using a capital H instead of a lower h\n\t\t\tif ( !History.enabled && Gamma.settings.historyapi ) {\n\n\t\t\t\tGamma.settings.historyapi = false;\n\t\t\t\n\t\t\t}\n\t\t\tGamma.supportTransitions = Modernizr.csstransitions;\n\n\t\t},\n\t\t_createSingleView = function() {\n\n\t\t\t// the single view will include the image, navigation buttons and close, play, and pause buttons\n\n\t\t\tif( !Gamma.singleview ) {\n\n\t\t\t\t$( '
' )\n\t\t\t\t.appendTo( Gamma.container );\n\n\t\t\t\tGamma.singleview = Gamma.container.children( 'div.gamma-single-view' );\n\t\t\t\tGamma.svclose = Gamma.singleview.find( 'button.gamma-btn-close' );\n\n\t\t\t\t_initEvents( 'singleview' );\n\n\t\t\t\t_createSingleViewNavigation();\n\t\t\t\n\t\t\t}\n\t\t\telse if( !Gamma.nav ) {\n\n\t\t\t\t_createSingleViewNavigation();\n\n\t\t\t}\n\n\t\t},\n\t\t_createSingleViewNavigation = function() {\n\n\t\t\tif( Gamma.itemsCount > 1 ) {\n\n\t\t\t\tGamma.svplay = $( '' ).insertAfter( Gamma.svclose );\n\t\t\t\tGamma.nav = $( '' ).appendTo( Gamma.singleview );\n\t\t\t\tGamma.svnavnext = Gamma.nav.find( 'span.gamma-next' );\n\t\t\t\tGamma.svnavprev = Gamma.nav.find( 'span.gamma-prev' );\n\n\t\t\t\t_initEvents( 'singleviewnavigation' );\n\n\t\t\t}\n\n\t\t},\n\t\t// controller: \"goes to\" a specific image or back to the grid\n\t\t_goto = function( anim, id ) {\n\n\t\t\tif( Gamma.settings.historyapi ) {\n\t\t\t\t\n\t\t\t\t// get the url from history state (e.g. id=3) and extract the id\n\t\t\t\tid = id || History.getState().url.queryStringToJSON().id;\n\n\t\t\t}\n\n\t\t\tvar isSingleview = ( id != undefined ),\n\t\t\t\tanim = anim || false;\n\n\t\t\t// back history to a state with no id\n\t\t\tif( Gamma.settings.historyapi && Gamma.isSV && id === undefined ) {\n\n\t\t\t\t_closesingleview();\n\n\t\t\t}\n\n\t\t\tif( isSingleview ) {\n\n\t\t\t\tvar $item = Gamma.items.eq( Math.abs( id ) );\n\n\t\t\t\tif( $item.length ) {\n\n\t\t\t\t\tif( Gamma.svImage ) {\n\n\t\t\t\t\t\t// navigating\n\t\t\t\t\t\tif( Gamma.supportTransitions ) {\n\n\t\t\t\t\t\t\t_setTransition( Gamma.svImage , 'all', Gamma.settings.svImageTransitionSpeedFade , Gamma.settings.svImageTransitionEasingFade );\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_applyAnimation( Gamma.svImage, { opacity : 0 }, Gamma.settings.svImageTransitionSpeedFade, Gamma.supportTransitions, function() {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$( this ).remove();\n\t\t\t\t\t\t\tanim = false;\n\t\t\t\t\t\t\t_singleviewitem( $item, anim );\n\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tif( Gamma.svDescription ) {\n\t\t\t\t\n\t\t\t\t\t\t\t_applyAnimation( Gamma.svDescription, { opacity : 0 }, 400, Gamma.supportTransitions );\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\n\t\t\t\t\t\tif( Gamma.svDescription ) {\n\t\t\t\t\n\t\t\t\t\t\t\tGamma.svDescription.empty();\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_singleviewitem( $item, anim );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t},\n\t\t// saves the history state / or if history not supported goes to specific image\n\t\t_saveState = function( id ) {\n\n\t\t\tif( !Gamma.settings.historyapi && id != undefined ) {\n\n\t\t\t\tGamma.isSV ? _goto( false, id ) : _goto( true, id );\n\n\t\t\t}\n\t\t\telse if( id === undefined ) {\n\n\t\t\t\tHistory.pushState( null, null, url('protocol') + '://' + url('hostname') + url('path') );\n\n\t\t\t}\n\t\t\t// adds a new state to the history object\n\t\t\t// this will trigger the statechange on the window\n\t\t\telse if( History.getState().url.queryStringToJSON().id !== id ) {\n\t\t\t\t\t\n\t\t\t\tHistory.pushState( null, null, '?id=' + id );\n\t\t\t\n\t\t\t}\n\t\t\n\t\t},\n\t\t// transform initial html structure into a list of images (well mostly)\n\t\t_layout = function( $items ) {\n\n\t\t\tif( Gamma.itemsCount > 0 ) {\n\n\t\t\t\t_createSingleView();\n\n\t\t\t}\n\n\t\t\t_setMasonry();\n\n\t\t\tvar $items = $items || Gamma.items.hide();\n\n\t\t\t// replace each div element with an image element with the right source\n\t\t\t$items.each( function() {\n\n\t\t\t\tvar $item = $( this ),\n\t\t\t\t\t$picEl = $item.children(),\n\t\t\t\t\tsources = _getImgSources( $picEl ),\n\t\t\t\t\tsource = _chooseImgSource( sources, $item.outerWidth( true ) ),\n\t\t\t\t\tdescription = $picEl.data( 'description' );\n\n\t\t\t\t// data is saved in the
  • element\n\t\t\t\t$item.data( {\n\t\t\t\t\tdescription : description,\n\t\t\t\t\tsource : sources,\n\t\t\t\t\tmaxwidth : $picEl.data( 'maxWidth' ),\n\t\t\t\t\tmaxheight : $picEl.data( 'maxHeight' )\n\t\t\t\t} );\n\n\t\t\t\t$( '
    ' ).addClass( 'gamma-description' ).html( description ).insertAfter( $picEl );\n\n\t\t\t\t$( '' ).attr( {\n\t\t\t\t\talt : $picEl.data( 'alt' ),\n\t\t\t\t\ttitle : $picEl.data( 'title' ),\n\t\t\t\t\tsrc : source.src\n\t\t\t\t} ).insertAfter( $picEl );\n\n\t\t\t\t$picEl.remove();\n\n\t\t\t} );\n\n\t\t},\n\t\t// gets all possible image sources of an element\n\t\t_getImgSources = function( $el ) {\n\n\t\t\tvar theSources = [];\n\t\t\t$el.children( 'div' ).each( function( i ) {\n\n\t\t\t\tvar $source = $( this );\n\t\t\t\ttheSources.push( {\n\t\t\t\t\twidth : $source.data( 'minWidth' ) || 0,\n\t\t\t\t\tsrc : $source.data( 'src' ),\n\t\t\t\t\tpos : i\n\t\t\t\t} );\n\n\t\t\t} );\n\t\t\t\n\t\t\treturn theSources;\n\n\t\t},\n\t\t// change the number of masonry columns based on the current container's width and the settings.viewport configuration\n\t\t_setMasonry = function() {\n\n\t\t\tvar containerW = Gamma.container.width();\n\n\t\t\tif( Gamma.settings.viewport ) {\n\n\t\t\t\tfor( var i = 0, len = Gamma.settings.viewport.length; i < len; ++i ) {\n\n\t\t\t\t\tvar viewport = Gamma.settings.viewport[i];\n\n\t\t\t\t\tif( containerW > viewport.width ) {\n\n\t\t\t\t\t\tGamma.columns = viewport.columns;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// set the widths (%) for each of the
  • \n\t\t\tGamma.items.css( 'width', Math.floor( containerW / Gamma.columns ) * 100 / containerW + '%' );\n\n\t\t},\n\t\t// initialize masonry\n\t\t_initMasonry = function( callback ) {\n\n\t\t\tGamma.gallery.imagesLoaded( function() {\n\n\t\t\t\tGamma.gallery.masonry( {\n\t\t\t\t\titemSelector : 'li',\n\t\t\t\t\tcolumnWidth : function( containerWidth ) {\n\t\t\t\t\t\treturn containerWidth / Gamma.columns;\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tif( callback ) {\n\n\t\t\t\t\tcallback.call();\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t},\n\t\t// reloads masonry grid\n\t\t_reloadMasonry = function( timeout ) {\n\n\t\t\tclearTimeout( Gamma.masonrytimeout );\n\t\t\ttimeout = timeout || 0;\n\t\t\tGamma.masonrytimeout = setTimeout( function() { Gamma.gallery.masonry( 'reload' ); }, timeout );\n\n\t\t},\n\t\t// choose a source based on the item's size and on the configuration set by the user in the initial HTML\n\t\t_chooseImgSource = function( sources, w ) {\n\n\t\t\tif( w <= 0 ) {\n\t\t\t\tw = 1;\n\t\t\t}\n\n\t\t\tfor( var i = 0, len = sources.length; i < len; ++i ) {\n\n\t\t\t\tvar source = sources[i];\n\n\n\t\t\t\tif( w > source.width ) {\n\n\t\t\t\t\treturn source;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t},\n\t\t// show or hide a specific control button\n\t\t_toggleControl = function( $control, status, animStyle ) {\n\n\t\t\tanimStyle ? $control.css( animStyle ) : status === 'on' ? $control.show() : $control.hide();\n\n\t\t},\n\t\t// triggered on the events for the nav buttons, keyboard, swipe\n\t\t_onnavigate = function( dir ) {\n\n\t\t\tif( !Gamma.slideshow ) {\n\n\t\t\t\t_navigate( dir );\n\n\t\t\t}\n\n\t\t},\n\t\t// goes to next or previous image\n\t\t_navigate = function( dir ) {\n\n\t\t\tif( !Gamma.isSV || Gamma.isAnimating ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t\tvar current = Gamma.current;\n\n\t\t\tif( dir === 'next' ) {\n\n\t\t\t\tGamma.current = Gamma.current < Gamma.itemsCount - 1 ? ++Gamma.current :\n\t\t\t\t\tGamma.settings.circular ? 0 : Gamma.current;\n\n\t\t\t}\n\t\t\telse if( dir === 'prev' ) {\n\n\t\t\t\tGamma.current = Gamma.current > 0 ? --Gamma.current :\n\t\t\t\t\tGamma.settings.circular ? Gamma.itemsCount - 1 : Gamma.current;\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif( current === Gamma.current ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t\tGamma.isAnimating = true;\n\n\t\t\t// get positions, dimentions and source for the new item\n\t\t\t_saveState( Gamma.current );\n\n\t\t},\n\t\t// resize the window event\n\t\t_resize = function() {\n\n\t\t\t_setMasonry();\n\n\t\t\t_resizeGrid();\n\n\t\t\t// change the size, position and source of the image (single view) accordingly\n\t\t\tif( Gamma.isSV ) {\n\n\t\t\t\t_svResizeImage();\n\n\t\t\t}\n\n\t\t\t// seems that sometimes the masonry columns stay out of order.\n\t\t\t// just to make sure this doesnt happen\n\t\t\t_reloadMasonry( 200 );\n\n\t\t},\n\t\t// resizes the masonry grid\n\t\t// change the source of the images (grid) accordingly\n\t\t_resizeGrid = function() {\n\n\t\t\tGamma.items.each( function() {\n\n\t\t\t\tvar $item = $( this ),\n\t\t\t\t\tsource = _chooseImgSource( $item.data( 'source' ), Gamma.items.outerWidth( true ) );\n\n\t\t\t\t$item.find( 'img' ).attr( 'src', source.src );\n\n\t\t\t} );\n\n\t\t}\n\t\t// resize and chooses (if necessary) a new source for the image in the single view\n\t\t_svResizeImage = function( callback ) {\n\n\t\t\t// need to know which source to load for the image.\n\t\t\t// also need to know the final size and position.\n\t\t\tvar finalConfig = _getFinalImgConfig( {\n\n\t\t\t\t\tsources : Gamma.svImage.data( 'source' ),\n\t\t\t\t\timgMaxW : Gamma.svImage.data( 'maxwidth' ),\n\t\t\t\t\timgMaxH : Gamma.svImage.data( 'maxheight' ),\n\t\t\t\t\twrapper : { width : $window.width() - Gamma.svMargins.horizontal, height : $window.height() - Gamma.svMargins.vertical },\n\t\t\t\t\timage : { width : Gamma.svImage.width(), height : Gamma.svImage.height() }\n\n\t\t\t\t} ),\n\t\t\t\tsource = finalConfig.source,\n\t\t\t\tfinalSizePosition = finalConfig.finalSizePosition,\n\n\t\t\t\tcurrentSrc = Gamma.svImage.attr('src'),\n\n\t\t\t\tfinalStyle = {\n\t\t\t\t\twidth : finalSizePosition.width,\n\t\t\t\t\theight : finalSizePosition.height,\n\t\t\t\t\tleft : finalSizePosition.left + Gamma.svMargins.horizontal / 2,\n\t\t\t\t\ttop : finalSizePosition.top + Gamma.svMargins.vertical / 2\n\t\t\t\t};\n\n\t\t\t_applyAnimation( Gamma.svImage, finalStyle, Gamma.settings.svImageTransitionSpeedResize, Gamma.supportTransitions, function() {\n\n\t\t\t\tif( Gamma.supportTransitions ) {\n\t\t\t\t\t$( this ).off( transEndEventName );\n\t\t\t\t}\n\n\t\t\t\t// if source changes, change reset Gamma.svImage\n\t\t\t\tif( currentSrc !== source.src ) {\n\n\t\t\t\t\t// going to load a new image..\n\t\t\t\t\tGamma.isAnimating = true;\n\n\t\t\t\t\tvar w = Gamma.svImage.width(),\n\t\t\t\t\t\th = Gamma.svImage.height(),\n\t\t\t\t\t\tl = Gamma.svImage.position().left,\n\t\t\t\t\t\tt = Gamma.svImage.position().top;\n\n\t\t\t\t\tGamma.svImage = $( '' ).load( function() {\n\n\t\t\t\t\t\tvar $img = $( this );\n\n\t\t\t\t\t\tif( Gamma.supportTransitions ) {\n\n\t\t\t\t\t\t\t_setTransition( $img , 'all', Gamma.settings.svImageTransitionSpeedResize , Gamma.settings.svImageTransitionEasingResize );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_applyAnimation( $img.next(), { opacity : 0 }, 500, Gamma.supportTransitions, function() {\n\n\t\t\t\t\t\t\tvar $img = $( this );\n\t\t\t\t\t\t\tif( Gamma.supportTransitions ) {\n\t\t\t\t\t\t\t\t$( this ).off( transEndEventName );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$img.remove();\n\t\t\t\t\t\t\tGamma.isAnimating = false;\n\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t} )\n\t\t\t\t\t.css( { width : w, height : h, left : l, top : t } )\n\t\t\t\t\t.data( Gamma.svImage.data() )\n\t\t\t\t\t.insertBefore( Gamma.svImage )\n\t\t\t\t\t.attr( 'src', source.src );\n\n\t\t\t\t}\n\n\t\t\t\tif( callback ) {\n\n\t\t\t\t\tcallback.call();\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t},\n\t\t// gets the position and sizes of the image given its container properties\n\t\t_getFinalImgConfig = function( properties ) {\n\n\t\t\tvar sources = properties.sources,\n\t\t\t\timgMaxW = properties.imgMaxW || 0,\n\t\t\t\timgMaxH = properties.imgMaxH || 0,\n\t\t\t\tsource = _chooseImgSource( sources, properties.wrapper.width ), \n\t\t\t\t// calculate final size and position of image\n\t\t\t\tfinalSizePosition = _getFinalSizePosition( properties.image, properties.wrapper );\n\n\t\t\t// check for new source\n\t\t\tif( finalSizePosition.checksource ) {\n\n\t\t\t\tsource = _chooseImgSource( sources, finalSizePosition.width );\n\n\t\t\t}\n\n\t\t\t// we still need to check one more detail:\n\t\t\t// if the source is the largest one provided in the html rules,\n\t\t\t// then we need to check if the final width/height are eventually bigger\n\t\t\t// than the original image sizes. If so, we will show the image \n\t\t\t// with its original size, avoiding like this that the image gets pixelated\n\t\t\tif( source.pos === 0 && ( imgMaxW !== 0 && finalSizePosition.width > imgMaxW || imgMaxH !== 0 && finalSizePosition.height > imgMaxH ) ) {\n\n\t\t\t\tif( imgMaxW !== 0 && finalSizePosition.width > imgMaxW ) {\n\n\t\t\t\t\tvar ratio = finalSizePosition.width / imgMaxW;\n\t\t\t\t\tfinalSizePosition.width = imgMaxW;\n\t\t\t\t\tfinalSizePosition.height /= ratio;\n\n\t\t\t\t}\n\t\t\t\telse if( imgMaxH !== 0 && finalSizePosition.height > imgMaxH ) {\n\n\t\t\t\t\tvar ratio = finalSizePosition.height / imgMaxH;\n\t\t\t\t\tfinalSizePosition.height = imgMaxH;\n\t\t\t\t\tfinalSizePosition.width /= ratio;\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tfinalSizePosition.left = properties.wrapper.width / 2 - finalSizePosition.width / 2;\n\t\t\t\tfinalSizePosition.top = properties.wrapper.height / 2 - finalSizePosition.height / 2;\n\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tsource : source,\n\t\t\t\tfinalSizePosition : finalSizePosition\n\t\t\t};\n\n\t\t},\n\t\t// triggered when one grid image is clicked\n\t\t_singleview = function() {\n\n\t\t\tvar id = $( this ).index();\n\t\t\t_saveState( id );\n\n\t\t},\n\t\t// shows the item\n\t\t_singleviewitem = function( $item, anim ) {\n\n\t\t\tGamma.isSV = true;\n\n\t\t\tvar id = $item.index(),\n\t\t\t\tdata = $item.data(),\n\t\t\t\t$img = $item.children( 'img' );\n\t\t\t\t\n\t\t\tif( anim ) {\n\n\t\t\t\tGamma.fly = $( '' ).attr( 'src', $img.attr( 'src' ) ).addClass( 'gamma-img-fly' ).css( {\n\t\t\t\t\twidth : $img.width(),\n\t\t\t\t\theight : $img.height(),\n\t\t\t\t\tleft : $item.offset().left + ( $item.outerWidth( true ) - $item.width() ) / 2,\n\t\t\t\t\ttop : $item.offset().top + ( $item.outerHeight( true ) - $item.height() ) / 2\n\t\t\t\t} ).appendTo( $body );\n\n\t\t\t\tif( Gamma.supportTransitions ) {\n\n\t\t\t\t\t_setTransition( Gamma.fly );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\t\n\t\t\t// need to know which source to load for the image.\n\t\t\t// also need to know the final size and position.\n\t\t\tvar\tfinalConfig = _getFinalImgConfig( {\n\n\t\t\t\t\tsources : $item.data( 'source' ),\n\t\t\t\t\timgMaxW : $item.data( 'maxwidth' ),\n\t\t\t\t\timgMaxH : $item.data( 'maxheight' ),\n\t\t\t\t\twrapper : { width : $window.width() - Gamma.svMargins.horizontal, height : $window.height() - Gamma.svMargins.vertical },\n\t\t\t\t\timage : { width : $img.width(), height : $img.height() }\n\n\t\t\t\t} ),\t\n\t\t\t\tsource = finalConfig.source,\n\t\t\t\tfinalSizePosition = finalConfig.finalSizePosition;\n\n\t\t\tGamma.current = id;\n\n\t\t\t// transition: overlay opacity\n\t\t\tGamma.overlay.show();\n\n\t\t\tif( Gamma.settings.overlayAnimated && anim && Gamma.supportTransitions ) {\n\n\t\t\t\t_setTransition( Gamma.overlay , 'opacity' );\n\n\t\t\t}\n\t\t\t\n\t\t\tsetTimeout( function() {\n\n\t\t\t\t_applyAnimation( Gamma.overlay, { 'opacity' : 1 }, Gamma.settings.speed, Gamma.supportTransitions || !anim, function() {\n\n\t\t\t\t\tif( !Gamma.isSV ) {\n\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif( Gamma.supportTransitions ) {\n\t\t\t\t\t\t$( this ).off( transEndEventName );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// set the overflow-y to hidden\n\t\t\t\t\t$body.css( 'overflow-y', 'hidden' );\n\t\t\t\t\t// force repaint. Chrome in Windows does not remove overflow..\n\t\t\t\t\t// http://stackoverflow.com/a/3485654/989439\n\t\t\t\t\tvar el = Gamma.overlay[0];\n\t\t\t\t\tel.style.display='none';\n\t\t\t\t\tel.offsetHeight; // no need to store this anywhere, the reference is enough\n\t\t\t\t\tel.style.display='block';\n\n\t\t\t\t} );\n\n\t\t\t\t$item.css( 'visibility', 'hidden' );\n\n\t\t\t\tif( !anim ) {\n\n\t\t\t\t\t_loadSVItemFromGrid( data, finalSizePosition, source.src );\n\n\t\t\t\t}\n\t\t\t\telse {\n\n\t\t\t\t\tvar styleCSS = {\n\t\t\t\t\t\t\twidth : finalSizePosition.width,\n\t\t\t\t\t\t\theight : finalSizePosition.height,\n\t\t\t\t\t\t\tleft : finalSizePosition.left + $window.scrollLeft() + Gamma.svMargins.horizontal / 2,\n\t\t\t\t\t\t\ttop : finalSizePosition.top + $window.scrollTop() + Gamma.svMargins.vertical / 2\n\t\t\t\t\t\t}, \n\t\t\t\t\t\tcond = Gamma.supportTransitions;\n\n\t\t\t\t\t_applyAnimation( Gamma.fly, styleCSS, Gamma.settings.speed, cond, function() {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( cond ) {\n\t\t\t\t\t\t\t$( this ).off( transEndEventName );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_loadSVItemFromGrid( data, finalSizePosition, source.src );\n\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t}, 25 );\n\n\t\t},\n\t\t// load new image for the new item to show\n\t\t_loadSVItemFromGrid = function( data, position, src ) {\n\n\t\t\t// show single view\n\t\t\tGamma.singleview.show();\n\n\t\t\t// add description\n\t\t\tif( !Gamma.svDescription ) {\n\t\t\t\t\n\t\t\t\tGamma.svDescription = $( '
    ' )\n\t\t\t\t\t\t\t\t\t\t.addClass( 'gamma-description' )\n\t\t\t\t\t\t\t\t\t\t.appendTo( Gamma.singleview ).wrap( '
    ' );\n\n\t\t\t\tif( Gamma.supportTransitions ) {\n\n\t\t\t\t\t_setTransition( Gamma.svDescription , 'opacity', Gamma.settings.svImageTransitionSpeedFade / 2 , Gamma.settings.svImageTransitionEasingFade );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tGamma.svDescription.html( data.description );\n\n\t\t\t// loading status: give a little amount of time before displaying it\n\t\t\tvar loadingtimeout = setTimeout( function() { Gamma.singleview.addClass( 'gamma-loading' );\t}, Gamma.settings.svImageTransitionSpeedFade + 250 );\n\t\t\t\n\t\t\t// preload the new image\n\t\t\tGamma.svImage = $( '' ).load( function() {\n\n\t\t\t\tvar $img = $( this );\n\n\t\t\t\t// remove loading status\n\t\t\t\tclearTimeout( loadingtimeout );\n\t\t\t\tGamma.singleview.removeClass( 'gamma-loading' );\n\n\t\t\t\tsetTimeout( function() {\n\n\t\t\t\t\t_applyAnimation( Gamma.svDescription, { 'opacity' : 1 }, Gamma.settings.svImageTransitionSpeedFade / 2, Gamma.supportTransitions );\n\n\t\t\t\t}, 25 );\n\n\t\t\t\t$img.css( {\n\t\t\t\t\twidth : position.width,\n\t\t\t\t\theight : position.height,\n\t\t\t\t\tleft : position.left + Gamma.svMargins.horizontal / 2,\n\t\t\t\t\ttop : position.top + Gamma.svMargins.vertical / 2\n\t\t\t\t} ).appendTo( Gamma.singleview );\n\n\t\t\t\tif( Gamma.supportTransitions ) {\n\n\t\t\t\t\t_setTransition( $img , 'all', Gamma.settings.svImageTransitionSpeedResize , Gamma.settings.svImageTransitionEasingResize );\n\n\t\t\t\t}\n\n\t\t\t\tif( Gamma.fly ) {\n\t\t\t\t\t\n\t\t\t\t\tif( Gamma.supportTransitions ) {\n\n\t\t\t\t\t\t_setTransition( Gamma.fly, 'opacity', 1000 );\n\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout( function() {\n\n\t\t\t\t\t\t_applyAnimation( Gamma.fly, { 'opacity' : 0 }, 1000, Gamma.supportTransitions, function() {\n\n\t\t\t\t\t\t\tvar $this = $( this );\n\n\t\t\t\t\t\t\tif( Gamma.supportTransitions ) {\n\t\t\t\t\t\t\t\t$this.off( transEndEventName );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this.remove();\n\t\t\t\t\t\t\tGamma.fly = null;\n\t\t\t\t\t\t\tGamma.isAnimating = false;\n\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t}, 25 );\n\n\t\t\t\t}\n\t\t\t\telse {\n\n\t\t\t\t\tGamma.isAnimating = false;\n\n\t\t\t\t}\n\n\t\t\t} ).data( data ).attr( 'src', src );\n\n\t\t},\n\t\t// given the wrapper's width and height, calculates the final width, height, left and top for the image to fit inside\n\t\t_getFinalSizePosition = function( imageSize, wrapperSize ) {\n\n\t\t\t// image size\n\t\t\tvar imgW = imageSize.width,\n\t\t\t\timgH = imageSize.height,\n\n\t\t\t\t// container size\n\t\t\t\twrapperW = wrapperSize.width,\n\t\t\t\twrapperH = wrapperSize.height,\n\n\t\t\t\tfinalW, finalH, finalL, finalT,\n\t\t\t\t// flag to indicate we could check for another source (smaller) for the image\n\t\t\t\tchecksource = false;\n\n\t\t\t// check which image side is bigger\n\t\t\tif( imgW > imgH ) {\n\n\t\t\t\tfinalW = wrapperW;\n\t\t\t\t// calculate the height given the finalW\n\t\t\t\tvar ratio = imgW / wrapperW;\n\n\t\t\t\tfinalH = imgH / ratio;\n\t\t\t\t\n\t\t\t\tif( finalH > wrapperH ) {\n\n\t\t\t\t\tchecksource = true;\n\t\t\t\t\tratio = finalH / wrapperH;\n\t\t\t\t\tfinalW /= ratio;\n\t\t\t\t\tfinalH = wrapperH;\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tfinalH = wrapperH;\n\t\t\t\t// calculate the width given the finalH\n\t\t\t\tvar ratio = imgH / wrapperH;\n\n\t\t\t\tfinalW = imgW / ratio;\n\n\t\t\t\tchecksource = true;\n\t\t\t\t\n\t\t\t\tif( finalW > wrapperW ) {\n\n\t\t\t\t\tchecksource = false;\n\n\t\t\t\t\tratio = finalW / wrapperW;\n\t\t\t\t\tfinalW = wrapperW;\n\t\t\t\t\tfinalH /= ratio;\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\twidth : finalW,\n\t\t\t\theight : finalH,\n\t\t\t\tleft : wrapperW / 2 - finalW / 2,\n\t\t\t\ttop : wrapperH / 2 - finalH / 2,\n\t\t\t\tchecksource : checksource\n\t\t\t};\n\n\t\t},\n\t\t// closes the single view\n\t\t_closesingleview = function() {\n\n\t\t\tif( Gamma.isAnimating || Gamma.fly ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t\tGamma.isSV = false;\n\n\t\t\tif( Gamma.slideshow ) {\n\n\t\t\t\t_stopSlideshow();\n\n\t\t\t}\n\n\t\t\tvar $item = Gamma.items.eq( Gamma.current ),\n\t\t\t\t$img = $item.children( 'img' );\n\n\t\t\tGamma.items.not( $item ).css( 'visibility', 'visible' );\n\n\t\t\t// scroll window to item's position if item is not \"partially\" visible\n\t\t\tvar wst = $window.scrollTop();\n\n\t\t\tif( !$item.is( ':inViewport' ) ) {\n\n\t\t\t\twst = $item.offset().top + ( $item.outerHeight( true ) - $item.height() ) / 2;\n\n\t\t\t\tvar diff = $document.height() - $window.height();\n\n\t\t\t\tif( wst > diff ) {\n\t\t\t\t\t\n\t\t\t\t\twst = diff;\n\t\t\t\t}\n\n\t\t\t\t$window.scrollTop( wst );\n\n\t\t\t}\n\n\t\t\tvar l = Gamma.svImage.position().left + $window.scrollLeft(),\n\t\t\t\tt = Gamma.svImage.position().top + wst;\n\n\t\t\tGamma.svImage.appendTo( $body ).css( {\n\t\t\t\tposition : 'absolute',\n\t\t\t\tzIndex : 10000,\n\t\t\t\tleft : l,\n\t\t\t\ttop : t \n\t\t\t} );\n\t\t\t\n\t\t\tif( Gamma.supportTransitions ) {\n\n\t\t\t\t_setTransition( Gamma.svImage );\n\n\t\t\t}\n\n\t\t\tGamma.singleview.hide();\n\t\t\tGamma.svDescription.empty().css( 'opacity', 0 );\n\t\t\t$body.css( 'overflow-y', 'scroll' );\n\n\t\t\tsetTimeout( function() {\n\n\t\t\t\tvar styleCSS = {\n\t\t\t\t\twidth : $img.width(),\n\t\t\t\t\theight : $img.height(),\n\t\t\t\t\tleft : $item.offset().left + ( $item.outerWidth( true ) - $item.width() ) / 2,\n\t\t\t\t\ttop : $item.offset().top + ( $item.outerHeight( true ) - $item.height() ) / 2\n\t\t\t\t}\n\t\t\t\t_applyAnimation( Gamma.svImage, styleCSS, Gamma.settings.speed, Gamma.supportTransitions, function() {\n\t\t\t\t\t\t\n\t\t\t\t\t$item.css( 'visibility', 'visible' );\n\t\t\t\t\t$( this ).remove();\n\t\t\t\t\tGamma.svImage = null;\n\n\t\t\t\t} );\n\n\t\t\t\t// transition: overlay opacity\n\t\t\t\tif( Gamma.settings.overlayAnimated ) {\n\n\t\t\t\t\tif( Gamma.supportTransitions ) {\n\n\t\t\t\t\t\t_setTransition( Gamma.overlay , 'opacity' );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t_applyAnimation( Gamma.overlay, { 'opacity' : 0 }, Gamma.settings.speed, Gamma.supportTransitions, function() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tvar $this = $( this );\n\n\t\t\t\t\t\tif( Gamma.supportTransitions ) {\n\t\t\t\t\t\t\t$this.off( transEndEventName );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this.hide();\n\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\t\t\t\telse {\n\n\t\t\t\t\tGamma.overlay.hide();\n\n\t\t\t\t}\n\n\t\t\t\t_saveState();\n\n\t\t\t}, 25 );\n\n\t\t},\n\t\t// the slideshow is active only if the page is visible\n\t\t_visChange = function() {\n\n\t\t\tif( Gamma.slideshow ) {\n\n\t\t\t\tisHidden() ? ( _stopSlideshow( true ), Gamma.slideshow = true ) : _prepareSlideshow();\n\n\t\t\t}\n\n\t\t},\n\t\t// before slideshow starts\n\t\t_prepareSlideshow = function() {\n\n\t\t\tif( Gamma.isAnimating && !Gamma.slideshow ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tGamma.isAnimating = true;\n\n\t\t\tclearTimeout( Gamma.slideshowtimeout );\n\n\t\t\tGamma.slideshow = true;\n\t\t\t// container is the window\n\t\t\tGamma.svMargins = {\n\t\t\t\tvertical : 0,\n\t\t\t\thorizontal : 0\n\t\t\t};\n\t\t\t_toggleControl( Gamma.svclose, 'off' );\n\t\t\t_toggleControl( Gamma.svnavprev, 'off', { left : -40 } );\n\t\t\t_toggleControl( Gamma.svnavnext, 'off', { right : -40 } );\n\t\t\t\n\t\t\t_svResizeImage( function() {\n\n\t\t\t\tGamma.isAnimating = false;\n\n\t\t\t\tGamma.svplay.addClass( 'gamma-btn-sspause' );\n\t\t\t\t_startSlideshow();\n\n\t\t\t} );\n\n\t\t},\n\t\t_preloadNext = function() {\n\n\t\t\t// preload image for Gamma.current + 1\n\t\t\tvar next = Gamma.current < Gamma.itemsCount - 1 ? Gamma.current + 1 :\n\t\t\t\tGamma.settings.circular ? 0 : Gamma.current,\n\t\t\t\t$item = Gamma.items.eq( next ),\n\t\t\t\t$img = $item.children( 'img' ),\n\t\t\t\tfinalConfig = _getFinalImgConfig( {\n\n\t\t\t\t\tsources : $item.data( 'source' ),\n\t\t\t\t\timgMaxW : $item.data( 'maxwidth' ),\n\t\t\t\t\timgMaxH : $item.data( 'maxheight' ),\n\t\t\t\t\twrapper : { width : $window.width() - Gamma.svMargins.horizontal, height : $window.height() - Gamma.svMargins.vertical },\n\t\t\t\t\timage : { width : $img.width(), height : $img.height() }\n\n\t\t\t\t} ),\t\n\t\t\t\tsource = finalConfig.source;\n\n\t\t\t$( '' ).attr( 'src', source.src );\n\n\t\t},\n\t\t// starts slideshow\n\t\t_startSlideshow = function() {\n\n\t\t\t_preloadNext();\n\n\t\t\tGamma.slideshowtimeout = setTimeout( function() {\n\n\t\t\t\t_navigate( 'next' );\n\t\t\t\t_startSlideshow();\n\n\t\t\t}, Gamma.settings.interval );\n\n\t\t},\n\t\t// stops slideshow\n\t\t_stopSlideshow = function( pause ) {\n\n\t\t\tif( Gamma.isAnimating ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tGamma.isAnimating = true;\n\n\t\t\tclearTimeout( Gamma.slideshowtimeout );\n\t\t\tif( !pause ) {\n\n\t\t\t\tGamma.slideshow = false;\n\t\t\t\tGamma.svplay.removeClass( 'gamma-btn-sspause' );\n\t\t\t\tGamma.svMargins = Gamma.settings.svMarginsVH;\n\t\t\t\t_toggleControl( Gamma.svclose, 'on' );\n\t\t\t\t_toggleControl( Gamma.svnavprev, 'on', { left : 20 } );\n\t\t\t\t_toggleControl( Gamma.svnavnext, 'on', { right : 20 } );\n\t\t\t\t_svResizeImage( function() {\n\n\t\t\t\t\tGamma.isAnimating = false;\n\n\t\t\t\t} );\n\t\t\t\n\t\t\t}\n\n\t\t},\n\t\t// initializes events according to type\n\t\t_initEvents = function( type ) {\n\n\t\t\tswitch( type ) {\n\n\t\t\t\tcase 'window' : \n\n\t\t\t\t\tif( Gamma.settings.historyapi ) {\n\n\t\t\t\t\t\t$window.on( 'statechange.gamma', function() {\n\n\t\t\t\t\t\t\t_goto( true );\n\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$window.on( 'smartresize.gamma', _resize );\n\n\t\t\t\t\t// use the property name to generate the prefixed event name\n\t\t\t\t\tvar visProp = getHiddenProp();\n\t\t\t\t\t\n\t\t\t\t\t// HTML5 PageVisibility API\n\t\t\t\t\t// http://www.html5rocks.com/en/tutorials/pagevisibility/intro/\n\t\t\t\t\t// by Joe Marini (@joemarini)\n\t\t\t\t\tif (visProp) {\n\n\t\t\t\t\t\tvar evtname = visProp.replace(/[H|h]idden/,'') + 'visibilitychange';\n\t\t\t\t\t\tdocument.addEventListener(evtname, _visChange);\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'singleview' : \n\n\t\t\t\t\tGamma.gallery.on( 'click.gamma', 'li', _singleview );\n\t\t\t\t\tGamma.svclose.on( 'click.gamma', _closesingleview );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'singleviewnavigation' : \n\n\t\t\t\t\tGamma.svnavnext.on( 'click.gamma', function() { _onnavigate( 'next' ); } );\n\t\t\t\t\tGamma.svnavprev.on( 'click.gamma', function() { _onnavigate( 'prev' ); } );\n\n\t\t\t\t\tif( Gamma.settings.nextOnClickImage ) {\n\n\t\t\t\t\t\tGamma.singleview.on( 'click.gamma', 'img', function() { _onnavigate( 'next' ); } );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( Gamma.settings.keyboard ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$document.on( 'keydown.gamma', function( event ) {\n\n\t\t\t\t\t\t\tvar keyCode = event.keyCode || event.which,\n\t\t\t\t\t\t\t\tarrow = {\n\t\t\t\t\t\t\t\t\tleft: 37,\n\t\t\t\t\t\t\t\t\tup: 38,\n\t\t\t\t\t\t\t\t\tright: 39,\n\t\t\t\t\t\t\t\t\tdown: 40\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tswitch (keyCode) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcase arrow.left :\n\n\t\t\t\t\t\t\t\t\t_onnavigate( 'prev' );\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcase arrow.right :\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t_onnavigate( 'next' );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif( Gamma.settings.swipe ) {\n\n\t\t\t\t\t\tGamma.singleview.on( {\n\t\t\t\t\t\t\t'swipeleft.gamma' : function() {\n\n\t\t\t\t\t\t\t\t_onnavigate( 'next' );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t'swiperight.gamma' : function() {\n\n\t\t\t\t\t\t\t\t_onnavigate( 'prev' );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tGamma.svplay.on( 'click.gamma', function() {\n\n\t\t\t\t\t\tif( Gamma.slideshow ) {\n\n\t\t\t\t\t\t\t_stopSlideshow();\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if( !Gamma.isAnimating ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_prepareSlideshow();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\n\t\t\t};\n\n\t\t},\n\t\t// sets a transition for an element\n\t\t_setTransition = function( el , property, speed, easing ) {\n\n\t\t\tif( !property ) {\n\n\t\t\t\tproperty = 'all';\n\n\t\t\t}\n\t\t\tif( !speed ) {\n\n\t\t\t\tspeed = Gamma.settings.speed;\n\n\t\t\t}\n\t\t\tif( !easing ) {\n\n\t\t\t\teasing = Gamma.settings.easing;\n\n\t\t\t}\n\n\t\t\tel.css( 'transition', property + ' ' + speed + 'ms ' + easing );\n\n\t\t},\n\t\t// apply a transition or fallback to jquery animate based on condition (cond)\n\t\t_applyAnimation = function( el, styleCSS, speed, cond, fncomplete ) {\n\n\t\t\t$.fn.applyStyle = cond ? $.fn.css : $.fn.animate;\n\n\t\t\tif( fncomplete && cond ) {\n\n\t\t\t\tel.on( transEndEventName, fncomplete );\n\n\t\t\t}\n\n\t\t\tfncomplete = fncomplete || function() { return false; };\n\n\t\t\tel.stop().applyStyle( styleCSS, $.extend( true, [], { duration : speed + 'ms', complete : fncomplete } ) );\n\n\t\t},\n\t\t// public method: adds more items\n\t\tadd = function( $newitems ) {\n\n\t\t\tGamma.gallery.append( $newitems );\n\t\t\tGamma.items = Gamma.gallery.children();\n\t\t\tGamma.itemsCount = Gamma.items.length;\n\t\t\t_layout( $newitems );\n\t\t\t_reloadMasonry();\n\n\t\t};\n\n\treturn {\n\t\tinit : init,\n\t\tadd : add\n\t}\n\n})();"]}