├── static ├── img │ ├── bck.png │ └── logo │ │ ├── classic.svg │ │ └── preload.svg ├── css │ ├── parallax.css │ └── sample.css └── js │ ├── third_party │ ├── jquery.mousewheel.js │ ├── modernizr.custom.js │ ├── jquery.custom.js │ └── jquery.js │ ├── sample.js │ └── parallax.js ├── LICENSE.md ├── README.md └── index.html /static/img/bck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/htdt/parallax/HEAD/static/img/bck.png -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright 2013 Hot Dot 4 | http://hotdot.pro/ 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /static/css/parallax.css: -------------------------------------------------------------------------------- 1 | 2 | html{ 3 | height: 100%; 4 | overflow: hidden; 5 | } 6 | 7 | body { 8 | 9 | height: 100%; 10 | font-size: 10px; 11 | 12 | } 13 | 14 | .disable-hover { 15 | pointer-events: none; 16 | } 17 | 18 | /* Параллакс в общем */ 19 | 20 | *[alt]{ 21 | bottom: 0px; 22 | } 23 | 24 | 25 | .unloaded { 26 | overflow: hidden; 27 | 28 | } 29 | .unloaded #parallax { 30 | overflow: hidden; 31 | position: relative; 32 | } 33 | 34 | .loadBackground, 35 | .preloaderCont { 36 | height : 100%; 37 | width: 100%; 38 | position: absolute; 39 | z-index: 2; 40 | left: 0px; 41 | top: 0px; 42 | } 43 | .loadBackground{ 44 | 45 | background-color: black; 46 | display: block; 47 | } 48 | 49 | .preloaderCont { 50 | 51 | text-align: center; 52 | background: rgba(0,0,0,.3); 53 | 54 | } 55 | 56 | .preloaderCont .ending, 57 | .preloaderCont .starting { 58 | width: 0px; 59 | } 60 | 61 | .preloaderCont img { 62 | width: 200px; 63 | height: 51px; 64 | } 65 | 66 | 67 | .preloaderCont .ending, 68 | .preloaderCont .starting { 69 | overflow: hidden; 70 | display: inline-block; 71 | top:0px; 72 | } 73 | 74 | .preloaderCont .starting > * { 75 | float: right; 76 | } 77 | 78 | .preloaderCont .ending > * { 79 | float: left; 80 | } 81 | 82 | /* */ 83 | 84 | .preloaderCont:after, 85 | .para-totalCenterAlign:after, 86 | .para-Aligner:after { 87 | content: ""; 88 | display: inline-block; 89 | vertical-align: middle; 90 | height: 100%; 91 | width: 0px; 92 | background: yellow; 93 | } 94 | 95 | .para-vAligner > *, 96 | .para-totalCenterAlign > *, 97 | .preloaderCont > * { 98 | 99 | display: inline-block; 100 | vertical-align: middle; 101 | } 102 | 103 | .para-totalCenterAlign { 104 | text-align: center 105 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Hot Dot Parallax Engine 2 | ======================= 3 | 4 | See it in action 5 | 6 | Code example in index.html 7 | 8 | Features 9 | -------- 10 | - Horizontal slide-based-parallax with as many slides as you need. 11 | - Easy to use! You don't need to write any JavaScript-code to make layers float with different speeds inside any of the slides. 12 | - Positioning calculations are highly optimized. 13 | - Smooth eased scroll that can be attached to any of your controls. 14 | - Hashtags: share any of your slides directly! 15 | - Key events like start of the scroll, end of the scroll or every step of the scroll are generated—you can bind anything to them. 16 | - Preloader. 17 | - Hardware acceleration that can be switched on or off depending on the device-OS-browser combination. 18 | - Deep optimization: you can pause everything in your slide when the user is in the process of scrolling. Greatly enhances the experience and spares battery life on any platform. 19 | - "Pointer-events:none"-optimization 20 | 21 | Adaptivity-special features 22 | -------- 23 | - Resizeable-engine will fit the slide to the window or fill the window with it, if you want. When set, the rule works despite any window size change. 24 | - Background image size is not fixed! You don't need to calculate anything—just plug in wide image for the background. 25 | - Want to switch orientation of the slide depending on aspect ratio? Use Resizeable-engine to do it with ease. 26 | - Proven to work well with touch devices and ready for iOS and Android platforms. 27 | 28 | 29 | 30 | Made in Hot Dot by Fyodor Ananiev. 31 | Licensed under MIT. 32 | -------------------------------------------------------------------------------- /static/css/sample.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | border: 0; 5 | } 6 | 7 | .fillParent { 8 | width: 100%; 9 | height: 100% 10 | } 11 | 12 | /* Футер */ 13 | 14 | a { 15 | color: #dc2222; 16 | } 17 | 18 | #footer{ 19 | 20 | position: fixed; 21 | z-index: 2; 22 | width: 100%; 23 | height:77px; 24 | text-align: center; 25 | font-size:10px; 26 | /* Хак */ 27 | text-align: right; 28 | bottom: -15px; 29 | color: gray; 30 | 31 | right: 0px; 32 | padding-right: 60px; 33 | box-sizing: border-box; 34 | } 35 | 36 | /* */ 37 | 38 | #layouts .portrait.story { 39 | width: 300px; 40 | } 41 | 42 | #layouts .portrait .padded { 43 | padding: 200px 30px; 44 | } 45 | 46 | #layouts .portrait .landscapeOnly { 47 | display: none; 48 | } 49 | #layouts .portraitOnly, 50 | #layouts .landscapeOnly { 51 | margin-top: 20px; 52 | } 53 | 54 | #layouts .landscape .portraitOnly { 55 | display: none; 56 | } 57 | 58 | /* */ 59 | 60 | body { 61 | font-family: Helvetica, sans-serif; 62 | background: black; 63 | } 64 | 65 | .popularResolution { 66 | width: 1366px; 67 | height:768px; 68 | position: absolute; 69 | left: 50%; 70 | top: 50%; 71 | margin-left: -683px; 72 | margin-top: -384px; 73 | 74 | } 75 | 76 | #footer { 77 | font-size: 20px; 78 | } 79 | .story { 80 | text-align: left; 81 | width: 600px; 82 | background: rgba(255, 255, 255, 0.88); 83 | font-size: 20px; 84 | position: relative; 85 | } 86 | .story>.padded { 87 | padding: 30px; 88 | } 89 | .story p+p { 90 | margin-top: 10px; 91 | } 92 | 93 | .fastLayer { 94 | position:absolute; 95 | 96 | } 97 | .fastLayer > * { 98 | position:absolute; 99 | left: 0px; 100 | top: 0px; 101 | 102 | } 103 | 104 | #scaling .padded { 105 | padding: 40% 20%; 106 | } 107 | 108 | .story .hint { 109 | display: block; 110 | color: gray; 111 | font-style: italic; 112 | font-size: 70%; 113 | } -------------------------------------------------------------------------------- /static/js/third_party/jquery.mousewheel.js: -------------------------------------------------------------------------------- 1 | /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) 2 | * Licensed under the MIT License (LICENSE.txt). 3 | * 4 | * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. 5 | * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. 6 | * Thanks to: Seamus Leahy for adding deltaX and deltaY 7 | * 8 | * Version: 3.0.6 9 | * 10 | * Requires: 1.2.2+ 11 | */ 12 | 13 | (function($) { 14 | 15 | var types = ['DOMMouseScroll', 'mousewheel']; 16 | 17 | if ($.event.fixHooks) { 18 | for ( var i=types.length; i; ) { 19 | $.event.fixHooks[ types[--i] ] = $.event.mouseHooks; 20 | } 21 | } 22 | 23 | $.event.special.mousewheel = { 24 | setup: function() { 25 | if ( this.addEventListener ) { 26 | for ( var i=types.length; i; ) { 27 | this.addEventListener( types[--i], handler, false ); 28 | } 29 | } else { 30 | this.onmousewheel = handler; 31 | } 32 | }, 33 | 34 | teardown: function() { 35 | if ( this.removeEventListener ) { 36 | for ( var i=types.length; i; ) { 37 | this.removeEventListener( types[--i], handler, false ); 38 | } 39 | } else { 40 | this.onmousewheel = null; 41 | } 42 | } 43 | }; 44 | 45 | $.fn.extend({ 46 | mousewheel: function(fn) { 47 | return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); 48 | }, 49 | 50 | unmousewheel: function(fn) { 51 | return this.unbind("mousewheel", fn); 52 | } 53 | }); 54 | 55 | 56 | function handler(event) { 57 | var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; 58 | event = $.event.fix(orgEvent); 59 | event.type = "mousewheel"; 60 | 61 | // Old school scrollwheel delta 62 | if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; } 63 | if ( orgEvent.detail ) { delta = -orgEvent.detail/3; } 64 | 65 | // New school multidimensional scroll (touchpads) deltas 66 | deltaY = delta; 67 | 68 | // Gecko 69 | if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { 70 | deltaY = 0; 71 | deltaX = -1*delta; 72 | } 73 | 74 | // Webkit 75 | if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } 76 | if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } 77 | 78 | // Add event and delta to the front of the arguments 79 | args.unshift(event, delta, deltaX, deltaY); 80 | 81 | return ($.event.dispatch || $.event.handle).apply(this, args); 82 | } 83 | 84 | })(jQuery); 85 | -------------------------------------------------------------------------------- /static/js/sample.js: -------------------------------------------------------------------------------- 1 | aRCDescript = [ { 2 | srcString : '#layouts .story', 3 | fitting : resizeables.fillModes.NONE, 4 | multiLayout : true 5 | }, { 6 | srcString : '#scaling .story', 7 | fitting : resizeables.fillModes.FIT_PARENT, 8 | }]; 9 | 10 | 11 | /* */ 12 | 13 | var optimizationSlide = { 14 | pause : function() { 15 | $("#optimization .fastLayer").stop(true,false); 16 | }, 17 | resume : function() { 18 | 19 | $("#optimization .fastLayer").animate({ 20 | 'margin-top' : '500px' 21 | }, 400, 'easeInOutCubic').animate({ 22 | 'margin-top' : '0px' 23 | }, 400, 'easeOutCubic', optimizationSlide.resume); 24 | } 25 | } 26 | 27 | function createLayers(){ 28 | 29 | for(var i=0; i<30; i++){ 30 | 31 | var layer = $("
"); 32 | 33 | layer.css({ 34 | left: Math.random()*1750-350, 35 | top: Math.random()*860-200 36 | }); 37 | 38 | var q = Math.random(); 39 | layer.find('>div').attr({ 40 | alt: q*6+1 41 | }); 42 | 43 | var size = q*270+30; 44 | layer.find('>div>div').css({ 45 | width: size, 46 | height: size, 47 | 'border-radius': size, 48 | '-webkit-filter': 'blur('+q*15+'px)', 49 | background: 'rgba(255, 255, 255, .5)' 50 | }); 51 | 52 | $('#more .popularResolution').append(layer); 53 | 54 | var animatedCopy = layer.clone(); 55 | 56 | $('#animated .popularResolution').append(animatedCopy); 57 | 58 | (function(animatedCopy){ 59 | 60 | var paused = true, 61 | progress = 0, 62 | initialPosition = animatedCopy.position(), 63 | speedKoeff = Math.random(), 64 | initialPhase = Math.random()*Math.PI*2, 65 | amplitude = Math.random()*100+100; 66 | 67 | setInterval(function(){ 68 | if(paused) return; 69 | 70 | var angle = progress*speedKoeff+initialPhase; 71 | animatedCopy.css('left',initialPosition.left+Math.sin(angle)*amplitude); 72 | animatedCopy.css('top',initialPosition.top+Math.cos(angle)*amplitude); 73 | 74 | progress+=.1; 75 | 76 | },17); 77 | 78 | animatedCopy.data({ 79 | resume: function(){ 80 | paused = false; 81 | }, 82 | pause: function(){ 83 | paused = true; 84 | } 85 | }); 86 | 87 | })(animatedCopy); 88 | 89 | }; 90 | } 91 | 92 | 93 | $(function(){ 94 | 95 | createLayers(); 96 | optimizationSlide.resume(); 97 | 98 | $('#parallax').on('finishedMove', function(amount) { 99 | 100 | $('#animated .popularResolution .fastLayer').each(function(){ 101 | $(this).data('resume')(); 102 | }); 103 | optimizationSlide.resume(); 104 | }); 105 | $('#parallax').on('startedMove', function() { 106 | 107 | $('#animated .popularResolution .fastLayer').each(function(){ 108 | $(this).data('pause')(); 109 | }); 110 | 111 | optimizationSlide.pause(); 112 | }); 113 | 114 | // the only call to the parallax system you need to make 115 | startAllParaSystems(); 116 | 117 | }); 118 | -------------------------------------------------------------------------------- /static/img/logo/classic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 10 | 14 | 16 | 20 | 24 | 26 | 27 | 28 | 30 | 31 | 35 | 37 | 38 | 39 | 41 | 42 | 43 | 44 | 46 | 48 | 49 | 50 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /static/img/logo/preload.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 10 | 14 | 16 | 20 | 24 | 26 | 27 | 28 | 30 | 31 | 35 | 37 | 38 | 39 | 41 | 42 | 43 | 44 | 46 | 48 | 49 | 50 | 52 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | HD Parallax 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 | .1 28 | 29 |
30 |
31 |
32 |

Hi!

That’s a parallax engine. Navigate by pressing keyboard arrows or rotating mouse wheel →
33 |
34 |
35 | 36 |
37 |
38 | 39 | 40 |
42 |
44 |
46 |
47 |
It moves layers you place in your page with different speed.
48 |
49 |
50 | 51 |
52 | 53 |
54 | 55 |
56 |
How about tons of layers?
57 |
58 |
59 | 60 |
61 |
62 |
63 |
Animated? Why not!
64 |
65 |
66 | 67 |
68 |
69 | 70 |
72 |
73 |

It is highly optimized. Slides not visible at the moment are fully suspended for you automatically.

Want to increase performance even more? Engine lets you stop any animations in slides while you are scrolling.

74 |
75 |
76 |
77 | 78 |
79 |
If you want, everything on your slide will scale to fit the window. 80 | experiment with the size of the window to see the magic 81 |
82 |
83 | 84 |
85 |
86 |
87 |
88 | We provide you Alternative Layouts API for top-notch webpage execution. 89 | resize window so the browser’s orientation will change 90 |
You're viewing album ▭ version of the slide.
91 |
You're viewing portrait ▯ version of the slide.
92 |
93 |
94 |
95 |
96 | 97 | 100 | 101 |
102 | Placed here just to make the preloader busy. 103 | 104 | 105 | 106 | 107 |
108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /static/js/third_party/modernizr.custom.js: -------------------------------------------------------------------------------- 1 | /* Modernizr 2.6.2 (Custom Build) | MIT & BSD 2 | * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes 3 | */ 4 | ;window.Modernizr=function(a,b,c){function B(a){i.cssText=a}function C(a,b){return B(m.join(a+";")+(b||""))}function D(a,b){return typeof a===b}function E(a,b){return!!~(""+a).indexOf(b)}function F(a,b){for(var d in a){var e=a[d];if(!E(e,"-")&&i[e]!==c)return b=="pfx"?e:!0}return!1}function G(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:D(f,"function")?f.bind(d||b):f}return!1}function H(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return D(b,"string")||D(b,"undefined")?F(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),G(e,b,c))}function I(){e.input=function(c){for(var d=0,e=c.length;d',a,""].join(""),l.id=g,(m?l:n).innerHTML+=h,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=f.style.overflow,f.style.overflow="hidden",f.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),f.style.overflow=k),!!i},y=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=D(e[d],"function"),D(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),z={}.hasOwnProperty,A;!D(z,"undefined")&&!D(z.call,"undefined")?A=function(a,b){return z.call(a,b)}:A=function(a,b){return b in a&&D(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=v.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(v.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(v.call(arguments)))};return e}),r.flexbox=function(){return H("flexWrap")},r.flexboxlegacy=function(){return H("boxDirection")},r.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},r.canvastext=function(){return!!e.canvas&&!!D(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){return!!a.WebGLRenderingContext},r.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:x(["@media (",m.join("touch-enabled),("),g,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},r.geolocation=function(){return"geolocation"in navigator},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){return!!a.openDatabase},r.indexedDB=function(){return!!H("indexedDB",a)},r.hashchange=function(){return y("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return!!a.history&&!!history.pushState},r.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},r.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},r.rgba=function(){return B("background-color:rgba(150,255,150,.5)"),E(i.backgroundColor,"rgba")},r.hsla=function(){return B("background-color:hsla(120,40%,100%,.5)"),E(i.backgroundColor,"rgba")||E(i.backgroundColor,"hsla")},r.multiplebgs=function(){return B("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(i.background)},r.backgroundsize=function(){return H("backgroundSize")},r.borderimage=function(){return H("borderImage")},r.borderradius=function(){return H("borderRadius")},r.boxshadow=function(){return H("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){return C("opacity:.55"),/^0.55$/.test(i.opacity)},r.cssanimations=function(){return H("animationName")},r.csscolumns=function(){return H("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return B((a+"-webkit- ".split(" ").join(b+a)+m.join(c+a)).slice(0,-a.length)),E(i.backgroundImage,"gradient")},r.cssreflections=function(){return H("boxReflect")},r.csstransforms=function(){return!!H("transform")},r.csstransforms3d=function(){var a=!!H("perspective");return a&&"webkitPerspective"in f.style&&x("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},r.csstransitions=function(){return H("transition")},r.fontface=function(){var a;return x('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},r.generatedcontent=function(){var a;return x(["#",g,"{font:0/0 a}#",g,':after{content:"',k,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},r.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},r.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},r.localstorage=function(){try{return localStorage.setItem(g,g),localStorage.removeItem(g),!0}catch(a){return!1}},r.sessionstorage=function(){try{return sessionStorage.setItem(g,g),sessionStorage.removeItem(g),!0}catch(a){return!1}},r.webworkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="",(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(l.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(l.call(b.createElementNS(q.svg,"clipPath")))};for(var J in r)A(r,J)&&(w=J.toLowerCase(),e[w]=r[J](),u.push((e[w]?"":"no-")+w));return e.input||I(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)A(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof enableClasses!="undefined"&&enableClasses&&(f.className+=" "+(b?"":"no-")+a),e[a]=b}return e},B(""),h=j=null,e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.hasEvent=y,e.testProp=function(a){return F([a])},e.testAllProps=H,e.testStyles=x,e}(this,this.document); -------------------------------------------------------------------------------- /static/js/third_party/jquery.custom.js: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.9.1 - 2012-11-15 2 | * http://jqueryui.com 3 | * Includes: jquery.ui.effect.js 4 | * Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */ 5 | 6 | ;(jQuery.effects || (function($, undefined) { 7 | 8 | var backCompat = $.uiBackCompat !== false, 9 | // prefix used for storing data on .data() 10 | dataSpace = "ui-effects-"; 11 | 12 | $.effects = { 13 | effect: {} 14 | }; 15 | 16 | /*! 17 | * jQuery Color Animations v2.0.0 18 | * http://jquery.com/ 19 | * 20 | * Copyright 2012 jQuery Foundation and other contributors 21 | * Released under the MIT license. 22 | * http://jquery.org/license 23 | * 24 | * Date: Mon Aug 13 13:41:02 2012 -0500 25 | */ 26 | (function( jQuery, undefined ) { 27 | 28 | var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "), 29 | 30 | // plusequals test for += 100 -= 100 31 | rplusequals = /^([\-+])=\s*(\d+\.?\d*)/, 32 | // a set of RE's that can match strings and generate color tuples. 33 | stringParsers = [{ 34 | re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, 35 | parse: function( execResult ) { 36 | return [ 37 | execResult[ 1 ], 38 | execResult[ 2 ], 39 | execResult[ 3 ], 40 | execResult[ 4 ] 41 | ]; 42 | } 43 | }, { 44 | re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, 45 | parse: function( execResult ) { 46 | return [ 47 | execResult[ 1 ] * 2.55, 48 | execResult[ 2 ] * 2.55, 49 | execResult[ 3 ] * 2.55, 50 | execResult[ 4 ] 51 | ]; 52 | } 53 | }, { 54 | // this regex ignores A-F because it's compared against an already lowercased string 55 | re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, 56 | parse: function( execResult ) { 57 | return [ 58 | parseInt( execResult[ 1 ], 16 ), 59 | parseInt( execResult[ 2 ], 16 ), 60 | parseInt( execResult[ 3 ], 16 ) 61 | ]; 62 | } 63 | }, { 64 | // this regex ignores A-F because it's compared against an already lowercased string 65 | re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, 66 | parse: function( execResult ) { 67 | return [ 68 | parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), 69 | parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), 70 | parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ) 71 | ]; 72 | } 73 | }, { 74 | re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/, 75 | space: "hsla", 76 | parse: function( execResult ) { 77 | return [ 78 | execResult[ 1 ], 79 | execResult[ 2 ] / 100, 80 | execResult[ 3 ] / 100, 81 | execResult[ 4 ] 82 | ]; 83 | } 84 | }], 85 | 86 | // jQuery.Color( ) 87 | color = jQuery.Color = function( color, green, blue, alpha ) { 88 | return new jQuery.Color.fn.parse( color, green, blue, alpha ); 89 | }, 90 | spaces = { 91 | rgba: { 92 | props: { 93 | red: { 94 | idx: 0, 95 | type: "byte" 96 | }, 97 | green: { 98 | idx: 1, 99 | type: "byte" 100 | }, 101 | blue: { 102 | idx: 2, 103 | type: "byte" 104 | } 105 | } 106 | }, 107 | 108 | hsla: { 109 | props: { 110 | hue: { 111 | idx: 0, 112 | type: "degrees" 113 | }, 114 | saturation: { 115 | idx: 1, 116 | type: "percent" 117 | }, 118 | lightness: { 119 | idx: 2, 120 | type: "percent" 121 | } 122 | } 123 | } 124 | }, 125 | propTypes = { 126 | "byte": { 127 | floor: true, 128 | max: 255 129 | }, 130 | "percent": { 131 | max: 1 132 | }, 133 | "degrees": { 134 | mod: 360, 135 | floor: true 136 | } 137 | }, 138 | support = color.support = {}, 139 | 140 | // element for support tests 141 | supportElem = jQuery( "

" )[ 0 ], 142 | 143 | // colors = jQuery.Color.names 144 | colors, 145 | 146 | // local aliases of functions called often 147 | each = jQuery.each; 148 | 149 | // determine rgba support immediately 150 | supportElem.style.cssText = "background-color:rgba(1,1,1,.5)"; 151 | support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1; 152 | 153 | // define cache name and alpha properties 154 | // for rgba and hsla spaces 155 | each( spaces, function( spaceName, space ) { 156 | space.cache = "_" + spaceName; 157 | space.props.alpha = { 158 | idx: 3, 159 | type: "percent", 160 | def: 1 161 | }; 162 | }); 163 | 164 | function clamp( value, prop, allowEmpty ) { 165 | var type = propTypes[ prop.type ] || {}; 166 | 167 | if ( value == null ) { 168 | return (allowEmpty || !prop.def) ? null : prop.def; 169 | } 170 | 171 | // ~~ is an short way of doing floor for positive numbers 172 | value = type.floor ? ~~value : parseFloat( value ); 173 | 174 | // IE will pass in empty strings as value for alpha, 175 | // which will hit this case 176 | if ( isNaN( value ) ) { 177 | return prop.def; 178 | } 179 | 180 | if ( type.mod ) { 181 | // we add mod before modding to make sure that negatives values 182 | // get converted properly: -10 -> 350 183 | return (value + type.mod) % type.mod; 184 | } 185 | 186 | // for now all property types without mod have min and max 187 | return 0 > value ? 0 : type.max < value ? type.max : value; 188 | } 189 | 190 | function stringParse( string ) { 191 | var inst = color(), 192 | rgba = inst._rgba = []; 193 | 194 | string = string.toLowerCase(); 195 | 196 | each( stringParsers, function( i, parser ) { 197 | var parsed, 198 | match = parser.re.exec( string ), 199 | values = match && parser.parse( match ), 200 | spaceName = parser.space || "rgba"; 201 | 202 | if ( values ) { 203 | parsed = inst[ spaceName ]( values ); 204 | 205 | // if this was an rgba parse the assignment might happen twice 206 | // oh well.... 207 | inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ]; 208 | rgba = inst._rgba = parsed._rgba; 209 | 210 | // exit each( stringParsers ) here because we matched 211 | return false; 212 | } 213 | }); 214 | 215 | // Found a stringParser that handled it 216 | if ( rgba.length ) { 217 | 218 | // if this came from a parsed string, force "transparent" when alpha is 0 219 | // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0) 220 | if ( rgba.join() === "0,0,0,0" ) { 221 | jQuery.extend( rgba, colors.transparent ); 222 | } 223 | return inst; 224 | } 225 | 226 | // named colors 227 | return colors[ string ]; 228 | } 229 | 230 | color.fn = jQuery.extend( color.prototype, { 231 | parse: function( red, green, blue, alpha ) { 232 | if ( red === undefined ) { 233 | this._rgba = [ null, null, null, null ]; 234 | return this; 235 | } 236 | if ( red.jquery || red.nodeType ) { 237 | red = jQuery( red ).css( green ); 238 | green = undefined; 239 | } 240 | 241 | var inst = this, 242 | type = jQuery.type( red ), 243 | rgba = this._rgba = []; 244 | 245 | // more than 1 argument specified - assume ( red, green, blue, alpha ) 246 | if ( green !== undefined ) { 247 | red = [ red, green, blue, alpha ]; 248 | type = "array"; 249 | } 250 | 251 | if ( type === "string" ) { 252 | return this.parse( stringParse( red ) || colors._default ); 253 | } 254 | 255 | if ( type === "array" ) { 256 | each( spaces.rgba.props, function( key, prop ) { 257 | rgba[ prop.idx ] = clamp( red[ prop.idx ], prop ); 258 | }); 259 | return this; 260 | } 261 | 262 | if ( type === "object" ) { 263 | if ( red instanceof color ) { 264 | each( spaces, function( spaceName, space ) { 265 | if ( red[ space.cache ] ) { 266 | inst[ space.cache ] = red[ space.cache ].slice(); 267 | } 268 | }); 269 | } else { 270 | each( spaces, function( spaceName, space ) { 271 | var cache = space.cache; 272 | each( space.props, function( key, prop ) { 273 | 274 | // if the cache doesn't exist, and we know how to convert 275 | if ( !inst[ cache ] && space.to ) { 276 | 277 | // if the value was null, we don't need to copy it 278 | // if the key was alpha, we don't need to copy it either 279 | if ( key === "alpha" || red[ key ] == null ) { 280 | return; 281 | } 282 | inst[ cache ] = space.to( inst._rgba ); 283 | } 284 | 285 | // this is the only case where we allow nulls for ALL properties. 286 | // call clamp with alwaysAllowEmpty 287 | inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true ); 288 | }); 289 | 290 | // everything defined but alpha? 291 | if ( inst[ cache ] && $.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) { 292 | // use the default of 1 293 | inst[ cache ][ 3 ] = 1; 294 | if ( space.from ) { 295 | inst._rgba = space.from( inst[ cache ] ); 296 | } 297 | } 298 | }); 299 | } 300 | return this; 301 | } 302 | }, 303 | is: function( compare ) { 304 | var is = color( compare ), 305 | same = true, 306 | inst = this; 307 | 308 | each( spaces, function( _, space ) { 309 | var localCache, 310 | isCache = is[ space.cache ]; 311 | if (isCache) { 312 | localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || []; 313 | each( space.props, function( _, prop ) { 314 | if ( isCache[ prop.idx ] != null ) { 315 | same = ( isCache[ prop.idx ] === localCache[ prop.idx ] ); 316 | return same; 317 | } 318 | }); 319 | } 320 | return same; 321 | }); 322 | return same; 323 | }, 324 | _space: function() { 325 | var used = [], 326 | inst = this; 327 | each( spaces, function( spaceName, space ) { 328 | if ( inst[ space.cache ] ) { 329 | used.push( spaceName ); 330 | } 331 | }); 332 | return used.pop(); 333 | }, 334 | transition: function( other, distance ) { 335 | var end = color( other ), 336 | spaceName = end._space(), 337 | space = spaces[ spaceName ], 338 | startColor = this.alpha() === 0 ? color( "transparent" ) : this, 339 | start = startColor[ space.cache ] || space.to( startColor._rgba ), 340 | result = start.slice(); 341 | 342 | end = end[ space.cache ]; 343 | each( space.props, function( key, prop ) { 344 | var index = prop.idx, 345 | startValue = start[ index ], 346 | endValue = end[ index ], 347 | type = propTypes[ prop.type ] || {}; 348 | 349 | // if null, don't override start value 350 | if ( endValue === null ) { 351 | return; 352 | } 353 | // if null - use end 354 | if ( startValue === null ) { 355 | result[ index ] = endValue; 356 | } else { 357 | if ( type.mod ) { 358 | if ( endValue - startValue > type.mod / 2 ) { 359 | startValue += type.mod; 360 | } else if ( startValue - endValue > type.mod / 2 ) { 361 | startValue -= type.mod; 362 | } 363 | } 364 | result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop ); 365 | } 366 | }); 367 | return this[ spaceName ]( result ); 368 | }, 369 | blend: function( opaque ) { 370 | // if we are already opaque - return ourself 371 | if ( this._rgba[ 3 ] === 1 ) { 372 | return this; 373 | } 374 | 375 | var rgb = this._rgba.slice(), 376 | a = rgb.pop(), 377 | blend = color( opaque )._rgba; 378 | 379 | return color( jQuery.map( rgb, function( v, i ) { 380 | return ( 1 - a ) * blend[ i ] + a * v; 381 | })); 382 | }, 383 | toRgbaString: function() { 384 | var prefix = "rgba(", 385 | rgba = jQuery.map( this._rgba, function( v, i ) { 386 | return v == null ? ( i > 2 ? 1 : 0 ) : v; 387 | }); 388 | 389 | if ( rgba[ 3 ] === 1 ) { 390 | rgba.pop(); 391 | prefix = "rgb("; 392 | } 393 | 394 | return prefix + rgba.join() + ")"; 395 | }, 396 | toHslaString: function() { 397 | var prefix = "hsla(", 398 | hsla = jQuery.map( this.hsla(), function( v, i ) { 399 | if ( v == null ) { 400 | v = i > 2 ? 1 : 0; 401 | } 402 | 403 | // catch 1 and 2 404 | if ( i && i < 3 ) { 405 | v = Math.round( v * 100 ) + "%"; 406 | } 407 | return v; 408 | }); 409 | 410 | if ( hsla[ 3 ] === 1 ) { 411 | hsla.pop(); 412 | prefix = "hsl("; 413 | } 414 | return prefix + hsla.join() + ")"; 415 | }, 416 | toHexString: function( includeAlpha ) { 417 | var rgba = this._rgba.slice(), 418 | alpha = rgba.pop(); 419 | 420 | if ( includeAlpha ) { 421 | rgba.push( ~~( alpha * 255 ) ); 422 | } 423 | 424 | return "#" + jQuery.map( rgba, function( v ) { 425 | 426 | // default to 0 when nulls exist 427 | v = ( v || 0 ).toString( 16 ); 428 | return v.length === 1 ? "0" + v : v; 429 | }).join(""); 430 | }, 431 | toString: function() { 432 | return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString(); 433 | } 434 | }); 435 | color.fn.parse.prototype = color.fn; 436 | 437 | // hsla conversions adapted from: 438 | // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021 439 | 440 | function hue2rgb( p, q, h ) { 441 | h = ( h + 1 ) % 1; 442 | if ( h * 6 < 1 ) { 443 | return p + (q - p) * h * 6; 444 | } 445 | if ( h * 2 < 1) { 446 | return q; 447 | } 448 | if ( h * 3 < 2 ) { 449 | return p + (q - p) * ((2/3) - h) * 6; 450 | } 451 | return p; 452 | } 453 | 454 | spaces.hsla.to = function ( rgba ) { 455 | if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) { 456 | return [ null, null, null, rgba[ 3 ] ]; 457 | } 458 | var r = rgba[ 0 ] / 255, 459 | g = rgba[ 1 ] / 255, 460 | b = rgba[ 2 ] / 255, 461 | a = rgba[ 3 ], 462 | max = Math.max( r, g, b ), 463 | min = Math.min( r, g, b ), 464 | diff = max - min, 465 | add = max + min, 466 | l = add * 0.5, 467 | h, s; 468 | 469 | if ( min === max ) { 470 | h = 0; 471 | } else if ( r === max ) { 472 | h = ( 60 * ( g - b ) / diff ) + 360; 473 | } else if ( g === max ) { 474 | h = ( 60 * ( b - r ) / diff ) + 120; 475 | } else { 476 | h = ( 60 * ( r - g ) / diff ) + 240; 477 | } 478 | 479 | if ( l === 0 || l === 1 ) { 480 | s = l; 481 | } else if ( l <= 0.5 ) { 482 | s = diff / add; 483 | } else { 484 | s = diff / ( 2 - add ); 485 | } 486 | return [ Math.round(h) % 360, s, l, a == null ? 1 : a ]; 487 | }; 488 | 489 | spaces.hsla.from = function ( hsla ) { 490 | if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) { 491 | return [ null, null, null, hsla[ 3 ] ]; 492 | } 493 | var h = hsla[ 0 ] / 360, 494 | s = hsla[ 1 ], 495 | l = hsla[ 2 ], 496 | a = hsla[ 3 ], 497 | q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s, 498 | p = 2 * l - q; 499 | 500 | return [ 501 | Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ), 502 | Math.round( hue2rgb( p, q, h ) * 255 ), 503 | Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ), 504 | a 505 | ]; 506 | }; 507 | 508 | 509 | each( spaces, function( spaceName, space ) { 510 | var props = space.props, 511 | cache = space.cache, 512 | to = space.to, 513 | from = space.from; 514 | 515 | // makes rgba() and hsla() 516 | color.fn[ spaceName ] = function( value ) { 517 | 518 | // generate a cache for this space if it doesn't exist 519 | if ( to && !this[ cache ] ) { 520 | this[ cache ] = to( this._rgba ); 521 | } 522 | if ( value === undefined ) { 523 | return this[ cache ].slice(); 524 | } 525 | 526 | var ret, 527 | type = jQuery.type( value ), 528 | arr = ( type === "array" || type === "object" ) ? value : arguments, 529 | local = this[ cache ].slice(); 530 | 531 | each( props, function( key, prop ) { 532 | var val = arr[ type === "object" ? key : prop.idx ]; 533 | if ( val == null ) { 534 | val = local[ prop.idx ]; 535 | } 536 | local[ prop.idx ] = clamp( val, prop ); 537 | }); 538 | 539 | if ( from ) { 540 | ret = color( from( local ) ); 541 | ret[ cache ] = local; 542 | return ret; 543 | } else { 544 | return color( local ); 545 | } 546 | }; 547 | 548 | // makes red() green() blue() alpha() hue() saturation() lightness() 549 | each( props, function( key, prop ) { 550 | // alpha is included in more than one space 551 | if ( color.fn[ key ] ) { 552 | return; 553 | } 554 | color.fn[ key ] = function( value ) { 555 | var vtype = jQuery.type( value ), 556 | fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ), 557 | local = this[ fn ](), 558 | cur = local[ prop.idx ], 559 | match; 560 | 561 | if ( vtype === "undefined" ) { 562 | return cur; 563 | } 564 | 565 | if ( vtype === "function" ) { 566 | value = value.call( this, cur ); 567 | vtype = jQuery.type( value ); 568 | } 569 | if ( value == null && prop.empty ) { 570 | return this; 571 | } 572 | if ( vtype === "string" ) { 573 | match = rplusequals.exec( value ); 574 | if ( match ) { 575 | value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 ); 576 | } 577 | } 578 | local[ prop.idx ] = value; 579 | return this[ fn ]( local ); 580 | }; 581 | }); 582 | }); 583 | 584 | // add .fx.step functions 585 | each( stepHooks, function( i, hook ) { 586 | jQuery.cssHooks[ hook ] = { 587 | set: function( elem, value ) { 588 | var parsed, curElem, 589 | backgroundColor = ""; 590 | 591 | if ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) { 592 | value = color( parsed || value ); 593 | if ( !support.rgba && value._rgba[ 3 ] !== 1 ) { 594 | curElem = hook === "backgroundColor" ? elem.parentNode : elem; 595 | while ( 596 | (backgroundColor === "" || backgroundColor === "transparent") && 597 | curElem && curElem.style 598 | ) { 599 | try { 600 | backgroundColor = jQuery.css( curElem, "backgroundColor" ); 601 | curElem = curElem.parentNode; 602 | } catch ( e ) { 603 | } 604 | } 605 | 606 | value = value.blend( backgroundColor && backgroundColor !== "transparent" ? 607 | backgroundColor : 608 | "_default" ); 609 | } 610 | 611 | value = value.toRgbaString(); 612 | } 613 | try { 614 | elem.style[ hook ] = value; 615 | } catch( error ) { 616 | // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit' 617 | } 618 | } 619 | }; 620 | jQuery.fx.step[ hook ] = function( fx ) { 621 | if ( !fx.colorInit ) { 622 | fx.start = color( fx.elem, hook ); 623 | fx.end = color( fx.end ); 624 | fx.colorInit = true; 625 | } 626 | jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) ); 627 | }; 628 | }); 629 | 630 | jQuery.cssHooks.borderColor = { 631 | expand: function( value ) { 632 | var expanded = {}; 633 | 634 | each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) { 635 | expanded[ "border" + part + "Color" ] = value; 636 | }); 637 | return expanded; 638 | } 639 | }; 640 | 641 | // Basic color names only. 642 | // Usage of any of the other color names requires adding yourself or including 643 | // jquery.color.svg-names.js. 644 | colors = jQuery.Color.names = { 645 | // 4.1. Basic color keywords 646 | aqua: "#00ffff", 647 | black: "#000000", 648 | blue: "#0000ff", 649 | fuchsia: "#ff00ff", 650 | gray: "#808080", 651 | green: "#008000", 652 | lime: "#00ff00", 653 | maroon: "#800000", 654 | navy: "#000080", 655 | olive: "#808000", 656 | purple: "#800080", 657 | red: "#ff0000", 658 | silver: "#c0c0c0", 659 | teal: "#008080", 660 | white: "#ffffff", 661 | yellow: "#ffff00", 662 | 663 | // 4.2.3. "transparent" color keyword 664 | transparent: [ null, null, null, 0 ], 665 | 666 | _default: "#ffffff" 667 | }; 668 | 669 | })( jQuery ); 670 | 671 | 672 | 673 | /******************************************************************************/ 674 | /****************************** CLASS ANIMATIONS ******************************/ 675 | /******************************************************************************/ 676 | (function() { 677 | 678 | var classAnimationActions = [ "add", "remove", "toggle" ], 679 | shorthandStyles = { 680 | border: 1, 681 | borderBottom: 1, 682 | borderColor: 1, 683 | borderLeft: 1, 684 | borderRight: 1, 685 | borderTop: 1, 686 | borderWidth: 1, 687 | margin: 1, 688 | padding: 1 689 | }; 690 | 691 | $.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) { 692 | $.fx.step[ prop ] = function( fx ) { 693 | if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) { 694 | jQuery.style( fx.elem, prop, fx.end ); 695 | fx.setAttr = true; 696 | } 697 | }; 698 | }); 699 | 700 | function getElementStyles() { 701 | var style = this.ownerDocument.defaultView ? 702 | this.ownerDocument.defaultView.getComputedStyle( this, null ) : 703 | this.currentStyle, 704 | newStyle = {}, 705 | key, 706 | len; 707 | 708 | // webkit enumerates style porperties 709 | if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) { 710 | len = style.length; 711 | while ( len-- ) { 712 | key = style[ len ]; 713 | if ( typeof style[ key ] === "string" ) { 714 | newStyle[ $.camelCase( key ) ] = style[ key ]; 715 | } 716 | } 717 | } else { 718 | for ( key in style ) { 719 | if ( typeof style[ key ] === "string" ) { 720 | newStyle[ key ] = style[ key ]; 721 | } 722 | } 723 | } 724 | 725 | return newStyle; 726 | } 727 | 728 | 729 | function styleDifference( oldStyle, newStyle ) { 730 | var diff = {}, 731 | name, value; 732 | 733 | for ( name in newStyle ) { 734 | value = newStyle[ name ]; 735 | if ( oldStyle[ name ] !== value ) { 736 | if ( !shorthandStyles[ name ] ) { 737 | if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) { 738 | diff[ name ] = value; 739 | } 740 | } 741 | } 742 | } 743 | 744 | return diff; 745 | } 746 | 747 | $.effects.animateClass = function( value, duration, easing, callback ) { 748 | var o = $.speed( duration, easing, callback ); 749 | 750 | return this.queue( function() { 751 | var animated = $( this ), 752 | baseClass = animated.attr( "class" ) || "", 753 | applyClassChange, 754 | allAnimations = o.children ? animated.find( "*" ).andSelf() : animated; 755 | 756 | // map the animated objects to store the original styles. 757 | allAnimations = allAnimations.map(function() { 758 | var el = $( this ); 759 | return { 760 | el: el, 761 | start: getElementStyles.call( this ) 762 | }; 763 | }); 764 | 765 | // apply class change 766 | applyClassChange = function() { 767 | $.each( classAnimationActions, function(i, action) { 768 | if ( value[ action ] ) { 769 | animated[ action + "Class" ]( value[ action ] ); 770 | } 771 | }); 772 | }; 773 | applyClassChange(); 774 | 775 | // map all animated objects again - calculate new styles and diff 776 | allAnimations = allAnimations.map(function() { 777 | this.end = getElementStyles.call( this.el[ 0 ] ); 778 | this.diff = styleDifference( this.start, this.end ); 779 | return this; 780 | }); 781 | 782 | // apply original class 783 | animated.attr( "class", baseClass ); 784 | 785 | // map all animated objects again - this time collecting a promise 786 | allAnimations = allAnimations.map(function() { 787 | var styleInfo = this, 788 | dfd = $.Deferred(), 789 | opts = jQuery.extend({}, o, { 790 | queue: false, 791 | complete: function() { 792 | dfd.resolve( styleInfo ); 793 | } 794 | }); 795 | 796 | this.el.animate( this.diff, opts ); 797 | return dfd.promise(); 798 | }); 799 | 800 | // once all animations have completed: 801 | $.when.apply( $, allAnimations.get() ).done(function() { 802 | 803 | // set the final class 804 | applyClassChange(); 805 | 806 | // for each animated element, 807 | // clear all css properties that were animated 808 | $.each( arguments, function() { 809 | var el = this.el; 810 | $.each( this.diff, function(key) { 811 | el.css( key, '' ); 812 | }); 813 | }); 814 | 815 | // this is guarnteed to be there if you use jQuery.speed() 816 | // it also handles dequeuing the next anim... 817 | o.complete.call( animated[ 0 ] ); 818 | }); 819 | }); 820 | }; 821 | 822 | $.fn.extend({ 823 | _addClass: $.fn.addClass, 824 | addClass: function( classNames, speed, easing, callback ) { 825 | return speed ? 826 | $.effects.animateClass.call( this, 827 | { add: classNames }, speed, easing, callback ) : 828 | this._addClass( classNames ); 829 | }, 830 | 831 | _removeClass: $.fn.removeClass, 832 | removeClass: function( classNames, speed, easing, callback ) { 833 | return speed ? 834 | $.effects.animateClass.call( this, 835 | { remove: classNames }, speed, easing, callback ) : 836 | this._removeClass( classNames ); 837 | }, 838 | 839 | _toggleClass: $.fn.toggleClass, 840 | toggleClass: function( classNames, force, speed, easing, callback ) { 841 | if ( typeof force === "boolean" || force === undefined ) { 842 | if ( !speed ) { 843 | // without speed parameter 844 | return this._toggleClass( classNames, force ); 845 | } else { 846 | return $.effects.animateClass.call( this, 847 | (force ? { add: classNames } : { remove: classNames }), 848 | speed, easing, callback ); 849 | } 850 | } else { 851 | // without force parameter 852 | return $.effects.animateClass.call( this, 853 | { toggle: classNames }, force, speed, easing ); 854 | } 855 | }, 856 | 857 | switchClass: function( remove, add, speed, easing, callback) { 858 | return $.effects.animateClass.call( this, { 859 | add: add, 860 | remove: remove 861 | }, speed, easing, callback ); 862 | } 863 | }); 864 | 865 | })(); 866 | 867 | /******************************************************************************/ 868 | /*********************************** EFFECTS **********************************/ 869 | /******************************************************************************/ 870 | 871 | (function() { 872 | 873 | $.extend( $.effects, { 874 | version: "1.9.1", 875 | 876 | // Saves a set of properties in a data storage 877 | save: function( element, set ) { 878 | for( var i=0; i < set.length; i++ ) { 879 | if ( set[ i ] !== null ) { 880 | element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] ); 881 | } 882 | } 883 | }, 884 | 885 | // Restores a set of previously saved properties from a data storage 886 | restore: function( element, set ) { 887 | var val, i; 888 | for( i=0; i < set.length; i++ ) { 889 | if ( set[ i ] !== null ) { 890 | val = element.data( dataSpace + set[ i ] ); 891 | // support: jQuery 1.6.2 892 | // http://bugs.jquery.com/ticket/9917 893 | // jQuery 1.6.2 incorrectly returns undefined for any falsy value. 894 | // We can't differentiate between "" and 0 here, so we just assume 895 | // empty string since it's likely to be a more common value... 896 | if ( val === undefined ) { 897 | val = ""; 898 | } 899 | element.css( set[ i ], val ); 900 | } 901 | } 902 | }, 903 | 904 | setMode: function( el, mode ) { 905 | if (mode === "toggle") { 906 | mode = el.is( ":hidden" ) ? "show" : "hide"; 907 | } 908 | return mode; 909 | }, 910 | 911 | // Translates a [top,left] array into a baseline value 912 | // this should be a little more flexible in the future to handle a string & hash 913 | getBaseline: function( origin, original ) { 914 | var y, x; 915 | switch ( origin[ 0 ] ) { 916 | case "top": y = 0; break; 917 | case "middle": y = 0.5; break; 918 | case "bottom": y = 1; break; 919 | default: y = origin[ 0 ] / original.height; 920 | } 921 | switch ( origin[ 1 ] ) { 922 | case "left": x = 0; break; 923 | case "center": x = 0.5; break; 924 | case "right": x = 1; break; 925 | default: x = origin[ 1 ] / original.width; 926 | } 927 | return { 928 | x: x, 929 | y: y 930 | }; 931 | }, 932 | 933 | // Wraps the element around a wrapper that copies position properties 934 | createWrapper: function( element ) { 935 | 936 | // if the element is already wrapped, return it 937 | if ( element.parent().is( ".ui-effects-wrapper" )) { 938 | return element.parent(); 939 | } 940 | 941 | // wrap the element 942 | var props = { 943 | width: element.outerWidth(true), 944 | height: element.outerHeight(true), 945 | "float": element.css( "float" ) 946 | }, 947 | wrapper = $( "

" ) 948 | .addClass( "ui-effects-wrapper" ) 949 | .css({ 950 | fontSize: "100%", 951 | background: "transparent", 952 | border: "none", 953 | margin: 0, 954 | padding: 0 955 | }), 956 | // Store the size in case width/height are defined in % - Fixes #5245 957 | size = { 958 | width: element.width(), 959 | height: element.height() 960 | }, 961 | active = document.activeElement; 962 | 963 | // support: Firefox 964 | // Firefox incorrectly exposes anonymous content 965 | // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 966 | try { 967 | active.id; 968 | } catch( e ) { 969 | active = document.body; 970 | } 971 | 972 | element.wrap( wrapper ); 973 | 974 | // Fixes #7595 - Elements lose focus when wrapped. 975 | if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { 976 | $( active ).focus(); 977 | } 978 | 979 | wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element 980 | 981 | // transfer positioning properties to the wrapper 982 | if ( element.css( "position" ) === "static" ) { 983 | wrapper.css({ position: "relative" }); 984 | element.css({ position: "relative" }); 985 | } else { 986 | $.extend( props, { 987 | position: element.css( "position" ), 988 | zIndex: element.css( "z-index" ) 989 | }); 990 | $.each([ "top", "left", "bottom", "right" ], function(i, pos) { 991 | props[ pos ] = element.css( pos ); 992 | if ( isNaN( parseInt( props[ pos ], 10 ) ) ) { 993 | props[ pos ] = "auto"; 994 | } 995 | }); 996 | element.css({ 997 | position: "relative", 998 | top: 0, 999 | left: 0, 1000 | right: "auto", 1001 | bottom: "auto" 1002 | }); 1003 | } 1004 | element.css(size); 1005 | 1006 | return wrapper.css( props ).show(); 1007 | }, 1008 | 1009 | removeWrapper: function( element ) { 1010 | var active = document.activeElement; 1011 | 1012 | if ( element.parent().is( ".ui-effects-wrapper" ) ) { 1013 | element.parent().replaceWith( element ); 1014 | 1015 | // Fixes #7595 - Elements lose focus when wrapped. 1016 | if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { 1017 | $( active ).focus(); 1018 | } 1019 | } 1020 | 1021 | 1022 | return element; 1023 | }, 1024 | 1025 | setTransition: function( element, list, factor, value ) { 1026 | value = value || {}; 1027 | $.each( list, function( i, x ) { 1028 | var unit = element.cssUnit( x ); 1029 | if ( unit[ 0 ] > 0 ) { 1030 | value[ x ] = unit[ 0 ] * factor + unit[ 1 ]; 1031 | } 1032 | }); 1033 | return value; 1034 | } 1035 | }); 1036 | 1037 | // return an effect options object for the given parameters: 1038 | function _normalizeArguments( effect, options, speed, callback ) { 1039 | 1040 | // allow passing all options as the first parameter 1041 | if ( $.isPlainObject( effect ) ) { 1042 | options = effect; 1043 | effect = effect.effect; 1044 | } 1045 | 1046 | // convert to an object 1047 | effect = { effect: effect }; 1048 | 1049 | // catch (effect, null, ...) 1050 | if ( options == null ) { 1051 | options = {}; 1052 | } 1053 | 1054 | // catch (effect, callback) 1055 | if ( $.isFunction( options ) ) { 1056 | callback = options; 1057 | speed = null; 1058 | options = {}; 1059 | } 1060 | 1061 | // catch (effect, speed, ?) 1062 | if ( typeof options === "number" || $.fx.speeds[ options ] ) { 1063 | callback = speed; 1064 | speed = options; 1065 | options = {}; 1066 | } 1067 | 1068 | // catch (effect, options, callback) 1069 | if ( $.isFunction( speed ) ) { 1070 | callback = speed; 1071 | speed = null; 1072 | } 1073 | 1074 | // add options to effect 1075 | if ( options ) { 1076 | $.extend( effect, options ); 1077 | } 1078 | 1079 | speed = speed || options.duration; 1080 | effect.duration = $.fx.off ? 0 : 1081 | typeof speed === "number" ? speed : 1082 | speed in $.fx.speeds ? $.fx.speeds[ speed ] : 1083 | $.fx.speeds._default; 1084 | 1085 | effect.complete = callback || options.complete; 1086 | 1087 | return effect; 1088 | } 1089 | 1090 | function standardSpeed( speed ) { 1091 | // valid standard speeds 1092 | if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) { 1093 | return true; 1094 | } 1095 | 1096 | // invalid strings - treat as "normal" speed 1097 | if ( typeof speed === "string" && !$.effects.effect[ speed ] ) { 1098 | // TODO: remove in 2.0 (#7115) 1099 | if ( backCompat && $.effects[ speed ] ) { 1100 | return false; 1101 | } 1102 | return true; 1103 | } 1104 | 1105 | return false; 1106 | } 1107 | 1108 | $.fn.extend({ 1109 | effect: function( /* effect, options, speed, callback */ ) { 1110 | var args = _normalizeArguments.apply( this, arguments ), 1111 | mode = args.mode, 1112 | queue = args.queue, 1113 | effectMethod = $.effects.effect[ args.effect ], 1114 | 1115 | // DEPRECATED: remove in 2.0 (#7115) 1116 | oldEffectMethod = !effectMethod && backCompat && $.effects[ args.effect ]; 1117 | 1118 | if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) { 1119 | // delegate to the original method (e.g., .show()) if possible 1120 | if ( mode ) { 1121 | return this[ mode ]( args.duration, args.complete ); 1122 | } else { 1123 | return this.each( function() { 1124 | if ( args.complete ) { 1125 | args.complete.call( this ); 1126 | } 1127 | }); 1128 | } 1129 | } 1130 | 1131 | function run( next ) { 1132 | var elem = $( this ), 1133 | complete = args.complete, 1134 | mode = args.mode; 1135 | 1136 | function done() { 1137 | if ( $.isFunction( complete ) ) { 1138 | complete.call( elem[0] ); 1139 | } 1140 | if ( $.isFunction( next ) ) { 1141 | next(); 1142 | } 1143 | } 1144 | 1145 | // if the element is hiddden and mode is hide, 1146 | // or element is visible and mode is show 1147 | if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) { 1148 | done(); 1149 | } else { 1150 | effectMethod.call( elem[0], args, done ); 1151 | } 1152 | } 1153 | 1154 | // TODO: remove this check in 2.0, effectMethod will always be true 1155 | if ( effectMethod ) { 1156 | return queue === false ? this.each( run ) : this.queue( queue || "fx", run ); 1157 | } else { 1158 | // DEPRECATED: remove in 2.0 (#7115) 1159 | return oldEffectMethod.call(this, { 1160 | options: args, 1161 | duration: args.duration, 1162 | callback: args.complete, 1163 | mode: args.mode 1164 | }); 1165 | } 1166 | }, 1167 | 1168 | _show: $.fn.show, 1169 | show: function( speed ) { 1170 | if ( standardSpeed( speed ) ) { 1171 | return this._show.apply( this, arguments ); 1172 | } else { 1173 | var args = _normalizeArguments.apply( this, arguments ); 1174 | args.mode = "show"; 1175 | return this.effect.call( this, args ); 1176 | } 1177 | }, 1178 | 1179 | _hide: $.fn.hide, 1180 | hide: function( speed ) { 1181 | if ( standardSpeed( speed ) ) { 1182 | return this._hide.apply( this, arguments ); 1183 | } else { 1184 | var args = _normalizeArguments.apply( this, arguments ); 1185 | args.mode = "hide"; 1186 | return this.effect.call( this, args ); 1187 | } 1188 | }, 1189 | 1190 | // jQuery core overloads toggle and creates _toggle 1191 | __toggle: $.fn.toggle, 1192 | toggle: function( speed ) { 1193 | if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) { 1194 | return this.__toggle.apply( this, arguments ); 1195 | } else { 1196 | var args = _normalizeArguments.apply( this, arguments ); 1197 | args.mode = "toggle"; 1198 | return this.effect.call( this, args ); 1199 | } 1200 | }, 1201 | 1202 | // helper functions 1203 | cssUnit: function(key) { 1204 | var style = this.css( key ), 1205 | val = []; 1206 | 1207 | $.each( [ "em", "px", "%", "pt" ], function( i, unit ) { 1208 | if ( style.indexOf( unit ) > 0 ) { 1209 | val = [ parseFloat( style ), unit ]; 1210 | } 1211 | }); 1212 | return val; 1213 | } 1214 | }); 1215 | 1216 | })(); 1217 | 1218 | /******************************************************************************/ 1219 | /*********************************** EASING ***********************************/ 1220 | /******************************************************************************/ 1221 | 1222 | (function() { 1223 | 1224 | // based on easing equations from Robert Penner (http://www.robertpenner.com/easing) 1225 | 1226 | var baseEasings = {}; 1227 | 1228 | $.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) { 1229 | baseEasings[ name ] = function( p ) { 1230 | return Math.pow( p, i + 2 ); 1231 | }; 1232 | }); 1233 | 1234 | $.extend( baseEasings, { 1235 | Sine: function ( p ) { 1236 | return 1 - Math.cos( p * Math.PI / 2 ); 1237 | }, 1238 | Circ: function ( p ) { 1239 | return 1 - Math.sqrt( 1 - p * p ); 1240 | }, 1241 | Elastic: function( p ) { 1242 | return p === 0 || p === 1 ? p : 1243 | -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 ); 1244 | }, 1245 | Back: function( p ) { 1246 | return p * p * ( 3 * p - 2 ); 1247 | }, 1248 | Bounce: function ( p ) { 1249 | var pow2, 1250 | bounce = 4; 1251 | 1252 | while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {} 1253 | return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 ); 1254 | } 1255 | }); 1256 | 1257 | $.each( baseEasings, function( name, easeIn ) { 1258 | $.easing[ "easeIn" + name ] = easeIn; 1259 | $.easing[ "easeOut" + name ] = function( p ) { 1260 | return 1 - easeIn( 1 - p ); 1261 | }; 1262 | $.easing[ "easeInOut" + name ] = function( p ) { 1263 | return p < 0.5 ? 1264 | easeIn( p * 2 ) / 2 : 1265 | 1 - easeIn( p * -2 + 2 ) / 2; 1266 | }; 1267 | }); 1268 | 1269 | })(); 1270 | 1271 | })(jQuery)); 1272 | -------------------------------------------------------------------------------- /static/js/parallax.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Зависит от jquery, jquery.mousewheel и jquery.custom. 3 | * 4 | * Важное ограничение: пока что слои со скоростями меньше единицы 5 | * (передвигающиеся медленее, чем зритель) 6 | * работают только будучи размещены прямо внутри слайда, 7 | * а не в глубине верстки. 8 | * 9 | * Copyright (c) 2013 Hot Dot Licensed MIT 10 | * http://hotdot.pro/ 11 | * */ 12 | 13 | var paraSample = {}, utilLib = {}, 14 | 15 | windowWidth, 16 | windowHeight, 17 | windowAspect, 18 | baseFontSize, 19 | para, 20 | wheelstep, 21 | aRCDescript, 22 | /* 23 | * Хранит картинки, которые хоть и не видны, 24 | * но будут загружены при загрузке страницы 25 | */ 26 | hiddenImagesContainer, 27 | 28 | 29 | iPadMode = navigator.userAgent.match(/iP/i), 30 | supportsTouchEvents = 31 | ('ontouchstart' in document.documentElement) || ( /Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone|ZuneWP7/i.test(navigator.userAgent) ); 32 | 33 | /* */ 34 | 35 | (function(nmspc) { 36 | 37 | var alertFallback = false; 38 | if ( typeof console === "undefined" || typeof console.log === "undefined") { 39 | alert('oh no'); 40 | console = {}; 41 | if (alertFallback) { 42 | console.log = function(msg) { 43 | alert(msg); 44 | }; 45 | } else { 46 | console.log = function() { 47 | }; 48 | } 49 | } 50 | 51 | /* */ 52 | 53 | nmspc.DEVICE_TYPES = { 54 | iPad : 'iPad', 55 | iPhone: 'iPhone', 56 | android : 'android', 57 | desktop : 'desktop', 58 | wPhone : 'wPhone' 59 | } 60 | 61 | nmspc.BROWSERS = { 62 | safari: 'Safari', 63 | chrome: 'Chrome' 64 | } 65 | 66 | nmspc.OS_TYPES = { 67 | mac: 'Mac OS', 68 | win: 'Windows' 69 | } 70 | 71 | nmspc.deviceDescription = { 72 | type : undefined, 73 | browser : undefined, 74 | touchCapable : false 75 | } 76 | 77 | nmspc.deviceDescription.type = nmspc.DEVICE_TYPES.desktop; 78 | 79 | if (navigator.userAgent.indexOf('iPad') > -1) { 80 | nmspc.deviceDescription.type = nmspc.DEVICE_TYPES.iPad; 81 | } else if (navigator.userAgent.indexOf('iPhone') > -1) { 82 | nmspc.deviceDescription.type = nmspc.DEVICE_TYPES.iPhone; 83 | } else if (navigator.userAgent.indexOf('Android') > -1) { 84 | nmspc.deviceDescription.type = nmspc.DEVICE_TYPES.android; 85 | } else if (navigator.userAgent.indexOf('Windows Phone') > -1) { 86 | nmspc.deviceDescription.type = nmspc.DEVICE_TYPES.wPhone; 87 | } 88 | 89 | if (navigator.userAgent.indexOf('Chrome') > -1 ){ 90 | nmspc.deviceDescription.browser = nmspc.BROWSERS.chrome; 91 | } else if (navigator.userAgent.indexOf('Safari') > -1) { 92 | nmspc.deviceDescription.browser = nmspc.BROWSERS.safari; 93 | } 94 | 95 | nmspc.deviceDescription.os = undefined; 96 | 97 | if (navigator.userAgent.indexOf('Mac OS') > -1 ){ 98 | nmspc.deviceDescription.os = nmspc.OS_TYPES.mac; 99 | } else if (navigator.userAgent.indexOf('Windows') > -1 ){ 100 | nmspc.deviceDescription.os = nmspc.OS_TYPES.win; 101 | } 102 | 103 | if (( typeof Touch == "object") || ('ontouchstart' in document.documentElement)) { 104 | nmspc.deviceDescription.touchCapable = true; 105 | } 106 | 107 | /* */ 108 | 109 | nmspc.debu = window.location.href.indexOf('?debug') > -1; 110 | var $debWindow; 111 | 112 | nmspc.debLog = function(str) { 113 | if (!$debWindow) 114 | return; 115 | $debWindow.prepend($('

' + str + '

')); 116 | } 117 | 118 | $(function() { 119 | 120 | if (nmspc.debu) { 121 | 122 | $debWindow = $('
').css({ 123 | position : 'fixed', 124 | top : 0, 125 | right : 0, 126 | display : 'inline-block', 127 | width : 300, 128 | 'min-height' : 100, 129 | font : '12px sans-serif', 130 | color : 'rgba(255,255,255,.8)', 131 | 'background-color' : 'rgba(0,0,0,.5)', 132 | 'z-index' : 999, 133 | 'max-height' : '50%', 134 | 'overflow-y' : 'scroll' 135 | }); 136 | $('body').append($debWindow); 137 | 138 | } 139 | 140 | nmspc.debLog(nmspc.deviceDescription.type); 141 | nmspc.debLog('Standard-touch-capable: ' + nmspc.deviceDescription.touchCapable); 142 | 143 | }) 144 | 145 | })(utilLib); 146 | 147 | 148 | (function(arg){ 149 | 150 | if(!window.Modernizr) return; 151 | 152 | if(window.Modernizr.csstransforms3d){ 153 | paraSample.bestTranslateType = 'translate3d'; 154 | } else if(window.Modernizr.csstransforms){ 155 | paraSample.bestTranslateType = 'translate'; 156 | } else { 157 | paraSample.bestTranslateType = 'left'; 158 | } 159 | 160 | // translate3d, left, translate 161 | 162 | var translateType, 163 | transformString; 164 | 165 | arg.applyHorizontalShift = function(value, $div, translateType){ 166 | 167 | 168 | translateType = translateType || paraSample.bestTranslateType; 169 | 170 | if (value=='' || translateType != 'left') { 171 | 172 | if (value==''){ 173 | transformString = ''; 174 | } else if (translateType === 'translate3d') { 175 | transformString = 'translate3d(' + value + 'px, 0px, 0px)'; 176 | } else if (translateType === 'translate') { 177 | transformString = 'translate(' + value + 'px, 0px)'; 178 | } else if (translateType === 'translateX') { 179 | transformString = 'translateX(' + value + 'px)'; 180 | } else 181 | return; 182 | 183 | $div.css({ 184 | 185 | WebkitTransform : transformString, 186 | MozTransform : transformString, 187 | Transform : transformString, 188 | msTransform : transformString, 189 | OTransform : transformString, 190 | transform : transformString 191 | 192 | }); 193 | 194 | } 195 | 196 | if (value=='' || translateType == 'left') { 197 | 198 | $div.css('left', value); 199 | 200 | } 201 | 202 | } 203 | 204 | })(paraSample); 205 | 206 | 207 | /* */ 208 | 209 | paraSample.preloaderEnabled = true; 210 | 211 | paraSample.settings = { 212 | 213 | removeScrollbar: 214 | utilLib.deviceDescription.type != utilLib.DEVICE_TYPES.wPhone, 215 | 216 | disableAutoHashChange: utilLib.deviceDescription.type == utilLib.DEVICE_TYPES.android, 217 | 218 | touchNotScrollMode: 219 | (utilLib.deviceDescription.type != utilLib.DEVICE_TYPES.desktop) 220 | && utilLib.deviceDescription.touchCapable, 221 | 222 | mousewheelSlowness: { 223 | windows: 15, 224 | mac: 60 225 | }, 226 | 227 | pauseSideAnimationsWhenMoving: true 228 | 229 | } 230 | 231 | function parallax(param) { 232 | 233 | /* Настройки */ 234 | 235 | var parallaxID = "parallax", 236 | overflowsParentClass = "overflowsSlide", 237 | wrapsWindowWidthClass = 'wrapsWindowWidth', 238 | paralaxBackgroundClass = 'parallaxBackground', 239 | 240 | /* Отключает скроллбар вовсе */ 241 | scrollbarFullyRemoved = param.removeScrollbar; 242 | 243 | /* 244 | * Можно задать тип анимации параллакса и слоев 245 | * и анимируемое свойство. 246 | * 247 | * Далее следует оценка 248 | * совместимости настроек 249 | * в виде таблицы. 250 | * 251 | * Без анимации виртуального скролла: 252 | * 253 | * X JQuery CSS3 254 | * left | o | o | o | 255 | * translate | o | ? | o | 256 | * 257 | * С анимированным виртуальным скроллом: 258 | * 259 | * X JQuery CSS3 260 | * left | o | x | x | 261 | * translate | o | x | x | 262 | * 263 | * 264 | * */ 265 | 266 | 267 | var animationTypes = { 268 | NONE : 0, 269 | JQ_EASED : 1, 270 | CSS3_EASED : 2, 271 | SUPER_EASED : 3, 272 | EASED : 4 273 | }, shiftPropertyTypes = { 274 | LEFT : 'left', 275 | TRANSLATEX : 'translateX', 276 | TRANSLATE : 'translate', 277 | TRANSLATE3D : 'translate3d' 278 | }; 279 | 280 | var layerAnimationType = animationTypes.NONE, 281 | scrollValueAnimationType = animationTypes.EASED, 282 | parallaxLeftAnimationType = animationTypes.NONE; 283 | 284 | var layerShiftProperty = param.layerShiftProperty || 'left', 285 | parallaxShiftProperty = param.parallaxShiftProperty || 'left'; 286 | 287 | //http://easings.net/ru 288 | var scrollEasing = 'easeOutExpo', scrollAnimationDuration = 1500; 289 | 290 | /* Конец настроек, начало рабочего кода */ 291 | 292 | var para_cached = this; 293 | 294 | var windowWidth; 295 | 296 | var slides = { 297 | $src : undefined, 298 | array : [], 299 | singleSlideWidth : 0 300 | }; 301 | 302 | 303 | var scroll = { 304 | add : function() { 305 | }, 306 | get : function() { 307 | }, 308 | delta : 0, 309 | cur : 0, 310 | previous : 0, 311 | maxLimit : 0, 312 | firstStep : 0, 313 | $src : undefined, 314 | startWindowWidth : 0, 315 | resizeModifier : 1, 316 | minimalStep : 0 317 | }; 318 | 319 | para_cached.scroll = scroll; 320 | 321 | this.currentSlideI = 0; 322 | 323 | this.mouseWheelTarget = $('body'); 324 | 325 | this.findLayerWrapper = function(src) { 326 | 327 | for (var i = 0, s = slides.array[0]; i < slides.array.length; i++, s = slides.array[i]) { 328 | 329 | for (var j = 0, l = s.layers[0]; j < s.layers.length; j++, l = s.layers[j]) { 330 | 331 | if (src == l.$src[0]) { 332 | return l; 333 | } 334 | 335 | } 336 | 337 | } 338 | } 339 | 340 | var slideChangeModel = 'onBorder'; 341 | 342 | function layer($src, prnt) { 343 | 344 | //$src.parent().css('display',''); 345 | 346 | var hasParalaxBackgroundClass = $src.hasClass(paralaxBackgroundClass); 347 | 348 | this.$src = $src; 349 | this.prnt = prnt; 350 | this.spd = +$src.attr('alt'); 351 | 352 | if (hasParalaxBackgroundClass) { 353 | $src.css('min-height', '100%'); 354 | } 355 | 356 | var slowness = 1 - this.spd, extraSpeed = this.spd - 1; 357 | 358 | var halfWindowWidth, halfParentWidth, preCalculatedPosition, halfWidth; 359 | 360 | var hasOverflowMarker = $src.hasClass(overflowsParentClass), isSmallAndSlow; 361 | 362 | var relLeftBorder = 0, relRightBorder; 363 | 364 | if (layerAnimationType == animationTypes.CSS3_EASED) { 365 | CSS3setupAdjust(layerShiftProperty, this.$src); 366 | } 367 | 368 | this.applyWindowSize = function() { 369 | 370 | if (!hasParalaxBackgroundClass) { 371 | $src.attr('style', ''); 372 | } else { 373 | 374 | paraSample.applyHorizontalShift('', $src); 375 | $src.css({ 376 | width : '' 377 | }); 378 | // Opera: 379 | // переключение позиционирования 380 | // слоя с относительного на абсолютное 381 | // рушит верстку. 382 | var usingOpera = navigator.userAgent.indexOf('Opera') > -1; 383 | if (!usingOpera) { 384 | $src.css({ 385 | position : '' 386 | }); 387 | } 388 | } 389 | 390 | halfWindowWidth = windowWidth / 2; 391 | halfParentWidth = this.prnt.width / 2; 392 | 393 | /*var isTestSlide = false&&$src.parent().is('#intro');*/ 394 | 395 | if (hasParalaxBackgroundClass) { 396 | 397 | this.width = $src.width(); 398 | var minWidth = this.spd * (this.prnt.prnt.width - windowWidth) + windowWidth; 399 | 400 | if (this.width < minWidth) { 401 | this.width = minWidth; 402 | $src.width(this.width); 403 | } 404 | 405 | } else { 406 | 407 | // Баг в (sic!) Хроме. 408 | // Элемент 5.5 409 | // Имеет правила, меняющие его высоту. 410 | // В этот момент программы Хром меняет высоту в соответствии с правилом, 411 | // но оставляет ширину неизменной. 412 | // Попробуем вылечить небольшим встряхиванием состояния элемента. 413 | $src.css('position','absolute'); 414 | /*(if(isTestSlide){ 415 | console.log($src,$src.width()); 416 | }*/ 417 | this.width = $src.width(); 418 | $src.css('position',''); 419 | /*if(isTestSlide){ 420 | console.log($src,$src.width()); 421 | }*/ 422 | } 423 | 424 | halfWidth = this.width / 2; 425 | relRightBorder = prnt.width - this.width; 426 | 427 | isSmallAndSlow = this.spd <= 1 && this.width < this.prnt.width; 428 | this.overflowsParent = hasOverflowMarker || hasParalaxBackgroundClass || !isSmallAndSlow; 429 | 430 | this.$src.css('left', ''); 431 | 432 | // Moz: 433 | // Если позиционирование слоя на этот момент абсолютное, 434 | // то даже с учетом ресета css('left', '') 435 | // .css('left') будет выдавать числовое значение, 436 | // не содержащееся ни в одном из каскадных стилей. 437 | var cssLeft = $src.css('left'); 438 | 439 | /* 440 | * В Опере нельзя переключать позиционирование фонового слоя, 441 | * но можно определить, что css-left = auto, при абсолютном. 442 | * В FF можно переключать позиционирование этого слоя, 443 | * но нельзя определить, что css-left = auto, при абсолютном. 444 | * Решение: для Оперы всегда сохранять абсолютное позиционирование, 445 | * для остальных браузеров -- отключать во время определения css-left = auto. 446 | */ 447 | $src.css({ 448 | display : 'inline-block', 449 | overflow : 'visible', 450 | position : 'absolute' 451 | }); 452 | 453 | // Moz: 454 | // Элементы с позиционированием не-static 455 | // выдают численное значение даже при отсутствии left в стиле. 456 | if (cssLeft == 'auto') { 457 | this.left = halfParentWidth - halfWidth; 458 | } else { 459 | this.left = parseInt(cssLeft, 10); 460 | } 461 | 462 | if (layerShiftProperty !== shiftPropertyTypes.LEFT) { 463 | this.$src.css('left', '0px'); 464 | }; 465 | 466 | if (this.spd == 0) { 467 | preCalculatedPosition = halfWindowWidth - halfWidth; 468 | } else if (this.spd > 0 && this.spd < 1) { 469 | preCalculatedPosition = (halfWindowWidth - halfWidth) * (1 - this.spd) + this.left * this.spd; 470 | } else { 471 | preCalculatedPosition = this.left; 472 | } 473 | 474 | } 475 | /* 476 | Формулы подсчета в сыром виде: 477 | 478 | spd = 0 479 | halfWindowWidth-halfWidth+inScroll 480 | spd: (0,1) 481 | (halfWindowWidth-halfWidth+inScroll)*(1-this.spd)+this.left*this.spd 482 | spd > 1 483 | this.left-inScroll*(this.spd-1) 484 | */ 485 | 486 | this.parallaxLeft = function(inScroll) { 487 | 488 | if (this.spd == 0) { 489 | this.currentLeft = preCalculatedPosition + inScroll; 490 | } else if (this.spd > 0 && this.spd < 1) { 491 | this.currentLeft = preCalculatedPosition + inScroll * slowness; 492 | } else { 493 | this.currentLeft = preCalculatedPosition - inScroll * extraSpeed; 494 | } 495 | return this.currentLeft 496 | } 497 | 498 | this.adjust = function(inScroll) { 499 | 500 | var left = this.parallaxLeft(inScroll); 501 | 502 | /* 503 | Слоям на переднем плане (очень быстрым) 504 | позволяем выходить за границу слайда 505 | */ 506 | 507 | if (!this.overflowsParent) { 508 | 509 | var leftBorder = relLeftBorder, rightBorder = relRightBorder; 510 | 511 | if (left < leftBorder) { 512 | left = leftBorder; 513 | } else if (left > rightBorder) { 514 | left = rightBorder; 515 | } 516 | 517 | } 518 | 519 | if (layerAnimationType == animationTypes.CSS3_EASED || layerAnimationType == animationTypes.NONE) { 520 | 521 | paraSample.applyHorizontalShift(left, this.$src, layerShiftProperty); 522 | } else if (layerAnimationType == animationTypes.JQ_EASED) { 523 | jqueryAnimateShift(this.$src, left); 524 | } 525 | 526 | } 527 | 528 | return this; 529 | } 530 | 531 | function slide($src, masterSlide, prnt) { 532 | 533 | this.masterSlide = masterSlide; 534 | this.layers = []; 535 | this.$src = $src; 536 | this.initialLeft = 0; 537 | this.left = 0; 538 | this.width = 0; 539 | this.$axis = {}; 540 | this.prnt = prnt; 541 | var children = this.$src.children(); 542 | 543 | var windowWidth_cache; 544 | 545 | this.childrenVisible = true; 546 | 547 | this.adjust = function() { 548 | 549 | this.left = this.initialLeft - this.prnt.$src.scroll; 550 | 551 | var right = this.left + this.width; 552 | 553 | var toTheLeftOfScreen = this.left < 0 && right < 0, toTheRightOfScreen = this.left > windowWidth_cache && right > windowWidth_cache; 554 | 555 | if ((toTheLeftOfScreen || toTheRightOfScreen) 556 | && !param.noSlideHideOptimization) { 557 | if (this.childrenVisible) { 558 | children.hide(); 559 | this.childrenVisible = false; 560 | } 561 | } else { 562 | if (!this.childrenVisible) { 563 | 564 | children.show(); 565 | this.childrenVisible = true; 566 | } 567 | 568 | /* Переход к дочерним слоям */ 569 | 570 | var scrollPosition = -this.left; 571 | 572 | for (var i = 0, l = this.layers[0], len = this.layers.length; i < len; i++, l = this.layers[i]) { 573 | l.adjust(scrollPosition); 574 | } 575 | } 576 | 577 | } 578 | var slide = this; 579 | 580 | this.applyWindowSize = function() { 581 | 582 | windowWidth_cache = windowWidth; 583 | this.$src.css('display', ''); 584 | if (masterSlide) { 585 | this.width = this.prnt.width; 586 | this.initialLeft = 0; 587 | 588 | } else { 589 | this.width = windowWidth; 590 | this.initialLeft = this.prnt.width; 591 | this.$src.css('width', this.width); 592 | 593 | } 594 | 595 | } 596 | this.applyWindowSize(); 597 | 598 | this.applyWindowSizeToChildren = function() { 599 | 600 | children.show(); 601 | 602 | for (var i = 0, j = slide.layers.length; i < j; i++) { 603 | slide.layers[i].applyWindowSize(); 604 | }; 605 | } 606 | 607 | this.initChildren = function() { 608 | 609 | var layerChildren; 610 | 611 | if (masterSlide) { 612 | layerChildren = this.$src.children('[alt]'); 613 | } else { 614 | layerChildren = $('*[alt]', this.$src); 615 | } 616 | 617 | children.show(); 618 | 619 | layerChildren.each(function() { 620 | 621 | var $layer = $(this) 622 | 623 | if ($layer.attr('alt') == '1') { 624 | $layer.css({ 625 | position : 'absolute' 626 | }); 627 | slide.$axis = $layer; 628 | 629 | } else { 630 | var wrapped = new layer($layer, slide); 631 | slide.layers.push(wrapped); 632 | } 633 | }); 634 | } 635 | this.initChildren(); 636 | 637 | return this; 638 | 639 | } 640 | 641 | 642 | this.init = init; 643 | function init() { 644 | 645 | slides.$src = $('#' + parallaxID); 646 | slides.$src.scroll = 0; 647 | 648 | if (scrollbarFullyRemoved) { 649 | $('html').css('overflow', 'hidden'); 650 | } else { 651 | $('html').css({ 652 | 'overflow-x' : 'scroll', 653 | 'overflow-y' : 'hidden' 654 | }); 655 | } 656 | 657 | slides.$src.children('div').css({ 658 | height : '100%', 659 | position : 'relative', 660 | float : 'left', 661 | overflow : 'hidden' 662 | }); 663 | 664 | slides.$src.css({ 665 | width : '100%', 666 | height : '100%', 667 | 'overflow-x' : 'visible', 668 | position : 'fixed' 669 | }); 670 | 671 | if (parallaxLeftAnimationType === animationTypes.CSS3_EASED) { 672 | CSS3setupAdjust(parallaxShiftProperty, slides.$src); 673 | } 674 | 675 | initSlides(); 676 | 677 | applyWindowSize(); 678 | 679 | applyWindowSizeToParallaxLayers(); 680 | 681 | refreshSlides(); 682 | 683 | //$('body').bind('mousewheel', onMouseWheel); 684 | 685 | $('.' + paralaxBackgroundClass).css('z-index', 'auto'); 686 | 687 | slides.$src.trigger('init'); 688 | 689 | } 690 | 691 | function initSlides() { 692 | 693 | /* Обычные слайды */ 694 | 695 | slides.array = []; 696 | 697 | slides.$src.find('> div').each(function() { 698 | var $slide = $(this); 699 | if ($slide.attr('alt')) 700 | return; 701 | var p = new slide($slide, false, slides); 702 | 703 | slides.array.push(p); 704 | }); 705 | 706 | para_cached.slidesCount = slides.array.length; 707 | 708 | /* Сам параллакс выступает в качестве слайда 709 | * по отношению к фону параллакса */ 710 | 711 | var p = new slide(slides.$src, true, slides); 712 | slides.array.push(p); 713 | 714 | } 715 | 716 | function applyWindowSize() { 717 | 718 | windowWidth = $(window).innerWidth(); 719 | 720 | slides.singleSlideWidth = windowWidth; 721 | 722 | scroll.minimalStep = windowWidth / 1000 / 15; 723 | 724 | slides.width = 0; 725 | 726 | for (var i = 0, l = slides.array.length; i < l; i++) { 727 | var s = slides.array[i] 728 | s.applyWindowSize(); 729 | if (!s.masterSlide) { 730 | slides.width += s.width; 731 | } 732 | } 733 | 734 | slides.$src.width(slides.width); 735 | scroll.maxLimit = slides.width - windowWidth; 736 | 737 | initScrollbar(); 738 | 739 | } 740 | 741 | function applyWindowSizeToParallaxLayers() { 742 | for (var i = 0, s = slides.array[i]; i < slides.array.length; i++, s = slides.array[i]) { 743 | 744 | s.applyWindowSizeToChildren(); 745 | } 746 | 747 | 748 | slides.$src.trigger('engineRebuild', slides.$src.scroll) 749 | //customEventEngine.call(para_cached, 'engineRebuild', slides.$src.scroll); 750 | } 751 | 752 | var intervalID, stepToBe; 753 | 754 | // Участник собственноручно сделанного сглаженного скролла 755 | function stepF() { 756 | 757 | stepToBe = (scroll.cur - slides.$src.scroll) / 15; 758 | 759 | if (Math.abs(stepToBe) > scroll.minimalStep) { 760 | slides.$src.scroll += stepToBe; 761 | 762 | refreshSlidesAndFireListeners(); 763 | 764 | } else if (scroll.doingNextMove) { 765 | scroll.doingNextMove = false; 766 | 767 | 768 | slides.$src.trigger('finishedMove', slides.$src.scroll) 769 | slides.$src.removeClass('disable-hover'); 770 | 771 | } 772 | 773 | }; 774 | 775 | var straightScrollSwitch = false; 776 | 777 | function straightScroll() { 778 | 779 | slides.$src.scroll = scroll.cur; 780 | 781 | refreshSlidesAndFireListeners(); 782 | 783 | straightScrollSwitch = false; 784 | } 785 | 786 | var lastSlideI = 0, currentSlideI = 0, rawScroll = 0; 787 | 788 | function trackSlideChange() { 789 | 790 | rawScroll = scroll.cur / slides.singleSlideWidth; 791 | 792 | if(slideChangeModel == 'onBorder'){ 793 | 794 | // смена происходит 795 | // на границе слайдов 796 | while (rawScroll <= lastSlideI - .5) { 797 | para.currentSlideI--; 798 | lastSlideI = para.currentSlideI; 799 | } 800 | 801 | while (rawScroll >= lastSlideI + .5) { 802 | para.currentSlideI++; 803 | lastSlideI = para.currentSlideI; 804 | } 805 | 806 | } else { 807 | 808 | // смена происходит 809 | // в центре соседнего слайда 810 | while (rawScroll <= lastSlideI - 1) { 811 | para.currentSlideI--; 812 | lastSlideI = para.currentSlideI; 813 | } 814 | 815 | while (rawScroll >= lastSlideI + 1) { 816 | para.currentSlideI++; 817 | lastSlideI = para.currentSlideI; 818 | } 819 | } 820 | } 821 | 822 | function getScrollPositionAndAnimateEverything() { 823 | 824 | scroll.cur = scroll.get(); 825 | scroll.delta = Math.abs(slides.$src.scroll - scroll.cur); 826 | 827 | scroll.doingNextMove = true; 828 | 829 | slides.$src.trigger('startedMove', slides.$src.scroll) 830 | slides.$src.addClass('disable-hover'); 831 | 832 | if (false) 833 | alert('getScrollPositionAndAnimateEverything : .cur: ' + scroll.cur + ', $src.scroll: ' + slides.$src.scroll); 834 | 835 | if (straightScrollSwitch) { 836 | 837 | straightScroll(); 838 | 839 | } else if (scrollValueAnimationType == animationTypes.EASED) { 840 | 841 | if (!intervalID) 842 | intervalID = setInterval(stepF, 17); 843 | 844 | } else if (scrollValueAnimationType == animationTypes.SUPER_EASED) { 845 | if (scroll.delta > 70) { 846 | 847 | scroll.firstStep = true; 848 | 849 | slides.$src.stop(true, true).animate({ 850 | scroll : scroll.cur 851 | }, { 852 | step : function(now, fx) { 853 | 854 | /* дикий хак */ 855 | if (scroll.firstStep) { 856 | fx.start = slides.$src.scroll; 857 | scroll.firstStep = false; 858 | return; 859 | } 860 | 861 | refreshSlidesAndFireListeners(); 862 | slides.$src.scroll = now; 863 | 864 | }, 865 | duration : scrollAnimationDuration, 866 | easing : scrollEasing 867 | }); 868 | 869 | } else { 870 | 871 | slides.$src.stop(true, true); 872 | slides.$src.scroll = scroll.cur; 873 | refreshSlidesAndFireListeners() 874 | } 875 | 876 | } else if (scrollValueAnimationType == animationTypes.JQ_EASED) { 877 | 878 | slides.$src.stop().animate({ 879 | scroll : scroll.cur 880 | }, { 881 | step : function(now, fx) { 882 | slides.$src.scroll = now; 883 | refreshSlidesAndFireListeners(); 884 | 885 | }, 886 | duration : scrollAnimationDuration, 887 | easing : scrollEasing 888 | }); 889 | 890 | } else { 891 | straightScroll(); 892 | } 893 | 894 | trackSlideChange(); 895 | 896 | } 897 | 898 | function refreshSlidesAndFireListeners(){ 899 | 900 | refreshSlides(); 901 | 902 | 903 | slides.$src.trigger('scrollChange', slides.$src.scroll) 904 | //customEventEngine.call(para_cached, 'scrollChange', slides.$src.scroll); 905 | 906 | } 907 | 908 | function refreshSlides() { 909 | 910 | if (parallaxLeftAnimationType == animationTypes.CSS3_EASED || parallaxLeftAnimationType == animationTypes.NONE) { 911 | paraSample.applyHorizontalShift(-slides.$src.scroll, slides.$src, parallaxShiftProperty); 912 | } else if (parallaxLeftAnimationType == animationTypes.JQ_EASED) { 913 | jqueryAnimateShift(slides.$src, -slides.$src.scroll); 914 | } 915 | 916 | 917 | for (var i = 0, s = slides.array[0], len = slides.array.length; i < len; i++, s = slides.array[i]) { 918 | s.adjust(); 919 | } 920 | 921 | 922 | 923 | /* 924 | for(var l in scrollListeners){ 925 | 926 | scrollListeners[l](slides.$src.scroll); 927 | }*/ 928 | 929 | } 930 | 931 | function initScrollbar() { 932 | 933 | var scrollListenerTarget; 934 | 935 | var firstInit = scroll.$src ? false : true; 936 | 937 | if (!firstInit) { 938 | scroll.$src.remove(); 939 | } else { 940 | startWindowWidth = windowWidth; 941 | } 942 | 943 | if (param.touchNotScrollMode) { 944 | 945 | /* 946 | $('html').css('overflow','hidden'); 947 | $('body').css('overflow','hidden');*/ 948 | 949 | var dummy = $('
').css({ 950 | position : 'absolute', 951 | display : 'hidden' 952 | }); 953 | 954 | if (firstInit) 955 | $('body').append(dummy); 956 | 957 | scroll.$src = $('
').css({ 958 | width : slides.width, 959 | }); 960 | 961 | var touchStart = 0; 962 | time = { 963 | start : 0, 964 | end : 0 965 | }; 966 | 967 | var delta, speed = { 968 | cur : 0, 969 | max : 15, 970 | min : .1 971 | }; 972 | 973 | if (firstInit) { 974 | 975 | slides.$src[0].addEventListener("touchmove", function(e) { 976 | 977 | 978 | if (e.touches.length > 1) 979 | return; 980 | 981 | e.preventDefault(); 982 | 983 | time.end = new Date().getTime(); 984 | 985 | var deltaTime = time.end - time.start; 986 | 987 | delta = e.touches[0].screenX - touchStart; 988 | 989 | speed.cur = delta * delta / 15 * (delta < 0 ? -1 : 1); 990 | 991 | scroll.add(-speed.cur); 992 | 993 | touchStart = e.touches[0].screenX; 994 | 995 | time.start = time.end; 996 | 997 | }); 998 | 999 | slides.$src[0].addEventListener("touchstart", function(e) { 1000 | 1001 | //e.preventDefault(); 1002 | 1003 | 1004 | time.start = new Date().getTime(); 1005 | 1006 | touchStart = e.touches[0].screenX; 1007 | 1008 | scroll.stop(); 1009 | 1010 | }); 1011 | 1012 | } 1013 | 1014 | var maxScroll = slides.width - windowWidth, minScroll = 0; 1015 | 1016 | scroll.add = function(delta) { 1017 | 1018 | if (scroll.cur + delta > maxScroll) { 1019 | scroll.cur = maxScroll 1020 | } else if (scroll.cur + delta < minScroll) { 1021 | scroll.cur = minScroll; 1022 | } else { 1023 | scroll.cur += delta; 1024 | } 1025 | 1026 | getScrollPositionAndAnimateEverything(); 1027 | } 1028 | 1029 | scroll.stop = function() { 1030 | scroll.cur = slides.$src.scroll; 1031 | } 1032 | 1033 | scroll.get = function() { 1034 | return scroll.cur; 1035 | } 1036 | } else { 1037 | 1038 | var scrollTarget; 1039 | 1040 | if (!scrollbarFullyRemoved) { 1041 | 1042 | scroll.$src = $('
').css({ 1043 | width : slides.width, 1044 | height : '1px' 1045 | }); 1046 | 1047 | $('body').append(scroll.$src); 1048 | 1049 | scrollTarget = window; 1050 | } 1051 | 1052 | scroll.get = function() { 1053 | 1054 | if (scrollbarFullyRemoved) { 1055 | return scroll.cur; 1056 | } 1057 | 1058 | return $(scrollTarget).scrollLeft(); 1059 | } 1060 | 1061 | scroll.add = function(delta) { 1062 | 1063 | if (scrollbarFullyRemoved) { 1064 | 1065 | var newScroll = scroll.cur + delta; 1066 | 1067 | if (newScroll < 0) { 1068 | newScroll = 0; 1069 | } else if (newScroll > scroll.maxLimit) { 1070 | newScroll = scroll.maxLimit; 1071 | } 1072 | 1073 | scroll.cur = newScroll; 1074 | getScrollPositionAndAnimateEverything(); 1075 | return; 1076 | } 1077 | $(scrollTarget).scrollLeft($(scrollTarget).scrollLeft() + delta); 1078 | } 1079 | if (firstInit && !scrollbarFullyRemoved) { 1080 | 1081 | $(scrollTarget).on('scroll', getScrollPositionAndAnimateEverything); 1082 | } 1083 | } 1084 | 1085 | para_cached.add = scroll.add; 1086 | 1087 | para_cached.width = slides.width; 1088 | } 1089 | 1090 | 1091 | this.toSlide = function(index) { 1092 | if (index > -1 && index < slides.array.length) { 1093 | this.to(windowWidth * index); 1094 | } 1095 | } 1096 | 1097 | this.to = function(value) { 1098 | scroll.add(value - scroll.get()); 1099 | } 1100 | function closerGeneric(left) { 1101 | var cur = scroll.get(), roun = left ? Math.floor : Math.ceil, curIndex = cur / slides.singleSlideWidth, dest = roun(cur / slides.singleSlideWidth); 1102 | 1103 | if (cur % slides.singleSlideWidth == 0) { 1104 | dest += left ? (-1) : 1; 1105 | } 1106 | dest *= slides.singleSlideWidth; 1107 | 1108 | para_cached.to(dest); 1109 | } 1110 | 1111 | 1112 | this.closerLeft = function() { 1113 | closerGeneric(true); 1114 | } 1115 | 1116 | this.closerRight = function() { 1117 | closerGeneric(false); 1118 | } 1119 | function CSS3setupAdjust(shiftProperty, $div) { 1120 | 1121 | var transiTrailer = scrollAnimationDuration + 'ms ease-in-out 1ms'; 1122 | 1123 | if (shiftProperty == shiftPropertyTypes.LEFT) { 1124 | 1125 | transi = 'left ' + transiTrailer; 1126 | 1127 | } else if (shiftProperty == shiftPropertyTypes.TRANSLATE || shiftProperty == shiftPropertyTypes.TRANSLATEX || shiftProperty == shiftPropertyTypes.TRANSLATE3D) { 1128 | 1129 | transi = '-webkit-transform ' + transiTrailer; 1130 | 1131 | } 1132 | 1133 | $div.css({ 1134 | WebkitTransition : transi, 1135 | MozTransition : transi, 1136 | OTransition : transi, 1137 | msTransition : transi, 1138 | transition : transi 1139 | }); 1140 | 1141 | } 1142 | 1143 | function jqueryAnimateShift($div, value) { 1144 | 1145 | $div.stop(false).animate({ 1146 | left : value + 'px', 1147 | }, scrollAnimationDuration, scrollEasing); 1148 | } 1149 | 1150 | 1151 | /* Обратные связи */ 1152 | 1153 | var absScroll, relativeScroll; 1154 | 1155 | this.onResizeSlides = function() { 1156 | 1157 | absScroll = scroll.get(); 1158 | relativeScroll = absScroll / windowWidth; 1159 | 1160 | applyWindowSize(); 1161 | 1162 | } 1163 | 1164 | this.onResizeLayers = function() { 1165 | 1166 | applyWindowSizeToParallaxLayers(); 1167 | 1168 | refreshSlidesAndFireListeners(); 1169 | 1170 | var newScroll = relativeScroll * windowWidth; 1171 | 1172 | straightScrollSwitch = true; 1173 | 1174 | scroll.add(newScroll - scroll.get()); 1175 | } 1176 | } 1177 | 1178 | /* 1179 | * Загрузка 1180 | */ 1181 | 1182 | var preloader = { 1183 | disable : undefined, 1184 | start : undefined, 1185 | onLoad : function() { 1186 | }, 1187 | $slide : undefined, 1188 | visuals : undefined, 1189 | fillVisuals : function() { 1190 | }, 1191 | fillingTime : 1400, 1192 | delayBeforeLoadCheck : 0, 1193 | targetLogoWidth : 0 1194 | }; 1195 | 1196 | var loaderClass = 'loadBackground'; 1197 | 1198 | preloader.fillVisuals = function(fillAmount, callback) { 1199 | 1200 | if (!callback) 1201 | callback = function() { 1202 | }; 1203 | 1204 | $(function() { 1205 | preloader.visuals.loaded/*.stop(false, false)*/.animate({ 1206 | 'width' : preloader.targetLogoWidth * fillAmount 1207 | }, { 1208 | duration : preloader.fillingTime, 1209 | queue : false 1210 | }); 1211 | preloader.visuals.unloaded/*.stop(false, false)*/.animate({ 1212 | 'width' : (1 - fillAmount) * preloader.targetLogoWidth 1213 | }, { 1214 | duration : preloader.fillingTime, 1215 | queue : false, 1216 | complete : callback 1217 | }); 1218 | }); 1219 | 1220 | } 1221 | 1222 | preloader.disable = function(param) { 1223 | 1224 | if (param && param.rough) { 1225 | 1226 | $('.' + loaderClass).remove(); 1227 | preloader.$slide.remove(); 1228 | 1229 | } else { 1230 | 1231 | $('.' + loaderClass).delay(300).animate({ 1232 | 'opacity' : 0 1233 | }, preloader.fillingTime, function() { 1234 | $(this).remove(); 1235 | }); 1236 | 1237 | preloader.$slide.animate({ 1238 | 'opacity' : 0, 1239 | /*left: "-"+preloader.$slide.width()+"px"*/ 1240 | }, preloader.fillingTime, function() { 1241 | $(this).remove(); 1242 | }); 1243 | } 1244 | 1245 | $(document.body).removeClass('unloaded'); 1246 | 1247 | } 1248 | $(function() { 1249 | return; 1250 | var $media = $('html').find('img,video'); 1251 | 1252 | var lc = 0; 1253 | $media.on('load', function() { 1254 | lc++; 1255 | utilLib.debLog('loadEvent() fired. Total fired: ' + lc + '\n Still need to load ' + ($media.length - lc)); 1256 | console.log(this); 1257 | }); 1258 | $media.on('error', function() { 1259 | lc++; 1260 | utilLib.debLog('errorEvent() fired.'); 1261 | console.log(this); 1262 | }); 1263 | }); 1264 | 1265 | preloader.init = function(){ 1266 | preloader.visuals = { 1267 | loaded : $('.preloaderCont .ending'), 1268 | unloaded : $('.preloaderCont .starting') 1269 | }; 1270 | preloader.$slide = $('.preloaderCont'); 1271 | preloader.targetLogoWidth = .9 * $(window).innerWidth(); 1272 | } 1273 | 1274 | preloader.start = function() { 1275 | 1276 | preloader.init(); 1277 | 1278 | var $media = $('html').find('img,video'); 1279 | 1280 | var mediaCount = $media.length; 1281 | 1282 | var local_onContentLoad = this.onContentLoad; 1283 | 1284 | var loaded = 0; 1285 | 1286 | preloader.visuals.loaded 1287 | .add(preloader.visuals.unloaded) 1288 | .css('opacity', 0); 1289 | 1290 | var $subCont = $('.preloaderCont .subCont'); 1291 | 1292 | var imageAspect = preloader.visuals.loaded.find('img').width() / preloader.visuals.loaded.find('img').height(); 1293 | 1294 | preloader.visuals.loaded.find('img') 1295 | .add(preloader.visuals.unloaded.find('img')) 1296 | .add(preloader.visuals.unloaded) 1297 | .css('width', preloader.targetLogoWidth); 1298 | 1299 | $subCont 1300 | .add(preloader.visuals.loaded.find('img')) 1301 | .add(preloader.visuals.unloaded.find('img')) 1302 | .css('height', preloader.targetLogoWidth / imageAspect); 1303 | 1304 | 1305 | 1306 | function getFilesToLoadCount() { 1307 | 1308 | var a = $media.filter(function() { 1309 | 1310 | // причина: в одном из браузеров не обнаружил complete у svg-изображения 1311 | if (this.src && this.src.indexOf('svg') > -1) { 1312 | return false; 1313 | // видео 1314 | /*READY_STATE http://www.w3schools.com/tags/av_prop_readystate.asp*/ 1315 | } else if (this.readyState !== undefined && this.readyState >= 3) { 1316 | return false; 1317 | } else if (this.complete) { 1318 | return false; 1319 | } 1320 | 1321 | //console.log(this); 1322 | return true; 1323 | 1324 | }); 1325 | 1326 | return a.length; 1327 | } 1328 | 1329 | setTimeout(earlyCachedDetection, preloader.delayBeforeLoadCheck); 1330 | 1331 | function earlyCachedDetection() { 1332 | 1333 | var alreadyLoaded = getFilesToLoadCount(); 1334 | 1335 | if (alreadyLoaded == 0) { 1336 | 1337 | utilLib.debLog('No need to load.'); 1338 | 1339 | preloader.onLoad(); 1340 | preloader.disable({ 1341 | 'rough' : true 1342 | }); 1343 | 1344 | return; 1345 | 1346 | } else { 1347 | 1348 | preloader.visuals.loaded.add(preloader.visuals.unloaded).animate({ 1349 | 'opacity' : 1 1350 | }, 300); 1351 | a(); 1352 | } 1353 | } 1354 | 1355 | function a() { 1356 | 1357 | var notLoaded = getFilesToLoadCount(); 1358 | 1359 | var loadedPart = (mediaCount - notLoaded ) / mediaCount; 1360 | 1361 | if (notLoaded == 0) { 1362 | 1363 | utilLib.debLog('Finished loading'); 1364 | 1365 | preloader.fillVisuals(loadedPart, preloader.onLoad); 1366 | 1367 | } else { 1368 | 1369 | setTimeout(a, 1000); 1370 | 1371 | utilLib.debLog('Still need to load ' + notLoaded); 1372 | 1373 | preloader.fillVisuals(loadedPart); 1374 | 1375 | } 1376 | } 1377 | 1378 | } 1379 | 1380 | 1381 | /* 1382 | 1383 | resizeables.js 1384 | 1385 | * Пожалуйста, предоставляйте 1386 | * релевантные глобальные переменные 1387 | * windowWidth, windowHeight, windowAspect 1388 | * перед вызовами resizeables.adjust() 1389 | */ 1390 | 1391 | var resizeables = { 1392 | 1393 | engineCreator: undefined, 1394 | 1395 | engine: undefined, 1396 | 1397 | initFromDescript: function(d){ 1398 | resizeables.engine.getContainersFromDescript(d); 1399 | }, 1400 | init: function(){ 1401 | resizeables.engine.findContainers(); 1402 | }, 1403 | adjust: function(){ 1404 | resizeables.engine.adjust(); 1405 | }, 1406 | fillModes: { 1407 | FILL_PARENT : 'fillParent', 1408 | FIT_PARENT : 'fitParent', 1409 | FIT_PARENT_WIDTH : 'fitParentWidth', 1410 | NONE: 'none' 1411 | }, 1412 | orientations: { 1413 | LANDSCAPE : 'landscape', 1414 | PORTRAIT : 'portrait' 1415 | }, 1416 | criticalReadabilityClass: 'criticalReadability', 1417 | 1418 | /* Минимально допускаемый движком 1419 | * размер шрифта на .criticalReadability*/ 1420 | minimalReadableFontSize: 11 1421 | }; 1422 | 1423 | 1424 | 1425 | /* window.innerWidth и window.innerHeight 1426 | * на машине верстальщика при 100% зуме. */ 1427 | 1428 | resizeables.reference = {w:1280, h:923}; 1429 | 1430 | resizeables.engineCreator = function(){ 1431 | 1432 | var list = [], 1433 | l, 1434 | obj = resizeables; 1435 | 1436 | this.findContainers = function(){ 1437 | 1438 | for (var fm in obj.fillModes) { 1439 | $('.' + obj.fillModes[fm]).each(function() { 1440 | var a = new aRContainer($(this), obj.fillModes[fm]); 1441 | list.push(a); 1442 | }); 1443 | } 1444 | l = list.length; 1445 | } 1446 | 1447 | this.getContainersFromDescript = function(d){ 1448 | 1449 | for (var aRCIndex in d) { 1450 | var aRCData = d[aRCIndex]; 1451 | aRCData.$src = $(aRCData.srcString); 1452 | var aRC = new aRContainerGeneric(aRCData); 1453 | list.push(aRC); 1454 | } 1455 | l = list.length; 1456 | } 1457 | 1458 | this.adjust = function() { 1459 | for (var i = 0, arc = list[i]; i < l; i++, arc = list[i]) { 1460 | arc.adjust(); 1461 | } 1462 | } 1463 | 1464 | function aRContainer($src, fillMode) { 1465 | return new aRContainerGeneric({ 1466 | $src : $src, 1467 | fitting : fillMode 1468 | }); 1469 | } 1470 | 1471 | function aRContainerGeneric(src) { 1472 | 1473 | var $src = src.$src, 1474 | fitting = src.fitting, 1475 | multiLayout = src.multiLayout, 1476 | initialDim, 1477 | initialDimRelative, 1478 | aspect, 1479 | baseFontSize, 1480 | versionB; 1481 | 1482 | this.recollectMetrics = function() { 1483 | 1484 | if(fitting!=obj.fillModes.NONE){ 1485 | $src.css({ 1486 | width : '', 1487 | height : '', 1488 | 'font-size' : '' 1489 | }); 1490 | } 1491 | 1492 | initialDim = { 1493 | w : $src.outerWidth(true), 1494 | h : $src.outerHeight(true) 1495 | }; 1496 | aspect = initialDim.w / initialDim.h; 1497 | initialDimRelative = { 1498 | w : initialDim.w / resizeables.reference.w, 1499 | h : initialDim.h / resizeables.reference.h 1500 | }; 1501 | baseFontSize = parseInt($src.css('font-size'), 10); 1502 | 1503 | }; 1504 | 1505 | versionB = true;//src.versionB; 1506 | 1507 | if(versionB){ 1508 | $src.css('display','inline-block'); 1509 | } 1510 | 1511 | this.recollectMetrics(); 1512 | 1513 | criticalElements = $src.find('.' + obj.criticalReadabilityClass); 1514 | this.parent = $src.parent(); 1515 | 1516 | var currentOrientation, lastOrientation = 'none'; 1517 | 1518 | function updateOrientation() { 1519 | currentOrientation = windowAspect > layoutSwitchThreshold ? obj.orientations.LANDSCAPE : obj.orientations.PORTRAIT; 1520 | } 1521 | 1522 | var layoutSwitchThreshold = 1; 1523 | if (src.layoutSwitchThreshold) { 1524 | layoutSwitchThreshold = src.layoutSwitchThreshold; 1525 | } 1526 | 1527 | this.adjust = function() { 1528 | 1529 | if (multiLayout) { 1530 | 1531 | updateOrientation(); 1532 | 1533 | if (currentOrientation != lastOrientation) { 1534 | 1535 | $src.addClass(currentOrientation).removeClass(lastOrientation); 1536 | 1537 | this.recollectMetrics(); 1538 | 1539 | lastOrientation = currentOrientation; 1540 | } 1541 | 1542 | } 1543 | 1544 | if(fitting==obj.fillModes.NONE) return; 1545 | 1546 | var anchorDim = 'w', complementDim = 'h'; 1547 | 1548 | if (fitting === obj.fillModes.FILL_PARENT) { 1549 | if (aspect > windowAspect) { 1550 | anchorDim = 'h'; 1551 | } 1552 | } else if (fitting === obj.fillModes.FIT_PARENT) { 1553 | if (aspect < windowAspect) { 1554 | anchorDim = 'h'; 1555 | } 1556 | } 1557 | 1558 | if(anchorDim=='h'){ 1559 | complementDim = 'w'; 1560 | } 1561 | 1562 | var widthToBe, heightToBe, fontSizeToBe; 1563 | 1564 | var dimToBe = { 1565 | h: 0, 1566 | w: 0 1567 | }; 1568 | 1569 | var windowDim = { 1570 | h: windowHeight, 1571 | w: windowWidth 1572 | }; 1573 | 1574 | var marginNameTranslation = { 1575 | h: 'margin-left', 1576 | w: 'margin-top' 1577 | }; 1578 | 1579 | dimToBe[anchorDim] = 1580 | windowDim[anchorDim]* 1581 | (fitting === obj.fillModes.FILL_PARENT || versionB ? 1582 | 1 1583 | : initialDimRelative[anchorDim] 1584 | ); 1585 | 1586 | dimToBe[complementDim] = 1587 | dimToBe[anchorDim]; 1588 | 1589 | if(complementDim=='h'){ 1590 | dimToBe[complementDim] /= aspect; 1591 | } else { 1592 | dimToBe[complementDim] *= aspect; 1593 | } 1594 | 1595 | 1596 | if(dimToBe[complementDim]>windowDim[complementDim]){ 1597 | 1598 | var remargin = 1599 | -(dimToBe[complementDim] - windowDim[complementDim]) / 2; 1600 | 1601 | var complementMargin = marginNameTranslation[anchorDim], 1602 | anchorMargin = marginNameTranslation[complementDim]; 1603 | 1604 | $src.css(anchorMargin,''); 1605 | $src.css(complementMargin,remargin); 1606 | } 1607 | 1608 | fontSizeToBe = dimToBe.h/initialDim.h; 1609 | 1610 | 1611 | 1612 | 1613 | $src.width(dimToBe.w); 1614 | $src.height(dimToBe.h); 1615 | 1616 | fontSizeToBe *= baseFontSize; 1617 | $src.css('font-size', fontSizeToBe); 1618 | 1619 | // Здесь следим за тем, чтобы у специально помеченных надписей 1620 | // размер был не меньше порога [ obj.minimalReadableFontSize ] 1621 | for (var i = 0, l = criticalElements.length; 1622 | i < l; 1623 | i++) { 1624 | 1625 | $ce = $(criticalElements[i]); 1626 | 1627 | $ce.css('font-size', ''); 1628 | 1629 | var calculatedFontSize = parseInt($ce.css('font-size'), 10); 1630 | 1631 | if (calculatedFontSize < obj.minimalReadableFontSize) { 1632 | $ce.css('font-size', obj.minimalReadableFontSize + 'px'); 1633 | } 1634 | } 1635 | } 1636 | } 1637 | 1638 | return this; 1639 | }; 1640 | 1641 | resizeables.engine = new resizeables.engineCreator(); 1642 | 1643 | 1644 | 1645 | 1646 | function adjustFontSize() { 1647 | 1648 | var diminishing = { 1649 | w : window.innerWidth / resizeables.reference.w, 1650 | h : window.innerHeight / resizeables.reference.h 1651 | }; 1652 | 1653 | $('body').css('font-size', baseFontSize * Math.min(diminishing.w, diminishing.h)); 1654 | } 1655 | 1656 | /* ex-sample.js */ 1657 | 1658 | 1659 | 1660 | /* * Вспомогательные органы управления 1661 | */ 1662 | 1663 | function wheelStep(windowWidth) { 1664 | var deno = paraSample.settings.mousewheelSlowness.windows; 1665 | if(utilLib.deviceDescription.os == utilLib.OS_TYPES.mac){ 1666 | deno = paraSample.settings.mousewheelSlowness.mac; 1667 | } 1668 | return windowWidth / deno; 1669 | } 1670 | 1671 | function onMouseWheel(event, delta) { 1672 | 1673 | para.add(-delta * wheelstep); 1674 | event.preventDefault(); 1675 | event.stopPropagation(); 1676 | 1677 | }; 1678 | 1679 | $(document).keydown(function(e) { 1680 | 1681 | if (e.keyCode == '37') { 1682 | para.closerLeft(); 1683 | e.preventDefault(); 1684 | } else if (e.keyCode == '39' || e.keyCode == '32') { 1685 | para.closerRight(); 1686 | e.preventDefault(); 1687 | } 1688 | 1689 | }); 1690 | 1691 | function onResize() { 1692 | 1693 | para.onResizeSlides(); 1694 | 1695 | // Расщепление onResize параллакса и такая последовательность функций 1696 | // вызваны работой движка автомасштабируемых контейнеров. 1697 | // onResizeLayers зависит от его результатов (утверждение требует проверки), 1698 | // потому onResizeLayers следует после. 1699 | 1700 | nonParaResize(); 1701 | 1702 | para.onResizeLayers(); 1703 | 1704 | } 1705 | 1706 | 1707 | 1708 | 1709 | function nonParaResize() { 1710 | 1711 | windowWidth = $(window).innerWidth(); 1712 | windowHeight = $(window).innerHeight(); 1713 | windowAspect = windowWidth / windowHeight; 1714 | 1715 | wheelstep = wheelStep(windowWidth); 1716 | 1717 | adjustFontSize(); 1718 | resizeables.adjust(); 1719 | 1720 | } 1721 | 1722 | 1723 | var hashProcessingSystem = { 1724 | 1725 | doNotApplyHashFromAddressLine : false, 1726 | 1727 | userLock : false, 1728 | 1729 | lastSlideI : 0, 1730 | 1731 | applyHashFromAddressLine : function() { 1732 | 1733 | var addr = self.location.toString(), selectedSlide = addr.slice(addr.indexOf('#') + 1); 1734 | 1735 | if (selectedSlide == undefined) 1736 | return; 1737 | 1738 | for (var h in hashProcessingSystem.addrMap) { 1739 | if (selectedSlide == hashProcessingSystem.addrMap[h] && h != hashProcessingSystem.lastSlideI) { 1740 | hashProcessingSystem.userLock = true; 1741 | para.toSlide((+h)); 1742 | return; 1743 | } 1744 | } 1745 | }, 1746 | 1747 | trackHashChange : function trackHashChange() { 1748 | 1749 | if (paraSample.settings.disableAutoHashChange) return; 1750 | 1751 | // Значение para.currentSlideI соответствует не текущему смещению, 1752 | // а конечному. Значит, после того, как пользователь ввел хэш 1753 | // и начал переход, значение поменяется только один раз. 1754 | if (para.currentSlideI != hashProcessingSystem.lastSlideI) { 1755 | 1756 | hashProcessingSystem.lastSlideI = para.currentSlideI; 1757 | 1758 | if (hashProcessingSystem.userLock) { 1759 | hashProcessingSystem.userLock = false; 1760 | return; 1761 | } else { 1762 | hashProcessingSystem.doNotApplyHashFromAddressLine = true; 1763 | } 1764 | 1765 | var infoString = 'trackHashChange : Changing hash. '; 1766 | if (hashProcessingSystem.doNotApplyHashFromAddressLine) { 1767 | infoString += ' Has doNotApplyHashFromAddressLine.'; 1768 | } 1769 | if (hashProcessingSystem.userLock) { 1770 | infoString += ' Has userHashLock.'; 1771 | } 1772 | 1773 | window.location.hash = hashProcessingSystem.addrMap[para.currentSlideI]; 1774 | 1775 | } 1776 | } 1777 | } 1778 | 1779 | $(window).on('hashchange', function(e) { 1780 | 1781 | e.preventDefault(); 1782 | 1783 | if (hashProcessingSystem.doNotApplyHashFromAddressLine) { 1784 | //tdLib.debLog('jq.window.onhashchange : doNotApplyHashFromAddressLine, so returning.'); 1785 | hashProcessingSystem.doNotApplyHashFromAddressLine = false; 1786 | return; 1787 | } 1788 | 1789 | hashProcessingSystem.applyHashFromAddressLine(); 1790 | 1791 | return false; 1792 | 1793 | }); 1794 | 1795 | 1796 | // Пользователь запускает эту функцию 1797 | 1798 | function startAllParaSystems() { 1799 | 1800 | if(Modernizr.history 1801 | && window.history.state 1802 | && window.history.state.mediaIsLoaded){ 1803 | utilLib.debLog('All media is cached. Skipping preloader'); 1804 | paraSample.preloaderEnabled = false; 1805 | 1806 | } 1807 | debugging = self.location.toString().indexOf('xe') > -1; 1808 | var parallaxParams = { 1809 | removeScrollbar : paraSample.settings.removeScrollbar, 1810 | touchNotScrollMode : paraSample.settings.touchNotScrollMode 1811 | } 1812 | if (Modernizr.csstransforms3d) { 1813 | parallaxParams.layerShiftProperty = 'translate3d'; 1814 | parallaxParams.parallaxShiftProperty = 'translate3d'; 1815 | } 1816 | para = new parallax(parallaxParams); 1817 | baseFontSize = parseInt($('body').css('font-size')); 1818 | hiddenImagesContainer = $('.preloadedImages'); 1819 | 1820 | 1821 | 1822 | $('#parallax').on('init', function(){ 1823 | 1824 | para.mouseWheelTarget.bind('mousewheel', onMouseWheel); 1825 | $(window).on('resize', onResize); 1826 | hashProcessingSystem.addrMap = 1827 | $('#parallax>div').map(function(i){return i==0?'':$(this).attr('id')}); 1828 | hashProcessingSystem.applyHashFromAddressLine(); 1829 | preloader.disable(); 1830 | 1831 | }); 1832 | 1833 | $('#parallax').on('scrollChange', function(amount) { 1834 | 1835 | hashProcessingSystem.trackHashChange(); 1836 | }); 1837 | 1838 | function onPreloaderLoad(){ 1839 | 1840 | if(Modernizr.history){ 1841 | 1842 | $('a').on('click',function (args) { 1843 | 1844 | var href = $(this).attr('href'); 1845 | if(href=='' || href =='#') return; 1846 | 1847 | window.history.pushState({ 1848 | mediaIsLoaded: 'true' 1849 | }, 'mediaIsLoaded'); 1850 | 1851 | }); 1852 | 1853 | }; 1854 | 1855 | resizeables.initFromDescript(aRCDescript); 1856 | 1857 | nonParaResize(); 1858 | 1859 | if (parallax) { 1860 | para.init(); 1861 | } 1862 | 1863 | } 1864 | 1865 | if(paraSample.preloaderEnabled){ 1866 | preloader.onLoad = onPreloaderLoad; 1867 | } else { 1868 | preloader.init(); 1869 | onPreloaderLoad(); 1870 | } 1871 | 1872 | if(paraSample.preloaderEnabled){ 1873 | preloader.start(); 1874 | } 1875 | 1876 | }; -------------------------------------------------------------------------------- /static/js/third_party/jquery.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v@1.8.0 jquery.com | jquery.org/license */ 2 | (function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bR[a]=c,c}function ch(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||cd.test(a)?d(a,e):ch(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ch(a+"["+e+"]",b[e],c,d);else d(a,b)}function cy(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,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(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b
a",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="
t
",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/^(?:\{.*\}|\[.*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.shift(),e=p._queueHooks(a,b),f=function(){p.dequeue(a,b)};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;jq&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bd(a,b,c,d){var e=0,f=b.length;for(;e0?h(g,c,f):[]}function bf(a,c,d,e,f){var g,h,i,j,k,l,m,n,p=0,q=f.length,s=L.POS,t=new RegExp("^"+s.source+"(?!"+r+")","i"),u=function(){var a=1,c=arguments.length-2;for(;ai){m=a.slice(i,g.index),i=n,l=[c],B.test(m)&&(k&&(l=k),k=e);if(h=H.test(m))m=m.slice(0,-5).replace(B,"$&*");g.length>1&&g[0].replace(t,u),k=be(m,g[1],g[2],l,k,h)}}k?(j=j.concat(k),(m=a.slice(i))&&m!==")"?B.test(m)?bd(m,j,d,e):Z(m,c,d,e?e.concat(k):k):o.apply(d,j)):Z(a,c,d,e)}return q===1?d:Z.uniqueSort(d)}function bg(a,b,c){var d,e,f,g=[],i=0,j=D.exec(a),k=!j.pop()&&!j.pop(),l=k&&a.match(C)||[""],m=$.preFilter,n=$.filter,o=!c&&b!==h;for(;(e=l[i])!=null&&k;i++){g.push(d=[]),o&&(e=" "+e);while(e){k=!1;if(j=B.exec(e))e=e.slice(j[0].length),k=d.push({part:j.pop().replace(A," "),captures:j});for(f in n)(j=L[f].exec(e))&&(!m[f]||(j=m[f](j,b,c)))&&(e=e.slice(j.shift().length),k=d.push({part:f,captures:j}));if(!k)break}}return k||Z.error(a),g}function bh(a,b,e){var f=b.dir,g=m++;return a||(a=function(a){return a===e}),b.first?function(b,c){while(b=b[f])if(b.nodeType===1)return a(b,c)&&b}:function(b,e){var h,i=g+"."+d,j=i+"."+c;while(b=b[f])if(b.nodeType===1){if((h=b[q])===j)return b.sizset;if(typeof h=="string"&&h.indexOf(i)===0){if(b.sizset)return b}else{b[q]=j;if(a(b,e))return b.sizset=!0,b;b.sizset=!1}}}}function bi(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function bj(a,b,c){var d,e,f=0;for(;d=a[f];f++)$.relative[d.part]?e=bh(e,$.relative[d.part],b):(d.captures.push(b,c),e=bi(e,$.filter[d.part].apply(null,d.captures)));return e}function bk(a){return function(b,c){var d,e=0;for(;d=a[e];e++)if(d(b,c))return!0;return!1}}var c,d,e,f,g,h=a.document,i=h.documentElement,j="undefined",k=!1,l=!0,m=0,n=[].slice,o=[].push,q=("sizcache"+Math.random()).replace(".",""),r="[\\x20\\t\\r\\n\\f]",s="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",t=s.replace("w","w#"),u="([*^$|!~]?=)",v="\\["+r+"*("+s+")"+r+"*(?:"+u+r+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+t+")|)|)"+r+"*\\]",w=":("+s+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",x=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",y=r+"*([\\x20\\t\\r\\n\\f>+~])"+r+"*",z="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+v+"|"+w.replace(2,7)+"|[^\\\\(),])+",A=new RegExp("^"+r+"+|((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),B=new RegExp("^"+y),C=new RegExp(z+"?(?="+r+"*,|$)","g"),D=new RegExp("^(?:(?!,)(?:(?:^|,)"+r+"*"+z+")*?|"+r+"*(.*?))(\\)|$)"),E=new RegExp(z.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+y,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/[\x20\t\r\n\f]*[+~]/,H=/:not\($/,I=/h\d/i,J=/input|select|textarea|button/i,K=/\\(?!\\)/g,L={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),NAME:new RegExp("^\\[name=['\"]?("+s+")['\"]?\\]"),TAG:new RegExp("^("+s.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+v),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),POS:new RegExp(x,"ig"),needsContext:new RegExp("^"+r+"*[>+~]|"+x,"i")},M={},N=[],O={},P=[],Q=function(a){return a.sizzleFilter=!0,a},R=function(a){return function(b){return b.nodeName.toLowerCase()==="input"&&b.type===a}},S=function(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}},T=function(a){var b=!1,c=h.createElement("div");try{b=a(c)}catch(d){}return c=null,b},U=T(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),V=T(function(a){a.id=q+0,a.innerHTML="
",i.insertBefore(a,i.firstChild);var b=h.getElementsByName&&h.getElementsByName(q).length===2+h.getElementsByName(q+0).length;return g=!h.getElementById(q),i.removeChild(a),b}),W=T(function(a){return a.appendChild(h.createComment("")),a.getElementsByTagName("*").length===0}),X=T(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==j&&a.firstChild.getAttribute("href")==="#"}),Y=T(function(a){return a.innerHTML="",!a.getElementsByClassName||a.getElementsByClassName("e").length===0?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length!==1)}),Z=function(a,b,c,d){c=c||[],b=b||h;var e,f,g,i,j=b.nodeType;if(j!==1&&j!==9)return[];if(!a||typeof a!="string")return c;g=ba(b);if(!g&&!d)if(e=F.exec(a))if(i=e[1]){if(j===9){f=b.getElementById(i);if(!f||!f.parentNode)return c;if(f.id===i)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(i))&&bb(b,f)&&f.id===i)return c.push(f),c}else{if(e[2])return o.apply(c,n.call(b.getElementsByTagName(a),0)),c;if((i=e[3])&&Y&&b.getElementsByClassName)return o.apply(c,n.call(b.getElementsByClassName(i),0)),c}return bm(a,b,c,d,g)},$=Z.selectors={cacheLength:50,match:L,order:["ID","TAG"],attrHandle:{},createPseudo:Q,find:{ID:g?function(a,b,c){if(typeof b.getElementById!==j&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==j&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==j&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:W?function(a,b){if(typeof b.getElementsByTagName!==j)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(K,""),a[3]=(a[4]||a[5]||"").replace(K,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||Z.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&Z.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return L.CHILD.test(a[0])?null:(c&&(b=D.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:g?function(a){return a=a.replace(K,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(K,""),function(b){var c=typeof b.getAttributeNode!==j&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(K,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=M[a];return b||(b=M[a]=new RegExp("(^|"+r+")"+a+"("+r+"|$)"),N.push(a),N.length>$.cacheLength&&delete M[N.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==j&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=Z.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return Z.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=m++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[q]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[q]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=$.pseudos[a]||$.pseudos[a.toLowerCase()];return e||Z.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:Q(function(a,b,c){var d=bl(a.replace(A,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!$.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:Q(function(a){return function(b){return(b.textContent||b.innerText||bc(b)).indexOf(a)>-1}}),has:Q(function(a){return function(b){return Z(a,b).length>0}}),header:function(a){return I.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:R("radio"),checkbox:R("checkbox"),file:R("file"),password:R("password"),image:R("image"),submit:S("submit"),reset:S("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return J.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e$.cacheLength&&delete O[P.shift()],g};Z.matches=function(a,b){return Z(a,null,null,b)},Z.matchesSelector=function(a,b){return Z(b,null,null,[a]).length>0};var bm=function(a,b,e,f,g){a=a.replace(A,"$1");var h,i,j,k,l,m,p,q,r,s=a.match(C),t=a.match(E),u=b.nodeType;if(L.POS.test(a))return bf(a,b,e,f,s);if(f)h=n.call(f,0);else if(s&&s.length===1){if(t.length>1&&u===9&&!g&&(s=L.ID.exec(t[0]))){b=$.find.ID(s[1],b,g)[0];if(!b)return e;a=a.slice(t.shift().length)}q=(s=G.exec(t[0]))&&!s.index&&b.parentNode||b,r=t.pop(),m=r.split(":not")[0];for(j=0,k=$.order.length;j",a.querySelectorAll("[selected]").length||e.push("\\["+r+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="

",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+r+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bm=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return o.apply(f,n.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d.getAttribute("id"),k=j||q,l=G.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return o.apply(f,n.call(l.querySelectorAll(a.replace(C,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b(a,d,f,g,h)},g&&(T(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push($.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),Z.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!ba(b)&&!f.test(c)&&(!e||!e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&b.document.nodeType!==11)return h}catch(i){}return Z(c,null,null,[b]).length>0})}(),Z.attr=p.attr,p.find=Z,p.expr=Z.selectors,p.expr[":"]=p.expr.pseudos,p.unique=Z.uniqueSort,p.text=Z.getText,p.isXMLDoc=Z.isXML,p.contains=Z.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X
","
"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(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){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=0,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(g=b===e&&bA;(h=a[s])!=null;s++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{g=g||bk(b),l=l||g.appendChild(b.createElement("div")),h=h.replace(bo,"<$1>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(f=n.length-1;f>=0;--f)p.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l=g.lastChild}h.nodeType?t.push(h):t=p.merge(t,h)}l&&(g.removeChild(l),h=l=g=null);if(!p.support.appendChecked)for(s=0;(h=t[s])!=null;s++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(s=0;(h=t[s])!=null;s++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[s+1,0].concat(r)),s+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^margin/,bO=new RegExp("^("+q+")(.*)$","i"),bP=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bQ=new RegExp("^([-+])=("+q+")","i"),bR={},bS={position:"absolute",visibility:"hidden",display:"block"},bT={letterSpacing:0,fontWeight:400,lineHeight:1},bU=["Top","Right","Bottom","Left"],bV=["Webkit","O","Moz","ms"],bW=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return bZ(this,!0)},hide:function(){return bZ(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bW.apply(this,arguments):this.each(function(){(c?a:bY(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bX(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bQ.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bX(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bT&&(f=bT[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],c===""&&!p.contains(a.ownerDocument.documentElement,a)&&(c=p.style(a,b)),bP.test(c)&&bN.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bP.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0||bH(a,"display")!=="none"?ca(a,b,d):p.swap(a,bS,function(){return ca(a,b,d)})},set:function(a,c,d){return b$(a,c,d?b_(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bP.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bU[d]+b]=e[d]||e[d-2]||e[0];return f}},bN.test(a)||(p.cssHooks[a+b].set=b$)});var cc=/%20/g,cd=/\[\]$/,ce=/\r?\n/g,cf=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,cg=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||cg.test(this.nodeName)||cf.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(ce,"\r\n")}}):{name:b.name,value:c.replace(ce,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ch(d,a[d],c,f);return e.join("&").replace(cc,"+")};var ci,cj,ck=/#.*$/,cl=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cm=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,cn=/^(?:GET|HEAD)$/,co=/^\/\//,cp=/\?/,cq=/)<[^<]*)*<\/script>/gi,cr=/([?&])_=[^&]*/,cs=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ct=p.fn.load,cu={},cv={},cw=["*/"]+["*"];try{ci=f.href}catch(cx){ci=e.createElement("a"),ci.href="",ci=ci.href}cj=cs.exec(ci.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&ct)return ct.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("
").append(a.replace(cq,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cA(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cA(a,b),a},ajaxSettings:{url:ci,isLocal:cm.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cw},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cy(cu),ajaxTransport:cy(cv),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cB(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cC(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=""+(c||y),k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cl.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(ck,"").replace(co,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=cs.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]==cj[1]&&i[2]==cj[2]&&(i[3]||(i[1]==="http:"?80:443))==(cj[3]||(cj[1]==="http:"?80:443)))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cz(cu,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!cn.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cp.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cr,"$1_="+z);l.url=A+(A===l.url?(cp.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cw+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cz(cv,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cD=[],cE=/\?/,cF=/(=)\?(?=&|$)|\?\?/,cG=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cD.pop()||p.expando+"_"+cG++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cF.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cF.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cF,"$1"+f):m?c.data=i.replace(cF,"$1"+f):k&&(c.url+=(cE.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cD.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cH,cI=a.ActiveXObject?function(){for(var a in cH)cH[a](0,1)}:!1,cJ=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cK()||cL()}:cK,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cI&&delete cH[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cJ,cI&&(cH||(cH={},p(a).unload(cI)),cH[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cM,cN,cO=/^(?:toggle|show|hide)$/,cP=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cQ=/queueHooks$/,cR=[cX],cS={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=cP.exec(b),h=f.cur(),i=+h||0,j=1;if(g){c=+g[2],d=g[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&i){i=p.css(f.elem,a,!0)||c||1;do e=j=j||".5",i=i/j,p.style(f.elem,a,i+d),j=f.cur()/h;while(j!==1&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};p.Animation=p.extend(cV,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c$.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c$.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=c_(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); --------------------------------------------------------------------------------