├── .gitattributes ├── .gitignore ├── LICENSE.md ├── README.md ├── css ├── foundation.css ├── foundation.min.css └── normalize.css ├── img ├── bg-noise-orange.png ├── header-bg.png ├── logo.png └── logo.psd ├── index.html ├── js ├── foundation.min.js ├── foundation │ ├── foundation.alerts.js │ ├── foundation.clearing.js │ ├── foundation.cookie.js │ ├── foundation.dropdown.js │ ├── foundation.forms.js │ ├── foundation.joyride.js │ ├── foundation.js │ ├── foundation.magellan.js │ ├── foundation.orbit.js │ ├── foundation.placeholder.js │ ├── foundation.reveal.js │ ├── foundation.section.js │ ├── foundation.tooltips.js │ └── foundation.topbar.js ├── jquery-latest.min.js └── vendor │ ├── custom.modernizr.js │ ├── jquery.js │ └── zepto.js └── screenshot ├── 1.png ├── 2.png ├── 3.png └── 4.png /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Random Name Picker 2 | 3 | ![LICENSE](https://img.shields.io/github/license/heiswayi/random-name-picker) 4 | 5 | This is a simple HTML tool written with JavaScript to randomly pick a name from a list. The name that has been picked is removable from the list. This is useful for indoor event/party. 6 | 7 | [**Preview**](http://heiswayi.github.io/random-name-picker) 8 | 9 | ## Screenshots 10 | 11 | ![screenshot1](/screenshot/1.png "Intro") 12 | 13 | ![screenshot2](/screenshot/2.png "Name List") 14 | 15 | ![screenshot3](/screenshot/3.png "Save & Update") 16 | 17 | ![screenshot4](/screenshot/4.png "Run") 18 | -------------------------------------------------------------------------------- /css/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v2.1.0 | MIT License | git.io/normalize */ 2 | 3 | /* ========================================================================== 4 | HTML5 display definitions 5 | ========================================================================== */ 6 | 7 | /** 8 | * Correct `block` display not defined in IE 8/9. 9 | */ 10 | 11 | article, 12 | aside, 13 | details, 14 | figcaption, 15 | figure, 16 | footer, 17 | header, 18 | hgroup, 19 | main, 20 | nav, 21 | section, 22 | summary { 23 | display: block; 24 | } 25 | 26 | /** 27 | * Correct `inline-block` display not defined in IE 8/9. 28 | */ 29 | 30 | audio, 31 | canvas, 32 | video { 33 | display: inline-block; 34 | } 35 | 36 | /** 37 | * Prevent modern browsers from displaying `audio` without controls. 38 | * Remove excess height in iOS 5 devices. 39 | */ 40 | 41 | audio:not([controls]) { 42 | display: none; 43 | height: 0; 44 | } 45 | 46 | /** 47 | * Address styling not present in IE 8/9. 48 | */ 49 | 50 | [hidden] { 51 | display: none; 52 | } 53 | 54 | /* ========================================================================== 55 | Base 56 | ========================================================================== */ 57 | 58 | /** 59 | * 1. Set default font family to sans-serif. 60 | * 2. Prevent iOS text size adjust after orientation change, without disabling 61 | * user zoom. 62 | */ 63 | 64 | html { 65 | font-family: sans-serif; /* 1 */ 66 | -webkit-text-size-adjust: 100%; /* 2 */ 67 | -ms-text-size-adjust: 100%; /* 2 */ 68 | } 69 | 70 | /** 71 | * Remove default margin. 72 | */ 73 | 74 | body { 75 | margin: 0; 76 | } 77 | 78 | /* ========================================================================== 79 | Links 80 | ========================================================================== */ 81 | 82 | /** 83 | * Address `outline` inconsistency between Chrome and other browsers. 84 | */ 85 | 86 | a:focus { 87 | outline: thin dotted; 88 | } 89 | 90 | /** 91 | * Improve readability when focused and also mouse hovered in all browsers. 92 | */ 93 | 94 | a:active, 95 | a:hover { 96 | outline: 0; 97 | } 98 | 99 | /* ========================================================================== 100 | Typography 101 | ========================================================================== */ 102 | 103 | /** 104 | * Address variable `h1` font-size and margin within `section` and `article` 105 | * contexts in Firefox 4+, Safari 5, and Chrome. 106 | */ 107 | 108 | h1 { 109 | font-size: 2em; 110 | margin: 0.67em 0; 111 | } 112 | 113 | /** 114 | * Address styling not present in IE 8/9, Safari 5, and Chrome. 115 | */ 116 | 117 | abbr[title] { 118 | border-bottom: 1px dotted; 119 | } 120 | 121 | /** 122 | * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. 123 | */ 124 | 125 | b, 126 | strong { 127 | font-weight: bold; 128 | } 129 | 130 | /** 131 | * Address styling not present in Safari 5 and Chrome. 132 | */ 133 | 134 | dfn { 135 | font-style: italic; 136 | } 137 | 138 | /** 139 | * Address differences between Firefox and other browsers. 140 | */ 141 | 142 | hr { 143 | -moz-box-sizing: content-box; 144 | box-sizing: content-box; 145 | height: 0; 146 | } 147 | 148 | /** 149 | * Address styling not present in IE 8/9. 150 | */ 151 | 152 | mark { 153 | background: #ff0; 154 | color: #000; 155 | } 156 | 157 | /** 158 | * Correct font family set oddly in Safari 5 and Chrome. 159 | */ 160 | 161 | code, 162 | kbd, 163 | pre, 164 | samp { 165 | font-family: monospace, serif; 166 | font-size: 1em; 167 | } 168 | 169 | /** 170 | * Improve readability of pre-formatted text in all browsers. 171 | */ 172 | 173 | pre { 174 | white-space: pre-wrap; 175 | } 176 | 177 | /** 178 | * Set consistent quote types. 179 | */ 180 | 181 | q { 182 | quotes: "\201C" "\201D" "\2018" "\2019"; 183 | } 184 | 185 | /** 186 | * Address inconsistent and variable font size in all browsers. 187 | */ 188 | 189 | small { 190 | font-size: 80%; 191 | } 192 | 193 | /** 194 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 195 | */ 196 | 197 | sub, 198 | sup { 199 | font-size: 75%; 200 | line-height: 0; 201 | position: relative; 202 | vertical-align: baseline; 203 | } 204 | 205 | sup { 206 | top: -0.5em; 207 | } 208 | 209 | sub { 210 | bottom: -0.25em; 211 | } 212 | 213 | /* ========================================================================== 214 | Embedded content 215 | ========================================================================== */ 216 | 217 | /** 218 | * Remove border when inside `a` element in IE 8/9. 219 | */ 220 | 221 | img { 222 | border: 0; 223 | } 224 | 225 | /** 226 | * Correct overflow displayed oddly in IE 9. 227 | */ 228 | 229 | svg:not(:root) { 230 | overflow: hidden; 231 | } 232 | 233 | /* ========================================================================== 234 | Figures 235 | ========================================================================== */ 236 | 237 | /** 238 | * Address margin not present in IE 8/9 and Safari 5. 239 | */ 240 | 241 | figure { 242 | margin: 0; 243 | } 244 | 245 | /* ========================================================================== 246 | Forms 247 | ========================================================================== */ 248 | 249 | /** 250 | * Define consistent border, margin, and padding. 251 | */ 252 | 253 | fieldset { 254 | border: 1px solid #c0c0c0; 255 | margin: 0 2px; 256 | padding: 0.35em 0.625em 0.75em; 257 | } 258 | 259 | /** 260 | * 1. Correct `color` not being inherited in IE 8/9. 261 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 262 | */ 263 | 264 | legend { 265 | border: 0; /* 1 */ 266 | padding: 0; /* 2 */ 267 | } 268 | 269 | /** 270 | * 1. Correct font family not being inherited in all browsers. 271 | * 2. Correct font size not being inherited in all browsers. 272 | * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. 273 | */ 274 | 275 | button, 276 | input, 277 | select, 278 | textarea { 279 | font-family: inherit; /* 1 */ 280 | font-size: 100%; /* 2 */ 281 | margin: 0; /* 3 */ 282 | } 283 | 284 | /** 285 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 286 | * the UA stylesheet. 287 | */ 288 | 289 | button, 290 | input { 291 | line-height: normal; 292 | } 293 | 294 | /** 295 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 296 | * All other form control elements do not inherit `text-transform` values. 297 | * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+. 298 | * Correct `select` style inheritance in Firefox 4+ and Opera. 299 | */ 300 | 301 | button, 302 | select { 303 | text-transform: none; 304 | } 305 | 306 | /** 307 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 308 | * and `video` controls. 309 | * 2. Correct inability to style clickable `input` types in iOS. 310 | * 3. Improve usability and consistency of cursor style between image-type 311 | * `input` and others. 312 | */ 313 | 314 | button, 315 | html input[type="button"], /* 1 */ 316 | input[type="reset"], 317 | input[type="submit"] { 318 | -webkit-appearance: button; /* 2 */ 319 | cursor: pointer; /* 3 */ 320 | } 321 | 322 | /** 323 | * Re-set default cursor for disabled elements. 324 | */ 325 | 326 | button[disabled], 327 | html input[disabled] { 328 | cursor: default; 329 | } 330 | 331 | /** 332 | * 1. Address box sizing set to `content-box` in IE 8/9. 333 | * 2. Remove excess padding in IE 8/9. 334 | */ 335 | 336 | input[type="checkbox"], 337 | input[type="radio"] { 338 | box-sizing: border-box; /* 1 */ 339 | padding: 0; /* 2 */ 340 | } 341 | 342 | /** 343 | * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. 344 | * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome 345 | * (include `-moz` to future-proof). 346 | */ 347 | 348 | input[type="search"] { 349 | -webkit-appearance: textfield; /* 1 */ 350 | -moz-box-sizing: content-box; 351 | -webkit-box-sizing: content-box; /* 2 */ 352 | box-sizing: content-box; 353 | } 354 | 355 | /** 356 | * Remove inner padding and search cancel button in Safari 5 and Chrome 357 | * on OS X. 358 | */ 359 | 360 | input[type="search"]::-webkit-search-cancel-button, 361 | input[type="search"]::-webkit-search-decoration { 362 | -webkit-appearance: none; 363 | } 364 | 365 | /** 366 | * Remove inner padding and border in Firefox 4+. 367 | */ 368 | 369 | button::-moz-focus-inner, 370 | input::-moz-focus-inner { 371 | border: 0; 372 | padding: 0; 373 | } 374 | 375 | /** 376 | * 1. Remove default vertical scrollbar in IE 8/9. 377 | * 2. Improve readability and alignment in all browsers. 378 | */ 379 | 380 | textarea { 381 | overflow: auto; /* 1 */ 382 | vertical-align: top; /* 2 */ 383 | } 384 | 385 | /* ========================================================================== 386 | Tables 387 | ========================================================================== */ 388 | 389 | /** 390 | * Remove most spacing between table cells. 391 | */ 392 | 393 | table { 394 | border-collapse: collapse; 395 | border-spacing: 0; 396 | } 397 | -------------------------------------------------------------------------------- /img/bg-noise-orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heiswayi/random-name-picker/9a15f71bbb6ebce064ef540ede1b062d591b9479/img/bg-noise-orange.png -------------------------------------------------------------------------------- /img/header-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heiswayi/random-name-picker/9a15f71bbb6ebce064ef540ede1b062d591b9479/img/header-bg.png -------------------------------------------------------------------------------- /img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heiswayi/random-name-picker/9a15f71bbb6ebce064ef540ede1b062d591b9479/img/logo.png -------------------------------------------------------------------------------- /img/logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/heiswayi/random-name-picker/9a15f71bbb6ebce064ef540ede1b062d591b9479/img/logo.psd -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Random Name Picker 9 | 10 | 11 | 12 | 13 | 14 | 15 | 62 | 63 | 64 | 65 | 66 |
67 |
68 |
69 |
    {/* Adjusted for 5 buttons */} 70 |
  • Reset
  • 71 |
  • 72 |
  • 73 |
  • 74 |
  • 75 |
76 |
77 |
78 |
79 | 80 |
81 |
82 |

Let's see who is The Lucky One?

83 | 84 |
85 | 86 |
87 |
88 |
89 | 90 |
91 | 92 | 93 |
94 |
95 | 96 | 101 | 102 | 103 | 104 | 105 | 407 | 408 | 409 | 410 | -------------------------------------------------------------------------------- /js/foundation.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Foundation Responsive Library 3 | * http://foundation.zurb.com 4 | * Copyright 2013, ZURB 5 | * Free to use under the MIT license. 6 | * http://www.opensource.org/licenses/mit-license.php 7 | */ 8 | /*jslint unparam: true, browser: true, indent: 2 */ 9 | (function(){Array.prototype.filter||(Array.prototype.filter=function(e){"use strict";if(this==null)throw new TypeError;var t=Object(this),n=t.length>>>0;if(typeof e!="function")try{throw new TypeError}catch(r){return}var i=[],s=arguments[1];for(var o=0;o0)for(var f=o.length-1;f>=0;f--)a.push(this.init_lib(o[f],u))}else for(var l in this.libs)a.push(this.init_lib(l,u));return typeof t=="function"&&u.unshift(t),this.response_obj(a,u)},response_obj:function(e,t){for(var n in t)if(typeof t[n]=="function")return t[n]({errors:e.filter(function(e){if(typeof e=="string")return e})});return e},init_lib:function(e,t){return this.trap(function(){if(this.libs.hasOwnProperty(e))return this.patch(this.libs[e]),this.libs[e].init.apply(this.libs[e],t)}.bind(this),e)},trap:function(e,t){if(!this.nc)try{return e()}catch(n){return this.error({name:t,message:"could not be initialized",more:n.name+" "+n.message})}return e()},patch:function(e){this.fix_outer(e)},inherit:function(e,t){var n=t.split(" ");for(var r=n.length-1;r>=0;r--)this.lib_methods.hasOwnProperty(n[r])&&(this.libs[e.name][n[r]]=this.lib_methods[n[r]])},libs:{},lib_methods:{set_data:function(e,t){var n=this.name+ +(new Date);Foundation.cache[n]=t,e.attr("data-"+this.name+"-id",n)},get_data:function(e){return Foundation.cache[e.attr("data-"+this.name+"-id")]},remove_data:function(e){e?(delete Foundation.cache[e.attr("data-"+this.name+"-id")],e.attr("data-"+this.name+"-id","")):$("[data-"+this.name+"-id]").each(function(){delete Foundation.cache[$(this).attr("data-"+this.name+"-id")],$(this).attr("data-"+this.name+"-id","")})},throttle:function(e,t){var n=null;return function(){var r=this,i=arguments;clearTimeout(n),n=setTimeout(function(){e.apply(r,i)},t)}},data_options:function(e){function o(e){return typeof e=="string"?$.trim(e):e}var t={},n,r,i=(e.attr("data-options")||":").split(";"),s=i.length;for(n=s-1;n>=0;n--)r=i[n].split(":"),/true/i.test(r[1])&&(r[1]=!0),/false/i.test(r[1])&&(r[1]=!1),r.length===2&&(t[o(r[0])]=o(r[1]));return t},delay:function(e,t){return setTimeout(e,t)},scrollTo:function(t,n,r){if(r<0)return;var i=n-$(e).scrollTop(),s=i/r*10;this.scrollToTimerCache=setTimeout(function(){isNaN(parseInt(s,10))||(e.scrollTo(0,$(e).scrollTop()+s),this.scrollTo(t,n,r-10))}.bind(this),10)},scrollLeft:function(e){if(!e.length)return;return"scrollLeft"in e[0]?e[0].scrollLeft:e[0].pageXOffset},empty:function(e){if(e.length&&e.length>0)return!1;if(e.length&&e.length===0)return!0;for(var t in e)if(hasOwnProperty.call(e,t))return!1;return!0}},fix_outer:function(e){e.outerHeight=function(e,t){return typeof Zepto=="function"?e.height():typeof t!="undefined"?e.outerHeight(t):e.outerHeight()},e.outerWidth=function(e){return typeof Zepto=="function"?e.width():typeof bool!="undefined"?e.outerWidth(bool):e.outerWidth()}},error:function(e){return e.name+" "+e.message+"; "+e.more},off:function(){return $(this.scope).off(".fndtn"),$(e).off(".fndtn"),!0},zj:function(){try{return Zepto}catch(e){return jQuery}}()},$.fn.foundation=function(){var e=Array.prototype.slice.call(arguments,0);return this.each(function(){return Foundation.init.apply(Foundation,[this].concat(e)),this})}}(this,this.document),function(e,t,n,r){"use strict";Foundation.libs.dropdown={name:"dropdown",version:"4.0.0",settings:{activeClass:"open"},init:function(t,n,r){return this.scope=t||this.scope,Foundation.inherit(this,"throttle"),typeof n=="object"&&e.extend(!0,this.settings,n),typeof n!="string"?(this.settings.init||this.events(),this.settings.init):this[n].call(this,r)},events:function(){var n=this;e(this.scope).on("click.fndtn.dropdown","[data-dropdown]",function(t){t.preventDefault(),t.stopPropagation(),n.toggle(e(this))}),e("*, html, body").on("click.fndtn.dropdown",function(t){e(t.target).data("dropdown")||e("[data-dropdown-content]").css("left","-99999px").removeClass(n.settings.activeClass)}),e("[data-dropdown-content]").on("click.fndtn.dropdown",function(e){e.stopPropagation()}),e(t).on("resize.fndtn.dropdown",n.throttle(function(){n.resize.call(n)},50)).trigger("resize"),this.settings.init=!0},toggle:function(t,n){var r=e("#"+t.data("dropdown"));e("[data-dropdown-content]").not(r).css("left","-99999px"),r.hasClass(this.settings.activeClass)?r.css("left","-99999px").removeClass(this.settings.activeClass):this.css(r.addClass(this.settings.activeClass),t)},resize:function(){var t=e("[data-dropdown-content].open"),n=e("[data-dropdown='"+t.attr("id")+"']");t.length&&n.length&&this.css(t,n)},css:function(e,t){var n=t.offset();return this.small()?e.css({position:"absolute",width:"95%",left:"2.5%","max-width":"none",top:n.top+this.outerHeight(t)}):e.attr("style","").css({position:"absolute",top:n.top+this.outerHeight(t),left:n.left}),e},small:function(){return e(t).width()<768||e("html").hasClass("lt-ie9")},off:function(){e(this.scope).off(".fndtn.dropdown"),e("html, body").off(".fndtn.dropdown"),e(t).off(".fndtn.dropdown"),e("[data-dropdown-content]").off(".fndtn.dropdown"),this.settings.init=!1}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.alerts={name:"alerts",version:"4.0.0",settings:{speed:300,callback:function(){}},init:function(t,n,r){return this.scope=t||this.scope,typeof n=="object"&&e.extend(!0,this.settings,n),typeof n!="string"?(this.settings.init||this.events(),this.settings.init):this[n].call(this,r)},events:function(){var t=this;e(this.scope).on("click.fndtn.alerts","[data-alert] a.close",function(n){n.preventDefault(),e(this).closest("[data-alert]").fadeOut(t.speed,function(){e(this).remove(),t.settings.callback()})}),this.settings.init=!0},off:function(){e(this.scope).off(".fndtn.alerts")}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.clearing={name:"clearing",version:"4.0.0",settings:{templates:{viewing:'×'},close_selectors:".clearing-close",init:!1,locked:!1},init:function(t,n,r){return this.scope=this.scope||t,Foundation.inherit(this,"set_data get_data remove_data throttle"),typeof n=="object"&&(r=e.extend(!0,this.settings,n)),typeof n!="string"?(e(this.scope).find("ul[data-clearing]").each(function(){var t=Foundation.libs.clearing,n=e(this),r=r||{},i=t.get_data(n);i||(r.$parent=n.parent(),t.set_data(n,e.extend(!0,t.settings,r)),t.assemble(n.find("li")),t.settings.init||t.events().swipe_events())}),this.settings.init):this[n].call(this,r)},events:function(){var n=this;return e(this.scope).on("click.fndtn.clearing","ul[data-clearing] li",function(t,r,i){var r=r||e(this),i=i||r,s=n.get_data(r.parent());t.preventDefault(),s||n.init(),n.open(e(t.target),r,i),n.update_paddles(i)}).on("click.fndtn.clearing",".clearing-main-right",function(e){this.nav(e,"next")}.bind(this)).on("click.fndtn.clearing",".clearing-main-left",function(e){this.nav(e,"prev")}.bind(this)).on("click.fndtn.clearing",this.settings.close_selectors,function(e){Foundation.libs.clearing.close(e,this)}).on("keydown.fndtn.clearing",function(e){this.keydown(e)}.bind(this)),e(t).on("resize.fndtn.clearing",function(e){this.resize()}.bind(this)),this.settings.init=!0,this},swipe_events:function(){var t=this;e(this.scope).on("touchstart.fndtn.clearing",".visible-img",function(t){var n={start_page_x:t.touches[0].pageX,start_page_y:t.touches[0].pageY,start_time:(new Date).getTime(),delta_x:0,is_scrolling:r};e(this).data("swipe-transition",n),t.stopPropagation()}).on("touchmove.fndtn.clearing",".visible-img",function(n){if(n.touches.length>1||n.scale&&n.scale!==1)return;var r=e(this).data("swipe-transition");typeof r=="undefined"&&(r={}),r.delta_x=n.touches[0].pageX-r.start_page_x,typeof r.is_scrolling=="undefined"&&(r.is_scrolling=!!(r.is_scrolling||Math.abs(r.delta_x)'+this.outerHTML(r[0])+"",viewing:n.templates.viewing},s='
'+i.viewing+i.grid+"
";return n.$parent.append(s)},open:function(e,t,n){var r=n.closest(".clearing-assembled"),i=r.find("div").first(),s=i.find(".visible-img"),o=s.find("img").not(e);this.locked()||(o.attr("src",this.load(e)),this.loaded(o,function(){r.addClass("clearing-blackout"),i.addClass("clearing-container"),s.show(),this.fix_height(n).caption(s.find(".clearing-caption"),e).center(o).shift(t,n,function(){n.siblings().removeClass("visible"),n.addClass("visible")})}.bind(this)))},close:function(t,n){t.preventDefault();var r=function(e){return/blackout/.test(e.selector)?e:e.closest(".clearing-blackout")}(e(n)),i,s;return n===t.target&&r&&(i=r.find("div").first(),s=i.find(".visible-img"),this.settings.prev_index=0,r.find("ul[data-clearing]").attr("style","").closest(".clearing-blackout").removeClass("clearing-blackout"),i.removeClass("clearing-container"),s.hide()),!1},keydown:function(t){var n=e(".clearing-blackout").find("ul[data-clearing]");t.which===39&&this.go(n,"next"),t.which===37&&this.go(n,"prev"),t.which===27&&e("a.clearing-close").trigger("click")},nav:function(t,n){var r=e(".clearing-blackout").find("ul[data-clearing]");t.preventDefault(),this.go(r,n)},resize:function(){var t=e(".clearing-blackout .visible-img").find("img");t.length&&this.center(t)},fix_height:function(t){var n=t.parent().children(),r=this;return n.each(function(){var t=e(this),n=t.find("img");t.height()>r.outerHeight(n)&&t.addClass("fix-height")}).closest("ul").width(n.length*100+"%"),this},update_paddles:function(e){var t=e.closest(".carousel").siblings(".visible-img");e.next().length?t.find(".clearing-main-right").removeClass("disabled"):t.find(".clearing-main-right").addClass("disabled"),e.prev().length?t.find(".clearing-main-left").removeClass("disabled"):t.find(".clearing-main-left").addClass("disabled")},center:function(e){return e.css({marginLeft:-(this.outerWidth(e)/2),marginTop:-(this.outerHeight(e)/2)}),this},load:function(e){var t=e.parent().attr("href");return this.preload(e),t?t:e.attr("src")},preload:function(e){this.img(e.closest("li").next()).img(e.closest("li").prev())},loaded:function(e,t){function n(){t()}function r(){this.one("load",n);if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var e=this.attr("src"),t=e.match(/\?/)?"&":"?";t+="random="+(new Date).getTime(),this.attr("src",e+t)}}if(!e.attr("src")){n();return}this.complete||this.readyState===4?n():r.call(e)},img:function(e){if(e.length){var t=new Image,n=e.find("a");n.length?t.src=n.attr("href"):t.src=e.find("img").attr("src")}return this},caption:function(e,t){var n=t.data("caption");return n?e.text(n).show():e.text("").hide(),this},go:function(e,t){var n=e.find(".visible"),r=n[t]();r.length&&r.find("img").trigger("click",[n,r])},shift:function(e,t,n){var r=t.parent(),i=this.settings.prev_index||t.index(),s=this.direction(r,e,t),o=parseInt(r.css("left"),10),u=this.outerWidth(t),a;t.index()!==i&&!/skip/.test(s)?/left/.test(s)?(this.lock(),r.animate({left:o+u},300,this.unlock())):/right/.test(s)&&(this.lock(),r.animate({left:o-u},300,this.unlock())):/skip/.test(s)&&(a=t.index()-this.settings.up_count,this.lock(),a>0?r.animate({left:-(a*u)},300,this.unlock()):r.animate({left:0},300,this.unlock())),n()},direction:function(t,n,r){var i=t.find("li"),s=this.outerWidth(i)+this.outerWidth(i)/4,o=Math.floor(this.outerWidth(e(".clearing-container"))/s)-1,u=i.index(r),a;return this.settings.up_count=o,this.adjacent(this.settings.prev_index,u)?u>o&&u>this.settings.prev_index?a="right":u>o-1&&u<=this.settings.prev_index?a="left":a=!1:a="skip",this.settings.prev_index=u,a},adjacent:function(e,t){for(var n=t+1;n>=t-1;n--)if(n===e)return!0;return!1},lock:function(){this.settings.locked=!0},unlock:function(){this.settings.locked=!1},locked:function(){return this.settings.locked},outerHTML:function(e){return e.outerHTML||(new XMLSerializer).serializeToString(e)},off:function(){e(this.scope).off(".fndtn.clearing"),e(t).off(".fndtn.clearing"),this.remove_data(),this.settings.init=!1}}}(Foundation.zj,this,this.document),function(e,t,n){function f(e){var t={},r=/^jQuery\d+$/;return n.each(e.attributes,function(e,n){n.specified&&!r.test(n.name)&&(t[n.name]=n.value)}),t}function l(e,r){var i=this,s=n(i);if(i.value==s.attr("placeholder")&&s.hasClass("placeholder"))if(s.data("placeholder-password")){s=s.hide().next().show().attr("id",s.removeAttr("id").data("placeholder-id"));if(e===!0)return s[0].value=r;s.focus()}else i.value="",s.removeClass("placeholder"),i==t.activeElement&&i.select()}function c(){var e,t=this,r=n(t),i=r,s=this.id;if(t.value==""){if(t.type=="password"){if(!r.data("placeholder-textinput")){try{e=r.clone().attr({type:"text"})}catch(o){e=n("").attr(n.extend(f(this),{type:"text"}))}e.removeAttr("name").data({"placeholder-password":!0,"placeholder-id":s}).bind("focus.placeholder",l),r.data({"placeholder-textinput":e,"placeholder-id":s}).before(e)}r=r.removeAttr("id").hide().prev().attr("id",s).show()}r.addClass("placeholder"),r[0].value=r.attr("placeholder")}else r.removeClass("placeholder")}var r="placeholder"in t.createElement("input"),i="placeholder"in t.createElement("textarea"),s=n.fn,o=n.valHooks,u,a;r&&i?(a=s.placeholder=function(){return this},a.input=a.textarea=!0):(a=s.placeholder=function(){var e=this;return e.filter((r?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":l,"blur.placeholder":c}).data("placeholder-enabled",!0).trigger("blur.placeholder"),e},a.input=r,a.textarea=i,u={get:function(e){var t=n(e);return t.data("placeholder-enabled")&&t.hasClass("placeholder")?"":e.value},set:function(e,r){var i=n(e);return i.data("placeholder-enabled")?(r==""?(e.value=r,e!=t.activeElement&&c.call(e)):i.hasClass("placeholder")?l.call(e,!0,r)||(e.value=r):e.value=r,i):e.value=r}},r||(o.input=u),i||(o.textarea=u),n(function(){n(t).delegate("form","submit.placeholder",function(){var e=n(".placeholder",this).each(l);setTimeout(function(){e.each(c)},10)})}),n(e).bind("beforeunload.placeholder",function(){n(".placeholder").each(function(){this.value=""})}))}(this,document,Foundation.zj),function(e,t,n,r){"use strict";Foundation.libs.forms={name:"forms",version:"4.0.4",settings:{disable_class:"no-custom"},init:function(t,n,r){return this.scope=t||this.scope,typeof n=="object"&&e.extend(!0,this.settings,n),typeof n!="string"?(this.settings.init||this.events(),this.assemble(),this.settings.init):this[n].call(this,r)},assemble:function(){e('form.custom input[type="radio"]',e(this.scope)).not('[data-customforms="disabled"]').each(this.append_custom_markup),e('form.custom input[type="checkbox"]',e(this.scope)).not('[data-customforms="disabled"]').each(this.append_custom_markup),e("form.custom select",e(this.scope)).not('[data-customforms="disabled"]').each(this.append_custom_select)},events:function(){var t=this;e(this.scope).on("change.fndtn.forms",'form.custom select:not([data-customforms="disabled"])',function(n){t.refresh_custom_select(e(this))}).on("click.fndtn.forms","form.custom label",function(n){var r=e("#"+t.escape(e(this).attr("for"))+':not([data-customforms="disabled"])'),i,s;r.length!==0&&(r.attr("type")==="checkbox"?(n.preventDefault(),i=e(this).find("span.custom.checkbox"),i.length==0&&(i=e(this).next("span.custom.checkbox")),i.length==0&&(i=e(this).prev("span.custom.checkbox")),t.toggle_checkbox(i)):r.attr("type")==="radio"&&(n.preventDefault(),s=e(this).find("span.custom.radio"),s.length==0&&(s=e(this).next("span.custom.radio")),s.length==0&&(s=e(this).prev("span.custom.radio")),t.toggle_radio(s)))}).on("click.fndtn.forms","form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector",function(n){var r=e(this),i=r.closest("div.custom.dropdown"),s=i.prev();i.hasClass("open")||e(t.scope).trigger("click"),n.preventDefault();if(!1===s.is(":disabled"))return i.toggleClass("open"),i.hasClass("open")?e(t.scope).on("click.fndtn.forms.customdropdown",function(){i.removeClass("open"),e(t.scope).off(".fndtn.forms.customdropdown")}):e(t.scope).on(".fndtn.forms.customdropdown"),!1}).on("click.fndtn.forms touchend.fndtn.forms","form.custom div.custom.dropdown li",function(t){var n=e(this),r=n.closest("div.custom.dropdown"),i=r.prev(),s=0;t.preventDefault(),t.stopPropagation();if(!e(this).hasClass("disabled")){e("div.dropdown").not(r).removeClass("open");var o=n.closest("ul").find("li.selected");o.removeClass("selected"),n.addClass("selected"),r.removeClass("open").find("a.current").html(n.html()),n.closest("ul").find("li").each(function(e){n[0]==this&&(s=e)}),i[0].selectedIndex=s,i.data("prevalue",o.html()),i.trigger("change")}}),this.settings.init=!0},append_custom_markup:function(t,n){var r=e(n).hide(),i=r.attr("type"),s=r.next("span.custom."+i);s.length===0&&(s=e('').insertAfter(r)),s.toggleClass("checked",r.is(":checked")),s.toggleClass("disabled",r.is(":disabled"))},append_custom_select:function(t,n){var r=Foundation.libs.forms,i=e(n),s=i.next("div.custom.dropdown"),o=s.find("ul"),u=s.find(".current"),a=s.find(".selector"),f=i.find("option"),l=f.filter(":selected"),c=i.attr("class")?i.attr("class").split(" "):[],h=0,p="",d,v=!1;if(i.hasClass(r.settings.disable_class))return;if(s.length===0){var m=i.hasClass("small")?"small":i.hasClass("medium")?"medium":i.hasClass("large")?"large":i.hasClass("expand")?"expand":"";s=e('
    '),a=s.find(".selector"),o=s.find("ul"),p=f.map(function(){return"
  • "+e(this).html()+"
  • "}).get().join(""),o.append(p),v=s.prepend(''+l.html()+"").find(".current"),i.after(s).hide()}else p=f.map(function(){return"
  • "+e(this).html()+"
  • "}).get().join(""),o.html("").append(p);s.toggleClass("disabled",i.is(":disabled")),d=o.find("li"),f.each(function(t){this.selected&&(d.eq(t).addClass("selected"),v&&v.html(e(this).html())),e(this).is(":disabled")&&d.eq(t).addClass("disabled")});if(!s.is(".small, .medium, .large, .expand")){s.addClass("open");var r=Foundation.libs.forms;r.hidden_fix.adjust(o),h=r.outerWidth(d)>h?r.outerWidth(d):h,Foundation.libs.forms.hidden_fix.reset(),s.removeClass("open")}},refresh_custom_select:function(t){var n=this,r=0,i=t.next(),s=t.find("option");i.find("ul").html(""),s.each(function(){var t=e("
  • "+e(this).html()+"
  • ");i.find("ul").append(t)}),s.each(function(t){this.selected&&(i.find("li").eq(t).addClass("selected"),i.find(".current").html(e(this).html())),e(this).is(":disabled")&&i.find("li").eq(t).addClass("disabled")}),i.removeAttr("style").find("ul").removeAttr("style"),i.find("li").each(function(){i.addClass("open"),n.outerWidth(e(this))>r&&(r=n.outerWidth(e(this))),i.removeClass("open")})},toggle_checkbox:function(e){var t=e.prev(),n=t[0];!1===t.is(":disabled")&&(n.checked=n.checked?!1:!0,e.toggleClass("checked"),t.trigger("change"))},toggle_radio:function(e){var t=e.prev(),n=t.closest("form.custom"),r=t[0];!1===t.is(":disabled")&&(n.find('input[type="radio"][name="'+this.escape(t.attr("name"))+'"]').next().not(e).removeClass("checked"),e.hasClass("checked")||e.toggleClass("checked"),r.checked=e.hasClass("checked"),t.trigger("change"))},escape:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},hidden_fix:{tmp:[],hidden:null,adjust:function(t){var n=this;n.hidden=t.parents().andSelf().filter(":hidden"),n.hidden.each(function(){var t=e(this);n.tmp.push(t.attr("style")),t.css({visibility:"hidden",display:"block"})})},reset:function(){var t=this;t.hidden.each(function(n){var i=e(this),s=t.tmp[n];s===r?i.removeAttr("style"):i.attr("style",s)}),t.tmp=[],t.hidden=null}},off:function(){e(this.scope).off(".fndtn.forms")}}}(Foundation.zj,this,this.document),function(e,t,n){function i(e){return e}function s(e){return decodeURIComponent(e.replace(r," "))}var r=/\+/g,o=e.cookie=function(r,u,a){if(u!==n){a=e.extend({},o.defaults,a),u===null&&(a.expires=-1);if(typeof a.expires=="number"){var f=a.expires,l=a.expires=new Date;l.setDate(l.getDate()+f)}return u=o.json?JSON.stringify(u):String(u),t.cookie=[encodeURIComponent(r),"=",o.raw?u:encodeURIComponent(u),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}var c=o.raw?i:s,h=t.cookie.split("; ");for(var p=0,d=h.length;p×',timer:'
    ',tip:'
    ',wrapper:'
    ',button:''}},settings:{},init:function(t,n,r){return this.scope=t||this.scope,Foundation.inherit(this,"throttle data_options scrollTo scrollLeft delay"),typeof n=="object"?e.extend(!0,this.settings,this.defaults,n):e.extend(!0,this.settings,this.defaults,r),typeof n!="string"?(this.settings.init||this.events(),this.settings.init):this[n].call(this,r)},events:function(){var n=this;e(this.scope).on("click.joyride",".joyride-next-tip, .joyride-modal-bg",function(e){e.preventDefault(),this.settings.$li.next().length<1?this.end():this.settings.timer>0?(clearTimeout(this.settings.automate),this.hide(),this.show(),this.startTimer()):(this.hide(),this.show())}.bind(this)).on("click.joyride",".joyride-close-tip",function(e){e.preventDefault(),this.end()}.bind(this)),e(t).on("resize.fndtn.joyride",n.throttle(function(){e("[data-joyride]").length>0&&n.settings.$next_tip&&(n.is_phone()?n.pos_phone():n.pos_default())},100)),this.settings.init=!0},start:function(){var t=this,n=e(this.scope).find("[data-joyride]"),r=["timer","scrollSpeed","startOffset","tipAnimationFadeSpeed","cookieExpires"],i=r.length;this.settings.init||this.init(),e.extend(!0,this.settings,this.data_options(n)),this.settings.$content_el=n,this.settings.body_offset=e(this.settings.tipContainer).position(),this.settings.$tip_content=this.settings.$content_el.find("> li"),this.settings.paused=!1,this.settings.attempts=0;for(var s=i-1;s>=0;s--)this.settings[r[s]]=parseInt(this.settings[r[s]],10);this.settings.tipLocationPatterns={top:["bottom"],bottom:[],left:["right","top","bottom"],right:["left","top","bottom"]},typeof e.cookie!="function"&&(this.settings.cookieMonster=!1);if(!this.settings.cookieMonster||this.settings.cookieMonster&&e.cookie(this.settings.cookieName)===null)this.settings.$tip_content.each(function(n){t.create({$li:e(this),index:n})}),!this.settings.startTimerOnClick&&this.settings.timer>0?(this.show("init"),this.startTimer()):this.show("init")},resume:function(){this.set_li(),this.show()},tip_template:function(t){var n,r;return t.tip_class=t.tip_class||"",n=e(this.settings.template.tip).addClass(t.tip_class),r=e.trim(e(t.li).html())+this.button_text(t.button_text)+this.settings.template.link+this.timer_instance(t.index),n.append(e(this.settings.template.wrapper)),n.first().attr("data-index",t.index),e(".joyride-content-wrapper",n).append(r),n[0]},timer_instance:function(t){var n;return t===0&&this.settings.startTimerOnClick&&this.settings.timer>0||this.settings.timer===0?n="":n=this.outerHTML(e(this.settings.template.timer)[0]),n},button_text:function(t){return this.settings.nextButton?(t=e.trim(t)||"Next",t=this.outerHTML(e(this.settings.template.button).append(t)[0])):t="",t},create:function(t){var n=t.$li.attr("data-button")||t.$li.attr("data-text"),r=t.$li.attr("class"),i=e(this.tip_template({tip_class:r,index:t.index,button_text:n,li:t.$li}));e(this.settings.tipContainer).append(i)},show:function(t){var n=null;this.settings.$li===r||e.inArray(this.settings.$li.index(),this.settings.pauseAfter)===-1?(this.settings.paused?this.settings.paused=!1:this.set_li(t),this.settings.attempts=0,this.settings.$li.length&&this.settings.$target.length>0?(this.settings.tipSettings=e.extend(!0,this.settings,this.data_options(this.settings.$li)),this.settings.timer=parseInt(this.settings.timer,10),this.settings.tipSettings.tipLocationPattern=this.settings.tipLocationPatterns[this.settings.tipSettings.tipLocation],/body/i.test(this.settings.$target.selector)||this.scroll_to(),this.is_phone()?this.pos_phone(!0):this.pos_default(!0),n=this.settings.$next_tip.find(".joyride-timer-indicator"),/pop/i.test(this.settings.tipAnimation)?(n.width(0),thsi.settings.timer>0?(this.settings.$next_tip.show(),this.delay(function(){n.animate({width:n.parent().width()},this.settings.timer,"linear")}.bind(this),this.settings.tipAnimationFadeSpeed)):this.settings.$next_tip.show()):/fade/i.test(this.settings.tipAnimation)&&(n.width(0),this.settings.timer>0?(this.settings.$next_tip.fadeIn(this.settings.tipAnimationFadeSpeed).show(),this.delay(function(){n.animate({width:n.parent().width()},this.settings.timer,"linear")}.bind(this),this.settings.tipAnimationFadeSpeed)):this.settings.$next_tip.fadeIn(this.settings.tipAnimationFadeSpeed)),this.settings.$current_tip=this.settings.$next_tip):this.settings.$li&&this.settings.$target.length<1?this.show():this.end()):this.settings.paused=!0},is_phone:function(){return Modernizr?Modernizr.mq("only screen and (max-width: 767px)")||e(".lt-ie9").length>0:this.settings.$window.width()<767?!0:!1},hide:function(){this.settings.postStepCallback(this.settings.$li.index(),this.settings.$current_tip),e(".joyride-modal-bg").hide(),this.settings.$current_tip.hide()},set_li:function(e){e?(this.settings.$li=this.settings.$tip_content.eq(this.settings.startOffset),this.set_next_tip(),this.settings.$current_tip=this.settings.$next_tip):(this.settings.$li=this.settings.$li.next(),this.set_next_tip()),this.set_target()},set_next_tip:function(){this.settings.$next_tip=e(".joyride-tip-guide[data-index='"+this.settings.$li.index()+"']"),this.settings.$next_tip.data("closed","")},set_target:function(){var t=this.settings.$li.attr("data-class"),r=this.settings.$li.attr("data-id"),i=function(){return r?e(n.getElementById(r)):t?e("."+t).first():e("body")};this.settings.$target=i()},scroll_to:function(){var n,r;n=e(t).height()/2,r=Math.ceil(this.settings.$target.offset().top-n+this.outerHeight(this.settings.$next_tip)),r>0&&this.scrollTo(e("html, body"),r,this.settings.scrollSpeed)},paused:function(){return e.inArray(this.settings.$li.index()+1,this.settings.pauseAfter)===-1?!0:!1},restart:function(){this.hide(),this.settings.$li=r,this.show("init")},pos_default:function(n){var r=Math.ceil(e(t).height()/2),i=this.settings.$next_tip.offset(),s=this.settings.$next_tip.find(".joyride-nub"),o=Math.ceil(this.outerHeight(s)/2),u=n||!1;u&&(this.settings.$next_tip.css("visibility","hidden"),this.settings.$next_tip.show()),/body/i.test(this.settings.$target.selector)?this.settings.$li.length&&this.pos_modal(s):(this.bottom()?(this.settings.$next_tip.css({top:this.settings.$target.offset().top+o+this.outerHeight(this.settings.$target),left:this.settings.$target.offset().left}),this.nub_position(s,this.settings.tipSettings.nubPosition,"top")):this.top()?(this.settings.$next_tip.css({top:this.settings.$target.offset().top-this.outerHeight(this.settings.$next_tip)-o,left:this.settings.$target.offset().left}),this.nub_position(s,this.settings.tipSettings.nubPosition,"bottom")):this.right()?(this.settings.$next_tip.css({top:this.settings.$target.offset().top,left:this.outerWidth(this.settings.$target)+this.settings.$target.offset().left}),this.nub_position(s,this.settings.tipSettings.nubPosition,"left")):this.left()&&(this.settings.$next_tip.css({top:this.settings.$target.offset().top,left:this.settings.$target.offset().left-this.outerWidth(this.settings.$next_tip)-o}),this.nub_position(s,this.settings.tipSettings.nubPosition,"right")),!this.visible(this.corners(this.settings.$next_tip))&&this.settings.attempts').show(),/pop/i.test(this.settings.tipAnimation)?e(".joyride-modal-bg").show():e(".joyride-modal-bg").fadeIn(this.settings.tipAnimationFadeSpeed))},center:function(){var n=e(t);return this.settings.$next_tip.css({top:(n.height()-this.outerHeight(this.settings.$next_tip))/2+n.scrollTop(),left:(n.width()-this.outerWidth(this.settings.$next_tip))/2+this.scrollLeft(n)}),!0},bottom:function(){return/bottom/i.test(this.settings.tipSettings.tipLocation)},top:function(){return/top/i.test(this.settings.tipSettings.tipLocation)},right:function(){return/right/i.test(this.settings.tipSettings.tipLocation)},left:function(){return/left/i.test(this.settings.tipSettings.tipLocation)},corners:function(n){var r=e(t),i=r.width()+this.scrollLeft(r),s=r.width()+r.scrollTop();return[n.offset().top<=r.scrollTop(),i<=n.offset().left+this.outerWidth(n),s<=n.offset().top+this.outerHeight(n),this.scrollLeft(r)>=n.offset().left]},visible:function(e){var t=e.length;while(t--)if(e[t])return!1;return!0},nub_position:function(e,t,n){t==="auto"?e.addClass(n):e.addClass(t)},startTimer:function(){this.settings.$li.length?this.settings.automate=setTimeout(function(){this.hide(),this.show(),this.startTimer()}.bind(this),this.settings.timer):clearTimeout(this.settings.automate)},end:function(){this.settings.cookieMonster&&e.cookie(this.settings.cookieName,"ridden",{expires:this.settings.cookieExpires,domain:this.settings.cookieDomain}),this.settings.timer>0&&clearTimeout(this.settings.automate),this.settings 10 | .$next_tip.data("closed",!0),e(".joyride-modal-bg").hide(),this.settings.$current_tip.hide(),this.settings.postStepCallback(this.settings.$li.index(),this.settings.$current_tip),this.settings.postRideCallback(this.settings.$li.index(),this.settings.$current_tip)},outerHTML:function(e){return e.outerHTML||(new XMLSerializer).serializeToString(e)},off:function(){e(this.scope).off(".joyride"),e(t).off(".joyride"),e(".joyride-close-tip, .joyride-next-tip, .joyride-modal-bg").off(".joyride"),e(".joyride-tip-guide, .joyride-modal-bg").remove(),clearTimeout(this.settings.automate),this.settings={}}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.magellan={name:"magellan",version:"4.0.0",settings:{activeClass:"active"},init:function(t,n,r){return this.scope=t||this.scope,Foundation.inherit(this,"data_options"),typeof n=="object"&&e.extend(!0,this.settings,n),typeof n!="string"?(this.settings.init||(this.fixed_magellan=e("[data-magellan-expedition]"),this.set_threshold(),this.last_destination=e("[data-magellan-destination]").last(),this.events()),this.settings.init):this[n].call(this,r)},events:function(){var n=this;e(this.scope).on("arrival.fndtn.magellan","[data-magellan-arrival]",function(t){var r=e(this),i=r.closest("[data-magellan-expedition]"),s=i.attr("data-magellan-active-class")||n.settings.activeClass;r.closest("[data-magellan-expedition]").find("[data-magellan-arrival]").not(r).removeClass(s),r.addClass(s)}),this.fixed_magellan.on("update-position.fndtn.magellan",function(){var t=e(this)}).trigger("update-position"),e(t).on("resize.fndtn.magellan",function(){this.fixed_magellan.trigger("update-position")}.bind(this)).on("scroll.fndtn.magellan",function(){var r=e(t).scrollTop();n.fixed_magellan.each(function(){var t=e(this);typeof t.data("magellan-top-offset")=="undefined"&&t.data("magellan-top-offset",t.offset().top),typeof t.data("magellan-fixed-position")=="undefined"&&t.data("magellan-fixed-position",!1);var i=r+n.settings.threshold>t.data("magellan-top-offset"),s=t.attr("data-magellan-top-offset");t.data("magellan-fixed-position")!=i&&(t.data("magellan-fixed-position",i),i?t.css({position:"fixed",top:0}):t.css({position:"",top:""}),i&&typeof s!="undefined"&&s!=0&&t.css({position:"fixed",top:s+"px"}))})}),this.last_destination.length>0&&e(t).on("scroll.fndtn.magellan",function(r){var i=e(t).scrollTop(),s=i+e(t).height(),o=Math.ceil(n.last_destination.offset().top);e("[data-magellan-destination]").each(function(){var t=e(this),r=t.attr("data-magellan-destination"),u=t.offset().top-i;u<=n.settings.threshold&&e("[data-magellan-arrival='"+r+"']").trigger("arrival"),s>=e(n.scope).height()&&o>i&&o0?this.outerHeight(this.fixed_magellan,!0):0)},off:function(){e(this.scope).off(".fndtn.magellan")}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs=Foundation.libs||{},Foundation.libs.orbit={version:"4.0.0",settings:{timer_speed:1e4,animation_speed:500,bullets:!0,stack_on_small:!0,container_class:"orbit-container",stack_on_small_class:"orbit-stack-on-small",next_class:"orbit-next",prev_class:"orbit-prev",timer_container_class:"orbit-timer",timer_paused_class:"paused",timer_progress_class:"orbit-progress",slides_container_class:"orbit-slides-container",bullets_container_class:"orbit-bullets",bullets_active_class:"active",slide_number_class:"orbit-slide-number",caption_class:"orbit-caption",active_slide_class:"active",orbit_transition_class:"orbit-transitioning"},init:function(t,n,r){var i=this;typeof n=="object"&&e.extend(!0,i.settings,n),e("[data-orbit]",t).each(e.proxy(i._init,i))},_container_html:function(){var e=this;return'
    '},_bullets_container_html:function(t){var n=this,r=e('
      ');return t.each(function(t,i){var s=e('
    1. ');t===0&&s.addClass(n.settings.bullets_active_class),r.append(s)}),r},_slide_number_html:function(t,n){var r=this,i=e('
      ');return i.append(""+t+" of "+n+""),i},_timer_html:function(){var e=this;return typeof e.settings.timer_speed=="number"&&e.settings.timer_speed>0?'
      ':""},_next_html:function(){var e=this;return'Next '},_prev_html:function(){var e=this;return'Prev '},_init:function(t,n){var r=this,i=e(n),s=i.wrap(r._container_html()).parent(),o=i.children();s.append(r._prev_html()),s.append(r._next_html()),i.addClass(r.settings.slides_container_class),r.settings.stack_on_small&&s.addClass(r.settings.stack_on_small_class),s.append(r._slide_number_html(1,o.length)),s.append(r._timer_html()),r.settings.bullets&&s.after(r._bullets_container_html(o)),i.append(o.first().clone().attr("data-orbit-slide","")),i.prepend(o.last().clone().attr("data-orbit-slide","")),i.css("marginLeft","-100%"),o.first().addClass(r.settings.active_slide_class),r._init_events(i),r._init_dimensions(i),r._start_timer(i)},_init_events:function(i){var s=this,o=i.parent();e(t).on("load.fndtn.orbit",function(){i.height(""),i.height(i.height(o.height())),i.trigger("orbit:ready")}).on("resize.fndtn.orbit",function(){i.height(""),i.height(i.height(o.height()))}),e(n).on("click.fndtn.orbit","[data-orbit-link]",function(t){t.preventDefault();var n=e(t.currentTarget).attr("data-orbit-link"),r=i.find("[data-orbit-slide="+n+"]").first();r.length===1&&(s._reset_timer(i,!0),s.goto(i,r.index(),function(){}))}),o.siblings("."+s.settings.bullets_container_class).on("click.fndtn.orbit","[data-orbit-slide-number]",function(t){t.preventDefault(),s._reset_timer(i,!0),s.goto(i,e(t.currentTarget).data("orbit-slide-number"),function(){})}),o.on("orbit:after-slide-change.fndtn.orbit",function(e,t){var n=o.find("."+s.settings.slide_number_class);n.length===1&&n.replaceWith(s._slide_number_html(t.slide_number,t.total_slides))}).on("orbit:next-slide.fndtn.orbit click.fndtn.orbit","."+s.settings.next_class,function(e){e.preventDefault(),s._reset_timer(i,!0),s.goto(i,"next",function(){})}).on("orbit:prev-slide.fndtn.orbit click.fndtn.orbit","."+s.settings.prev_class,function(e){e.preventDefault(),s._reset_timer(i,!0),s.goto(i,"prev",function(){})}).on("orbit:toggle-play-pause.fndtn.orbit click.fndtn.orbit touchstart.fndtn.orbit","."+s.settings.timer_container_class,function(t){t.preventDefault();var n=e(t.currentTarget).toggleClass(s.settings.timer_paused_class),r=n.closest("."+s.settings.container_class).find("."+s.settings.slides_container_class);n.hasClass(s.settings.timer_paused_class)?s._stop_timer(r):s._start_timer(r)}).on("touchstart.fndtn.orbit",function(e){e.touches||(e=e.originalEvent);var t={start_page_x:e.touches[0].pageX,start_page_y:e.touches[0].pageY,start_time:(new Date).getTime(),delta_x:0,is_scrolling:r};o.data("swipe-transition",t),e.stopPropagation()}).on("touchmove.fndtn.orbit",function(e){e.touches||(e=e.originalEvent);if(e.touches.length>1||e.scale&&e.scale!==1)return;var t=o.data("swipe-transition");typeof t=="undefined"&&(t={}),t.delta_x=e.touches[0].pageX-t.start_page_x,typeof t.is_scrolling=="undefined"&&(t.is_scrolling=!!(t.is_scrolling||Math.abs(t.delta_x)0&&this.hide(e,this.settings.css.close),t.filter(":visible").length>0?this.hide(t,this.settings.css.close):this.show(t,this.settings.css.open)},toggle_bg:function(t){this.settings.bg.length===0&&(this.settings.bg=e("
      ",{"class":this.settings.bgClass}).insertAfter(t)),this.settings.bg.filter(":visible").length>0?this.hide(this.settings.bg):this.show(this.settings.bg)},show:function(n,r){if(r){if(/pop/i.test(this.settings.animation)){r.top=e(t).scrollTop()-n.data("offset")+"px";var i={top:e(t).scrollTop()+n.data("css-top")+"px",opacity:1};return this.delay(function(){return n.css(r).animate(i,this.settings.animationSpeed,"linear",function(){this.locked=!1,n.trigger("opened")}.bind(this)).addClass("open")}.bind(this),this.settings.animationSpeed/2)}if(/fade/i.test(this.settings.animation)){var i={opacity:1};return this.delay(function(){return n.css(r).animate(i,this.settings.animationSpeed,"linear",function(){this.locked=!1,n.trigger("opened")}.bind(this)).addClass("open")}.bind(this),this.settings.animationSpeed/2)}return n.css(r).show().css({opacity:1}).addClass("open").trigger("opened")}return/fade/i.test(this.settings.animation)?n.fadeIn(this.settings.animationSpeed/2):n.show()},hide:function(n,r){if(r){if(/pop/i.test(this.settings.animation)){var i={top:-e(t).scrollTop()-n.data("offset")+"px",opacity:0};return this.delay(function(){return n.animate(i,this.settings.animationSpeed,"linear",function(){this.locked=!1,n.css(r).trigger("closed")}.bind(this)).removeClass("open")}.bind(this),this.settings.animationSpeed/2)}if(/fade/i.test(this.settings.animation)){var i={opacity:0};return this.delay(function(){return n.animate(i,this.settings.animationSpeed,"linear",function(){this.locked=!1,n.css(r).trigger("closed")}.bind(this)).removeClass("open")}.bind(this),this.settings.animationSpeed/2)}return n.hide().css(r).removeClass("open").trigger("closed")}return/fade/i.test(this.settings.animation)?n.fadeOut(this.settings.animationSpeed/2):n.hide()},close_video:function(t){var n=e(this).find(".flex-video"),r=n.find("iframe");r.length>0&&(r.attr("data-src",r[0].src),r.attr("src","about:blank"),n.fadeOut(100).hide())},open_video:function(t){var n=e(this).find(".flex-video"),r=n.find("iframe");if(r.length>0){var i=r.attr("data-src");typeof i=="string"&&(r[0].src=r.attr("data-src")),n.show().fadeIn(100)}},cache_offset:function(e){var t=e.show().height()+parseInt(e.css("top"),10);return e.hide(),t},off:function(){e(this.scope).off(".fndtn.reveal")}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.section={name:"section",version:"4.0.5",settings:{deep_linking:!1,one_up:!0,callback:function(){}},init:function(t,n,r){return this.scope=t||this.scope,Foundation.inherit(this,"throttle data_options"),typeof n=="object"&&e.extend(!0,this.settings,n),typeof n!="string"?(this.set_active_from_hash(),this.settings.init||this.events(),this.settings.init):this[n].call(this,r)},events:function(){var n=this;e(this.scope).on("click.fndtn.section","[data-section] .title",function(t){e.extend(!0,n.settings,n.data_options(e(this).closest("[data-section]"))),n.toggle_active.call(this,t,n)}),e(t).on("resize.fndtn.section",n.throttle(function(){n.resize.call(this)},30)).trigger("resize"),e("[data-section] .content").on("click.fndtn.section",function(e){e.stopPropagation()}),e("*, html, body").on("click.fndtn.section",function(t){e(t.target).closest(".title").length<1&&e("[data-section].vertical-nav, [data-section].horizontal-nav").find("section, .section").removeClass("active").attr("style","")}),this.settings.init=!0},toggle_active:function(t,n){var r=e(this),i=r.closest("section, .section"),s=i.find(".content"),o=i.closest("[data-section]"),n=Foundation.libs.section;!n.settings.deep_linking&&s.length>0&&t.preventDefault();if(i.hasClass("active"))(n.small(o)||n.is_vertical(o)||n.is_horizontal(o)||n.is_accordion(o))&&i.removeClass("active").attr("style","");else{if(n.small(o)||n.settings.one_up)r.closest("[data-section]").find("section, .section").removeClass("active").attr("style",""),i.css("padding-top",n.outerHeight(i.find(".title")));e("[data-section].vertical-nav, [data-section].horizontal-nav").find("section, .section").removeClass("active").attr("style",""),n.small(o)&&i.attr("style",""),i.addClass("active")}n.settings.callback()},resize:function(){var t=e("[data-section]"),n=Foundation.libs.section;t.each(function(){var t=e(this),r=t.find("section.active, .section.active");if(r.length>1)r.not(":first").removeClass("active").attr("style","");else if(r.length<1&&!n.is_vertical(t)&&!n.is_horizontal(t)&&!n.is_accordion(t)){var i=t.find("section, .section").first();i.addClass("active"),n.small(t)?i.attr("style",""):i.css("padding-top",n.outerHeight(i.find(".title")))}n.small(t)?r.attr("style",""):r.css("padding-top",n.outerHeight(r.find(".title"))),n.position_titles(t),n.is_horizontal(t)&&!n.small(t)?n.position_content(t):n.position_content(t,!1)})},is_vertical:function(e){return e.hasClass("vertical-nav")},is_horizontal:function(e){return e.hasClass("horizontal-nav")},is_accordion:function(e){return e.hasClass("accordion")},set_active_from_hash:function(){var n=t.location.hash.substring(1),r=e("[data-section]"),i=this;r.each(function(){var t=e(this);e.extend(!0,i.settings,i.data_options(t)),n.length>0&&i.settings.deep_linking&&t.find('.content[data-slug="'+n+'"]').closest("section, .section").addClass("active")})},position_titles:function(t,n){var r=t.find(".title"),i=0,s=this;typeof n=="boolean"?r.attr("style",""):r.each(function(){e(this).css("left",i),i+=s.outerWidth(e(this))})},position_content:function(t,n){var r=t.find(".title"),i=t.find(".content"),s=this;typeof n=="boolean"?(i.attr("style",""),t.attr("style","")):(t.find("section, .section").each(function(){var t=e(this).find(".title"),n=e(this).find(".content");n.css({left:t.position().left-1,top:s.outerHeight(t)-2})}),typeof Zepto=="function"?t.height(this.outerHeight(r.first())):t.height(this.outerHeight(r.first())-2))},small:function(t){return t&&this.is_accordion(t)?!0:e("html").hasClass("lt-ie9")?!0:e("html").hasClass("ie8compat")?!0:e(this.scope).width()<768},off:function(){e(this.scope).off(".fndtn.section"),e(t).off(".fndtn.section"),this.settings.init=!1}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.tooltips={name:"tooltips",version:"4.0.2",settings:{selector:".has-tip",additionalInheritableClasses:[],tooltipClass:".tooltip",tipTemplate:function(e,t){return''+t+''}},cache:{},init:function(t,n,r){var i=this;this.scope=t||this.scope,typeof n=="object"&&e.extend(!0,this.settings,n);if(typeof n=="string")return this[n].call(this,r);Modernizr.touch?e(this.scope).on("click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip","[data-tooltip]",function(t){t.preventDefault(),e(i.settings.tooltipClass).hide(),i.showOrCreateTip(e(this))}).on("click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip",this.settings.tooltipClass,function(t){t.preventDefault(),e(this).fadeOut(150)}):e(this.scope).on("mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip","[data-tooltip]",function(t){var n=e(this);t.type==="mouseover"||t.type==="mouseenter"?i.showOrCreateTip(n):(t.type==="mouseout"||t.type==="mouseleave")&&i.hide(n)})},showOrCreateTip:function(e){var t=this.getTip(e);return t&&t.length>0?this.show(e):this.create(e)},getTip:function(t){var n=this.selector(t),r=null;return n&&(r=e("span[data-selector="+n+"]"+this.settings.tooltipClass)),typeof r=="object"?r:!1},selector:function(e){var t=e.attr("id"),n=e.attr("data-tooltip")||e.attr("data-selector");return(t&&t.length<1||!t)&&typeof n!="string"&&(n="tooltip"+Math.random().toString(36).substring(7),e.attr("data-selector",n)),t&&t.length>0?t:n},create:function(t){var n=e(this.settings.tipTemplate(this.selector(t),e("
      ").html(t.attr("title")).html())),r=this.inheritable_classes(t);n.addClass(r).appendTo("body"),Modernizr.touch&&n.append('tap to close '),t.removeAttr("title").attr("title",""),this.show(t)},reposition:function(n,r,i){var s,o,u,a,f,l;r.css("visibility","hidden").show(),s=n.data("width"),o=r.children(".nub"),u=this.outerHeight(o),a=this.outerHeight(o),l=function(e,t,n,r,i,s){return e.css({top:t?t:"auto",bottom:r?r:"auto",left:i?i:"auto",right:n?n:"auto",width:s?s:"auto"}).end()},l(r,n.offset().top+this.outerHeight(n)+10,"auto","auto",n.offset().left,s),e(t).width()<767?(l(r,n.offset().top+this.outerHeight(n)+10,"auto","auto",12.5,e(this.scope).width()),r.addClass("tip-override"),l(o,-u,"auto","auto",n.offset().left)):(l(r,n.offset().top+this.outerHeight(n)+10,"auto","auto",n.offset().left,s),r.removeClass("tip-override"),i&&i.indexOf("tip-top")>-1?l(r,n.offset().top-this.outerHeight(r),"auto","auto",n.offset().left,s).removeClass("tip-override"):i&&i.indexOf("tip-left")>-1?l(r,n.offset().top+this.outerHeight(n)/2-u*2.5,"auto","auto",n.offset().left-this.outerWidth(r)-u,s).removeClass("tip-override"):i&&i.indexOf("tip-right")>-1&&l(r,n.offset().top+this.outerHeight(n)/2-u*2.5,"auto","auto",n.offset().left+this.outerWidth(n)+u,s).removeClass("tip-override")),r.css("visibility","visible").hide()},inheritable_classes:function(t){var n=["tip-top","tip-left","tip-bottom","tip-right","noradius"].concat(this.settings.additionalInheritableClasses),r=t.attr("class"),i=r?e.map(r.split(" "),function(t,r){if(e.inArray(t,n)!==-1)return t}).join(" "):"";return e.trim(i)},show:function(e){var t=this.getTip(e);this.reposition(e,t,e.attr("class")),t.fadeIn(150)},hide:function(e){var t=this.getTip(e);t.fadeOut(150)},reload:function(){var t=e(this);return t.data("fndtn-tooltips")?t.foundationTooltips("destroy").foundationTooltips("init"):t.foundationTooltips("init")},off:function(){e(this.scope).off(".fndtn.tooltip"),e(this.settings.tooltipClass).each(function(t){e("[data-tooltip]").get(t).attr("title",e(this).text())}).remove()}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.topbar={name:"topbar",version:"4.0.0",settings:{index:0,stickyClass:"sticky",custom_back_text:!0,back_text:"Back",init:!1},init:function(n,r,i){var s=this;return this.scope=n||this.scope,typeof r=="object"&&e.extend(!0,this.settings,r),typeof r!="string"?(e("nav.top-bar").each(function(){s.settings.$w=e(t),s.settings.$topbar=e(this),s.settings.$section=s.settings.$topbar.find("section"),s.settings.$titlebar=s.settings.$topbar.children("ul").first(),s.settings.$topbar.data("index",0);var n=e("
      ").insertAfter(s.settings.$topbar);s.settings.breakPoint=n.width(),n.remove(),s.assemble(),s.settings.$topbar.parent().hasClass("fixed")&&e("body").css("padding-top",s.outerHeight(s.settings.$topbar))}),s.settings.init||this.events(),this.settings.init):this[r].call(this,i)},events:function(){var n=this;e(this.scope).on("click.fndtn.topbar",".top-bar .toggle-topbar",function(t){var r=e(this).closest(".top-bar"),i=r.find("section, .section"),s=r.children("ul").first();n.settings.$topbar.data("height")||n.largestUL(),t.preventDefault(),n.breakpoint()&&r.toggleClass("expanded").css("min-height",""),r.hasClass("expanded")||(i.css({left:"0%"}),i.find(">.name").css({left:"100%"}),i.find("li.moved").removeClass("moved"),r.data("index",0))}).on("click.fndtn.topbar",".top-bar .has-dropdown>a",function(t){var r=e(this).closest(".top-bar"),i=r.find("section, .section"),s=r.children("ul").first();(Modernizr.touch||n.breakpoint())&&t.preventDefault();if(n.breakpoint()){var o=e(this),u=o.closest("li");r.data("index",r.data("index")+1),u.addClass("moved"),i.css({left:-(100*r.data("index"))+"%"}),i.find(">.name").css({left:100*r.data("index")+"%"}),o.siblings("ul").height(r.data("height")+n.outerHeight(s,!0)),r.css("min-height",r.data("height")+n.outerHeight(s,!0)*2)}}),e(t).on("resize.fndtn.topbar",function(){this.breakpoint()||e(".top-bar").css("min-height","")}.bind(this)),e(this.scope).on("click.fndtn",".top-bar .has-dropdown .back",function(t){t.preventDefault();var n=e(this),r=n.closest(".top-bar"),i=r.find("section, .section"),s=n.closest("li.moved"),o=s.parent();r.data("index",r.data("index")-1),i.css({left:-(100*r.data("index"))+"%"}),i.find(">.name").css({left:100*r.data("index")+"%"}),r.data("index")===0&&r.css("min-height",0),setTimeout(function(){s.removeClass("moved")},300)})},breakpoint:function(){return e(t).width()<=this.settings.breakPoint||e("html").hasClass("lt-ie9")},assemble:function(){var t=this;this.settings.$section.detach(),this.settings.$section.find(".has-dropdown>a").each(function(){var n=e(this),r=n.siblings(".dropdown"),i=e('
    2. ');t.settings.custom_back_text==1?i.find("h5>a").html("« "+t.settings.back_text):i.find("h5>a").html("« "+n.html()),r.prepend(i)}),this.settings.$section.appendTo(this.settings.$topbar),this.sticky()},largestUL:function(){var t=this.settings.$topbar.find("section ul ul"),n=t.first(),r=0,i=this;t.each(function(){e(this).children("li").length>n.children("li").length&&(n=e(this))}),n.children("li").each(function(){r+=i.outerHeight(e(this),!0)}),this.settings.$topbar.data("height",r)},sticky:function(){var n="."+this.settings.stickyClass;if(e(n).length>0){var r=e(n).length?e(n).offset().top:0,i=e(t),s=this.outerHeight(e("nav.top-bar"))+20;i.scroll(function(){i.scrollTop()>=r?(e(n).addClass("fixed"),e("body").css("padding-top",s)):i.scrollTop()×' + 14 | '' 17 | }, 18 | 19 | // comma delimited list of selectors that, on click, will close clearing, 20 | // add 'div.clearing-blackout, div.visible-img' to close on background click 21 | close_selectors : '.clearing-close', 22 | 23 | // event initializers and locks 24 | init : false, 25 | locked : false 26 | }, 27 | 28 | init : function (scope, method, options) { 29 | this.scope = this.scope || scope; 30 | Foundation.inherit(this, 'set_data get_data remove_data throttle'); 31 | 32 | if (typeof method === 'object') { 33 | options = $.extend(true, this.settings, method); 34 | } 35 | 36 | if (typeof method != 'string') { 37 | $(this.scope).find('ul[data-clearing]').each(function () { 38 | var self = Foundation.libs.clearing, 39 | $el = $(this), 40 | options = options || {}, 41 | settings = self.get_data($el); 42 | 43 | if (!settings) { 44 | options.$parent = $el.parent(); 45 | 46 | self.set_data($el, $.extend(true, self.settings, options)); 47 | 48 | self.assemble($el.find('li')); 49 | 50 | if (!self.settings.init) { 51 | self.events().swipe_events(); 52 | } 53 | } 54 | }); 55 | 56 | return this.settings.init; 57 | } else { 58 | // fire method 59 | return this[method].call(this, options); 60 | } 61 | }, 62 | 63 | // event binding and initial setup 64 | 65 | events : function () { 66 | var self = this; 67 | 68 | $(this.scope) 69 | .on('click.fndtn.clearing', 'ul[data-clearing] li', 70 | function (e, current, target) { 71 | var current = current || $(this), 72 | target = target || current, 73 | settings = self.get_data(current.parent()); 74 | 75 | e.preventDefault(); 76 | if (!settings) self.init(); 77 | 78 | // set current and target to the clicked li if not otherwise defined. 79 | self.open($(e.target), current, target); 80 | self.update_paddles(target); 81 | }) 82 | 83 | .on('click.fndtn.clearing', '.clearing-main-right', 84 | function (e) { this.nav(e, 'next') }.bind(this)) 85 | .on('click.fndtn.clearing', '.clearing-main-left', 86 | function (e) { this.nav(e, 'prev') }.bind(this)) 87 | .on('click.fndtn.clearing', this.settings.close_selectors, 88 | function (e) { Foundation.libs.clearing.close(e, this) }) 89 | .on('keydown.fndtn.clearing', 90 | function (e) { this.keydown(e) }.bind(this)); 91 | 92 | $(window).on('resize.fndtn.clearing', 93 | function (e) { this.resize() }.bind(this)); 94 | 95 | this.settings.init = true; 96 | return this; 97 | }, 98 | 99 | swipe_events : function () { 100 | var self = this; 101 | 102 | $(this.scope) 103 | .on('touchstart.fndtn.clearing', '.visible-img', function(e) { 104 | var data = { 105 | start_page_x: e.touches[0].pageX, 106 | start_page_y: e.touches[0].pageY, 107 | start_time: (new Date()).getTime(), 108 | delta_x: 0, 109 | is_scrolling: undefined 110 | }; 111 | 112 | $(this).data('swipe-transition', data); 113 | e.stopPropagation(); 114 | }) 115 | .on('touchmove.fndtn.clearing', '.visible-img', function(e) { 116 | // Ignore pinch/zoom events 117 | if(e.touches.length > 1 || e.scale && e.scale !== 1) return; 118 | 119 | var data = $(this).data('swipe-transition'); 120 | 121 | if (typeof data === 'undefined') { 122 | data = {}; 123 | } 124 | 125 | data.delta_x = e.touches[0].pageX - data.start_page_x; 126 | 127 | if ( typeof data.is_scrolling === 'undefined') { 128 | data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) ); 129 | } 130 | 131 | if (!data.is_scrolling && !data.active) { 132 | e.preventDefault(); 133 | var direction = (data.delta_x < 0) ? 'next' : 'prev'; 134 | data.active = true; 135 | self.nav(e, direction); 136 | } 137 | }) 138 | .on('touchend.fndtn.clearing', '.visible-img', function(e) { 139 | $(this).data('swipe-transition', {}); 140 | e.stopPropagation(); 141 | }); 142 | }, 143 | 144 | assemble : function ($li) { 145 | var $el = $li.parent(), 146 | settings = this.get_data($el), 147 | grid = $el.detach(), 148 | data = { 149 | grid: '', 150 | viewing: settings.templates.viewing 151 | }, 152 | wrapper = '
      ' + data.viewing + 153 | data.grid + '
      '; 154 | 155 | return settings.$parent.append(wrapper); 156 | }, 157 | 158 | // event callbacks 159 | 160 | open : function ($image, current, target) { 161 | var root = target.closest('.clearing-assembled'), 162 | container = root.find('div').first(), 163 | visible_image = container.find('.visible-img'), 164 | image = visible_image.find('img').not($image); 165 | 166 | if (!this.locked()) { 167 | // set the image to the selected thumbnail 168 | image.attr('src', this.load($image)); 169 | 170 | this.loaded(image, function () { 171 | // toggle the gallery 172 | root.addClass('clearing-blackout'); 173 | container.addClass('clearing-container'); 174 | visible_image.show(); 175 | this.fix_height(target) 176 | .caption(visible_image.find('.clearing-caption'), $image) 177 | .center(image) 178 | .shift(current, target, function () { 179 | target.siblings().removeClass('visible'); 180 | target.addClass('visible'); 181 | }); 182 | }.bind(this)); 183 | } 184 | }, 185 | 186 | close : function (e, el) { 187 | e.preventDefault(); 188 | 189 | var root = (function (target) { 190 | if (/blackout/.test(target.selector)) { 191 | return target; 192 | } else { 193 | return target.closest('.clearing-blackout'); 194 | } 195 | }($(el))), container, visible_image; 196 | 197 | if (el === e.target && root) { 198 | container = root.find('div').first(), 199 | visible_image = container.find('.visible-img'); 200 | this.settings.prev_index = 0; 201 | root.find('ul[data-clearing]') 202 | .attr('style', '').closest('.clearing-blackout') 203 | .removeClass('clearing-blackout'); 204 | container.removeClass('clearing-container'); 205 | visible_image.hide(); 206 | } 207 | 208 | return false; 209 | }, 210 | 211 | keydown : function (e) { 212 | var clearing = $('.clearing-blackout').find('ul[data-clearing]'); 213 | 214 | if (e.which === 39) this.go(clearing, 'next'); 215 | if (e.which === 37) this.go(clearing, 'prev'); 216 | if (e.which === 27) $('a.clearing-close').trigger('click'); 217 | }, 218 | 219 | nav : function (e, direction) { 220 | var clearing = $('.clearing-blackout').find('ul[data-clearing]'); 221 | 222 | e.preventDefault(); 223 | this.go(clearing, direction); 224 | }, 225 | 226 | resize : function () { 227 | var image = $('.clearing-blackout .visible-img').find('img'); 228 | 229 | if (image.length) { 230 | this.center(image); 231 | } 232 | }, 233 | 234 | // visual adjustments 235 | fix_height : function (target) { 236 | var lis = target.parent().children(), 237 | self = this; 238 | 239 | lis.each(function () { 240 | var li = $(this), 241 | image = li.find('img'); 242 | 243 | if (li.height() > self.outerHeight(image)) { 244 | li.addClass('fix-height'); 245 | } 246 | }) 247 | .closest('ul') 248 | .width(lis.length * 100 + '%'); 249 | 250 | return this; 251 | }, 252 | 253 | update_paddles : function (target) { 254 | var visible_image = target 255 | .closest('.carousel') 256 | .siblings('.visible-img'); 257 | 258 | if (target.next().length) { 259 | visible_image 260 | .find('.clearing-main-right') 261 | .removeClass('disabled'); 262 | } else { 263 | visible_image 264 | .find('.clearing-main-right') 265 | .addClass('disabled'); 266 | } 267 | 268 | if (target.prev().length) { 269 | visible_image 270 | .find('.clearing-main-left') 271 | .removeClass('disabled'); 272 | } else { 273 | visible_image 274 | .find('.clearing-main-left') 275 | .addClass('disabled'); 276 | } 277 | }, 278 | 279 | center : function (target) { 280 | target.css({ 281 | marginLeft : -(this.outerWidth(target) / 2), 282 | marginTop : -(this.outerHeight(target) / 2) 283 | }); 284 | return this; 285 | }, 286 | 287 | // image loading and preloading 288 | 289 | load : function ($image) { 290 | var href = $image.parent().attr('href'); 291 | 292 | this.preload($image); 293 | 294 | if (href) return href; 295 | return $image.attr('src'); 296 | }, 297 | 298 | preload : function ($image) { 299 | this 300 | .img($image.closest('li').next()) 301 | .img($image.closest('li').prev()); 302 | }, 303 | 304 | loaded : function (image, callback) { 305 | // based on jquery.imageready.js 306 | // @weblinc, @jsantell, (c) 2012 307 | 308 | function loaded () { 309 | callback(); 310 | } 311 | 312 | function bindLoad () { 313 | this.one('load', loaded); 314 | 315 | if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { 316 | var src = this.attr( 'src' ), 317 | param = src.match( /\?/ ) ? '&' : '?'; 318 | 319 | param += 'random=' + (new Date()).getTime(); 320 | this.attr('src', src + param); 321 | } 322 | } 323 | 324 | if (!image.attr('src')) { 325 | loaded(); 326 | return; 327 | } 328 | 329 | if (this.complete || this.readyState === 4) { 330 | loaded(); 331 | } else { 332 | bindLoad.call(image); 333 | } 334 | }, 335 | 336 | img : function (img) { 337 | if (img.length) { 338 | var new_img = new Image(), 339 | new_a = img.find('a'); 340 | 341 | if (new_a.length) { 342 | new_img.src = new_a.attr('href'); 343 | } else { 344 | new_img.src = img.find('img').attr('src'); 345 | } 346 | } 347 | return this; 348 | }, 349 | 350 | // image caption 351 | 352 | caption : function (container, $image) { 353 | var caption = $image.data('caption'); 354 | 355 | if (caption) { 356 | container 357 | .text(caption) 358 | .show(); 359 | } else { 360 | container 361 | .text('') 362 | .hide(); 363 | } 364 | return this; 365 | }, 366 | 367 | // directional methods 368 | 369 | go : function ($ul, direction) { 370 | var current = $ul.find('.visible'), 371 | target = current[direction](); 372 | 373 | if (target.length) { 374 | target 375 | .find('img') 376 | .trigger('click', [current, target]); 377 | } 378 | }, 379 | 380 | shift : function (current, target, callback) { 381 | var clearing = target.parent(), 382 | old_index = this.settings.prev_index || target.index(), 383 | direction = this.direction(clearing, current, target), 384 | left = parseInt(clearing.css('left'), 10), 385 | width = this.outerWidth(target), 386 | skip_shift; 387 | 388 | // we use jQuery animate instead of CSS transitions because we 389 | // need a callback to unlock the next animation 390 | if (target.index() !== old_index && !/skip/.test(direction)){ 391 | if (/left/.test(direction)) { 392 | this.lock(); 393 | clearing.animate({left : left + width}, 300, this.unlock()); 394 | } else if (/right/.test(direction)) { 395 | this.lock(); 396 | clearing.animate({left : left - width}, 300, this.unlock()); 397 | } 398 | } else if (/skip/.test(direction)) { 399 | // the target image is not adjacent to the current image, so 400 | // do we scroll right or not 401 | skip_shift = target.index() - this.settings.up_count; 402 | this.lock(); 403 | 404 | if (skip_shift > 0) { 405 | clearing.animate({left : -(skip_shift * width)}, 300, this.unlock()); 406 | } else { 407 | clearing.animate({left : 0}, 300, this.unlock()); 408 | } 409 | } 410 | 411 | callback(); 412 | }, 413 | 414 | direction : function ($el, current, target) { 415 | var lis = $el.find('li'), 416 | li_width = this.outerWidth(lis) + (this.outerWidth(lis) / 4), 417 | up_count = Math.floor(this.outerWidth($('.clearing-container')) / li_width) - 1, 418 | target_index = lis.index(target), 419 | response; 420 | 421 | this.settings.up_count = up_count; 422 | 423 | if (this.adjacent(this.settings.prev_index, target_index)) { 424 | if ((target_index > up_count) 425 | && target_index > this.settings.prev_index) { 426 | response = 'right'; 427 | } else if ((target_index > up_count - 1) 428 | && target_index <= this.settings.prev_index) { 429 | response = 'left'; 430 | } else { 431 | response = false; 432 | } 433 | } else { 434 | response = 'skip'; 435 | } 436 | 437 | this.settings.prev_index = target_index; 438 | 439 | return response; 440 | }, 441 | 442 | adjacent : function (current_index, target_index) { 443 | for (var i = target_index + 1; i >= target_index - 1; i--) { 444 | if (i === current_index) return true; 445 | } 446 | return false; 447 | }, 448 | 449 | // lock management 450 | 451 | lock : function () { 452 | this.settings.locked = true; 453 | }, 454 | 455 | unlock : function () { 456 | this.settings.locked = false; 457 | }, 458 | 459 | locked : function () { 460 | return this.settings.locked; 461 | }, 462 | 463 | // plugin management/browser quirks 464 | 465 | outerHTML : function (el) { 466 | // support FireFox < 11 467 | return el.outerHTML || new XMLSerializer().serializeToString(el); 468 | }, 469 | 470 | off : function () { 471 | $(this.scope).off('.fndtn.clearing'); 472 | $(window).off('.fndtn.clearing'); 473 | this.remove_data(); // empty settings cache 474 | this.settings.init = false; 475 | } 476 | }; 477 | 478 | }(Foundation.zj, this, this.document)); 479 | -------------------------------------------------------------------------------- /js/foundation/foundation.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.3 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2011, Klaus Hartl 6 | * Dual licensed under the MIT or GPL Version 2 licenses. 7 | * http://www.opensource.org/licenses/mit-license.php 8 | * http://www.opensource.org/licenses/GPL-2.0 9 | * 10 | * Modified to work with Zepto.js by ZURB 11 | */ 12 | (function ($, document, undefined) { 13 | 14 | var pluses = /\+/g; 15 | 16 | function raw(s) { 17 | return s; 18 | } 19 | 20 | function decoded(s) { 21 | return decodeURIComponent(s.replace(pluses, ' ')); 22 | } 23 | 24 | var config = $.cookie = function (key, value, options) { 25 | 26 | // write 27 | if (value !== undefined) { 28 | options = $.extend({}, config.defaults, options); 29 | 30 | if (value === null) { 31 | options.expires = -1; 32 | } 33 | 34 | if (typeof options.expires === 'number') { 35 | var days = options.expires, t = options.expires = new Date(); 36 | t.setDate(t.getDate() + days); 37 | } 38 | 39 | value = config.json ? JSON.stringify(value) : String(value); 40 | 41 | return (document.cookie = [ 42 | encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value), 43 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 44 | options.path ? '; path=' + options.path : '', 45 | options.domain ? '; domain=' + options.domain : '', 46 | options.secure ? '; secure' : '' 47 | ].join('')); 48 | } 49 | 50 | // read 51 | var decode = config.raw ? raw : decoded; 52 | var cookies = document.cookie.split('; '); 53 | for (var i = 0, l = cookies.length; i < l; i++) { 54 | var parts = cookies[i].split('='); 55 | if (decode(parts.shift()) === key) { 56 | var cookie = decode(parts.join('=')); 57 | return config.json ? JSON.parse(cookie) : cookie; 58 | } 59 | } 60 | 61 | return null; 62 | }; 63 | 64 | config.defaults = {}; 65 | 66 | $.removeCookie = function (key, options) { 67 | if ($.cookie(key) !== null) { 68 | $.cookie(key, null, options); 69 | return true; 70 | } 71 | return false; 72 | }; 73 | 74 | })(Foundation.zj, document); 75 | -------------------------------------------------------------------------------- /js/foundation/foundation.dropdown.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.dropdown = { 7 | name : 'dropdown', 8 | 9 | version : '4.0.0', 10 | 11 | settings : { 12 | activeClass: 'open' 13 | }, 14 | 15 | init : function (scope, method, options) { 16 | this.scope = scope || this.scope; 17 | Foundation.inherit(this, 'throttle'); 18 | 19 | if (typeof method === 'object') { 20 | $.extend(true, this.settings, method); 21 | } 22 | 23 | if (typeof method != 'string') { 24 | 25 | if (!this.settings.init) { 26 | this.events(); 27 | } 28 | 29 | return this.settings.init; 30 | } else { 31 | return this[method].call(this, options); 32 | } 33 | }, 34 | 35 | events : function () { 36 | var self = this; 37 | 38 | $(this.scope).on('click.fndtn.dropdown', '[data-dropdown]', function (e) { 39 | e.preventDefault(); 40 | e.stopPropagation(); 41 | self.toggle($(this)); 42 | }); 43 | 44 | $('*, html, body').on('click.fndtn.dropdown', function (e) { 45 | if (!$(e.target).data('dropdown')) { 46 | $('[data-dropdown-content]') 47 | .css('left', '-99999px') 48 | .removeClass(self.settings.activeClass); 49 | } 50 | }); 51 | 52 | $('[data-dropdown-content]').on('click.fndtn.dropdown', function (e) { 53 | e.stopPropagation(); 54 | }); 55 | 56 | $(window).on('resize.fndtn.dropdown', self.throttle(function () { 57 | self.resize.call(self); 58 | }, 50)).trigger('resize'); 59 | 60 | this.settings.init = true; 61 | }, 62 | 63 | toggle : function (target, resize) { 64 | var dropdown = $('#' + target.data('dropdown')); 65 | 66 | $('[data-dropdown-content]').not(dropdown).css('left', '-99999px'); 67 | 68 | if (dropdown.hasClass(this.settings.activeClass)) { 69 | dropdown 70 | .css('left', '-99999px') 71 | .removeClass(this.settings.activeClass); 72 | } else { 73 | this 74 | .css(dropdown 75 | .addClass(this.settings.activeClass), target); 76 | } 77 | }, 78 | 79 | resize : function () { 80 | var dropdown = $('[data-dropdown-content].open'), 81 | target = $("[data-dropdown='" + dropdown.attr('id') + "']"); 82 | 83 | if (dropdown.length && target.length) { 84 | this.css(dropdown, target); 85 | } 86 | }, 87 | 88 | css : function (dropdown, target) { 89 | var offset = target.offset(); 90 | 91 | if (this.small()) { 92 | dropdown.css({ 93 | position : 'absolute', 94 | width: '95%', 95 | left: '2.5%', 96 | 'max-width': 'none', 97 | top: offset.top + this.outerHeight(target) 98 | }); 99 | } else { 100 | dropdown.attr('style', '').css({ 101 | position : 'absolute', 102 | top: offset.top + this.outerHeight(target), 103 | left: offset.left 104 | }); 105 | } 106 | 107 | return dropdown; 108 | }, 109 | 110 | small : function () { 111 | return $(window).width() < 768 || $('html').hasClass('lt-ie9'); 112 | }, 113 | 114 | off: function () { 115 | $(this.scope).off('.fndtn.dropdown'); 116 | $('html, body').off('.fndtn.dropdown'); 117 | $(window).off('.fndtn.dropdown'); 118 | $('[data-dropdown-content]').off('.fndtn.dropdown'); 119 | this.settings.init = false; 120 | } 121 | }; 122 | }(Foundation.zj, this, this.document)); 123 | -------------------------------------------------------------------------------- /js/foundation/foundation.forms.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.forms = { 7 | name : 'forms', 8 | 9 | version : '4.0.4', 10 | 11 | settings : { 12 | disable_class: 'no-custom' 13 | }, 14 | 15 | init : function (scope, method, options) { 16 | this.scope = scope || this.scope; 17 | 18 | if (typeof method === 'object') { 19 | $.extend(true, this.settings, method); 20 | } 21 | 22 | if (typeof method != 'string') { 23 | if (!this.settings.init) { 24 | this.events(); 25 | } 26 | 27 | this.assemble(); 28 | 29 | return this.settings.init; 30 | } else { 31 | return this[method].call(this, options); 32 | } 33 | }, 34 | 35 | assemble : function () { 36 | $('form.custom input[type="radio"]', $(this.scope)).not('[data-customforms="disabled"]') 37 | .each(this.append_custom_markup); 38 | $('form.custom input[type="checkbox"]', $(this.scope)).not('[data-customforms="disabled"]') 39 | .each(this.append_custom_markup); 40 | $('form.custom select', $(this.scope)).not('[data-customforms="disabled"]') 41 | .each(this.append_custom_select); 42 | }, 43 | 44 | events : function () { 45 | var self = this; 46 | 47 | $(this.scope) 48 | .on('change.fndtn.forms', 'form.custom select:not([data-customforms="disabled"])', function (e) { 49 | self.refresh_custom_select($(this)); 50 | }) 51 | .on('click.fndtn.forms', 'form.custom label', function (e) { 52 | var $associatedElement = $('#' + self.escape($(this).attr('for')) + ':not([data-customforms="disabled"])'), 53 | $customCheckbox, 54 | $customRadio; 55 | if ($associatedElement.length !== 0) { 56 | if ($associatedElement.attr('type') === 'checkbox') { 57 | e.preventDefault(); 58 | $customCheckbox = $(this).find('span.custom.checkbox'); 59 | 60 | //the checkbox might be outside after the label 61 | if ($customCheckbox.length == 0) { 62 | $customCheckbox = $(this).next('span.custom.checkbox'); 63 | } 64 | //the checkbox might be outside before the label 65 | if ($customCheckbox.length == 0) { 66 | $customCheckbox = $(this).prev('span.custom.checkbox'); 67 | } 68 | self.toggle_checkbox($customCheckbox); 69 | } else if ($associatedElement.attr('type') === 'radio') { 70 | e.preventDefault(); 71 | $customRadio = $(this).find('span.custom.radio'); 72 | //the radio might be outside after the label 73 | if ($customRadio.length == 0) { 74 | $customRadio = $(this).next('span.custom.radio'); 75 | } 76 | //the radio might be outside before the label 77 | if ($customRadio.length == 0) { 78 | $customRadio = $(this).prev('span.custom.radio'); 79 | } 80 | self.toggle_radio($customRadio); 81 | } 82 | } 83 | }) 84 | .on('click.fndtn.forms', 'form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector', function (e) { 85 | var $this = $(this), 86 | $dropdown = $this.closest('div.custom.dropdown'), 87 | $select = $dropdown.prev(); 88 | 89 | // make sure other dropdowns close 90 | if(!$dropdown.hasClass('open')) 91 | $(self.scope).trigger('click'); 92 | 93 | e.preventDefault(); 94 | if (false === $select.is(':disabled')) { 95 | $dropdown.toggleClass('open'); 96 | 97 | if ($dropdown.hasClass('open')) { 98 | $(self.scope).on('click.fndtn.forms.customdropdown', function () { 99 | $dropdown.removeClass('open'); 100 | $(self.scope).off('.fndtn.forms.customdropdown'); 101 | }); 102 | } else { 103 | $(self.scope).on('.fndtn.forms.customdropdown'); 104 | } 105 | return false; 106 | } 107 | }) 108 | .on('click.fndtn.forms touchend.fndtn.forms', 'form.custom div.custom.dropdown li', function (e) { 109 | var $this = $(this), 110 | $customDropdown = $this.closest('div.custom.dropdown'), 111 | $select = $customDropdown.prev(), 112 | selectedIndex = 0; 113 | 114 | e.preventDefault(); 115 | e.stopPropagation(); 116 | 117 | if ( ! $(this).hasClass('disabled')) { 118 | $('div.dropdown').not($customDropdown).removeClass('open'); 119 | 120 | var $oldThis= $this 121 | .closest('ul') 122 | .find('li.selected'); 123 | $oldThis.removeClass('selected'); 124 | 125 | $this.addClass('selected'); 126 | 127 | $customDropdown 128 | .removeClass('open') 129 | .find('a.current') 130 | .html($this.html()); 131 | 132 | $this.closest('ul').find('li').each(function (index) { 133 | if ($this[0] == this) { 134 | selectedIndex = index; 135 | } 136 | 137 | }); 138 | $select[0].selectedIndex = selectedIndex; 139 | 140 | //store the old value in data 141 | $select.data('prevalue', $oldThis.html()); 142 | $select.trigger('change'); 143 | } 144 | }); 145 | 146 | this.settings.init = true; 147 | }, 148 | 149 | append_custom_markup : function (idx, sel) { 150 | var $this = $(sel).hide(), 151 | type = $this.attr('type'), 152 | $span = $this.next('span.custom.' + type); 153 | 154 | if ($span.length === 0) { 155 | $span = $('').insertAfter($this); 156 | } 157 | 158 | $span.toggleClass('checked', $this.is(':checked')); 159 | $span.toggleClass('disabled', $this.is(':disabled')); 160 | }, 161 | 162 | append_custom_select : function (idx, sel) { 163 | var self = Foundation.libs.forms, 164 | $this = $( sel ), 165 | $customSelect = $this.next( 'div.custom.dropdown' ), 166 | $customList = $customSelect.find( 'ul' ), 167 | $selectCurrent = $customSelect.find( ".current" ), 168 | $selector = $customSelect.find( ".selector" ), 169 | $options = $this.find( 'option' ), 170 | $selectedOption = $options.filter( ':selected' ), 171 | copyClasses = $this.attr('class') ? $this.attr('class').split(' ') : [], 172 | maxWidth = 0, 173 | liHtml = '', 174 | $listItems, 175 | $currentSelect = false; 176 | 177 | if ($this.hasClass(self.settings.disable_class)) return; 178 | 179 | if ($customSelect.length === 0) { 180 | var customSelectSize = $this.hasClass( 'small' ) ? 'small' : 181 | $this.hasClass( 'medium' ) ? 'medium' : 182 | $this.hasClass( 'large' ) ? 'large' : 183 | $this.hasClass( 'expand' ) ? 'expand' : ''; 184 | 185 | $customSelect = $('
        '); 186 | $selector = $customSelect.find(".selector"); 187 | $customList = $customSelect.find("ul"); 188 | liHtml = $options.map(function() { return "
      • " + $( this ).html() + "
      • "; } ).get().join( '' ); 189 | $customList.append(liHtml); 190 | $currentSelect = $customSelect.prepend('' + $selectedOption.html() + '' ).find( ".current" ); 191 | $this 192 | .after( $customSelect ) 193 | .hide(); 194 | 195 | } else { 196 | liHtml = $options.map(function() { 197 | return "
      • " + $( this ).html() + "
      • "; 198 | }) 199 | .get().join(''); 200 | $customList 201 | .html('') 202 | .append(liHtml); 203 | 204 | } // endif $customSelect.length === 0 205 | $customSelect.toggleClass('disabled', $this.is( ':disabled' ) ); 206 | $listItems = $customList.find( 'li' ); 207 | 208 | $options.each( function ( index ) { 209 | if ( this.selected ) { 210 | $listItems.eq( index ).addClass( 'selected' ); 211 | 212 | if ($currentSelect) { 213 | $currentSelect.html( $( this ).html() ); 214 | } 215 | 216 | } 217 | if ($(this).is(':disabled')) { 218 | $listItems.eq( index ).addClass( 'disabled' ); 219 | } 220 | }); 221 | 222 | // 223 | // If we're not specifying a predetermined form size. 224 | // 225 | if (!$customSelect.is('.small, .medium, .large, .expand')) { 226 | 227 | // ------------------------------------------------------------------------------------ 228 | // This is a work-around for when elements are contained within hidden parents. 229 | // For example, when custom-form elements are inside of a hidden reveal modal. 230 | // 231 | // We need to display the current custom list element as well as hidden parent elements 232 | // in order to properly calculate the list item element's width property. 233 | // ------------------------------------------------------------------------------------- 234 | 235 | $customSelect.addClass( 'open' ); 236 | // 237 | // Quickly, display all parent elements. 238 | // This should help us calcualate the width of the list item's within the drop down. 239 | // 240 | var self = Foundation.libs.forms; 241 | self.hidden_fix.adjust( $customList ); 242 | 243 | maxWidth = ( self.outerWidth($listItems) > maxWidth ) ? self.outerWidth($listItems) : maxWidth; 244 | 245 | Foundation.libs.forms.hidden_fix.reset(); 246 | 247 | $customSelect.removeClass( 'open' ); 248 | 249 | } // endif 250 | 251 | }, 252 | 253 | refresh_custom_select : function ($select) { 254 | var self = this; 255 | var maxWidth = 0, 256 | $customSelect = $select.next(), 257 | $options = $select.find('option'); 258 | 259 | $customSelect.find('ul').html(''); 260 | 261 | $options.each(function () { 262 | var $li = $('
      • ' + $(this).html() + '
      • '); 263 | $customSelect.find('ul').append($li); 264 | }); 265 | 266 | // re-populate 267 | $options.each(function (index) { 268 | if (this.selected) { 269 | $customSelect.find('li').eq(index).addClass('selected'); 270 | $customSelect.find('.current').html($(this).html()); 271 | } 272 | if ($(this).is(':disabled')) { 273 | $customSelect.find('li').eq(index).addClass('disabled'); 274 | } 275 | }); 276 | 277 | // fix width 278 | $customSelect.removeAttr('style') 279 | .find('ul').removeAttr('style'); 280 | $customSelect.find('li').each(function () { 281 | $customSelect.addClass('open'); 282 | if (self.outerWidth($(this)) > maxWidth) { 283 | maxWidth = self.outerWidth($(this)); 284 | } 285 | $customSelect.removeClass('open'); 286 | }); 287 | }, 288 | 289 | toggle_checkbox : function ($element) { 290 | var $input = $element.prev(), 291 | input = $input[0]; 292 | 293 | if (false === $input.is(':disabled')) { 294 | input.checked = ((input.checked) ? false : true); 295 | $element.toggleClass('checked'); 296 | 297 | $input.trigger('change'); 298 | } 299 | }, 300 | 301 | toggle_radio : function ($element) { 302 | var $input = $element.prev(), 303 | $form = $input.closest('form.custom'), 304 | input = $input[0]; 305 | 306 | if (false === $input.is(':disabled')) { 307 | $form.find('input[type="radio"][name="' + this.escape($input.attr('name')) + '"]').next().not($element).removeClass('checked'); 308 | if ( !$element.hasClass('checked') ) { 309 | $element.toggleClass('checked'); 310 | } 311 | input.checked = $element.hasClass('checked'); 312 | 313 | $input.trigger('change'); 314 | } 315 | }, 316 | 317 | escape : function (text) { 318 | return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); 319 | }, 320 | 321 | hidden_fix : { 322 | /** 323 | * Sets all hidden parent elements and self to visibile. 324 | * 325 | * @method adjust 326 | * @param {jQuery Object} $child 327 | */ 328 | 329 | // We'll use this to temporarily store style properties. 330 | tmp : [], 331 | 332 | // We'll use this to set hidden parent elements. 333 | hidden : null, 334 | 335 | adjust : function( $child ) { 336 | // Internal reference. 337 | var _self = this; 338 | 339 | // Set all hidden parent elements, including this element. 340 | _self.hidden = $child.parents().andSelf().filter( ":hidden" ); 341 | 342 | // Loop through all hidden elements. 343 | _self.hidden.each( function() { 344 | 345 | // Cache the element. 346 | var $elem = $( this ); 347 | 348 | // Store the style attribute. 349 | // Undefined if element doesn't have a style attribute. 350 | _self.tmp.push( $elem.attr( 'style' ) ); 351 | 352 | // Set the element's display property to block, 353 | // but ensure it's visibility is hidden. 354 | $elem.css( { 'visibility' : 'hidden', 'display' : 'block' } ); 355 | }); 356 | 357 | }, // end adjust 358 | 359 | /** 360 | * Resets the elements previous state. 361 | * 362 | * @method reset 363 | */ 364 | reset : function() { 365 | // Internal reference. 366 | var _self = this; 367 | // Loop through our hidden element collection. 368 | _self.hidden.each( function( i ) { 369 | // Cache this element. 370 | var $elem = $( this ), 371 | _tmp = _self.tmp[ i ]; // Get the stored 'style' value for this element. 372 | 373 | // If the stored value is undefined. 374 | if( _tmp === undefined ) 375 | // Remove the style attribute. 376 | $elem.removeAttr( 'style' ); 377 | else 378 | // Otherwise, reset the element style attribute. 379 | $elem.attr( 'style', _tmp ); 380 | 381 | }); 382 | // Reset the tmp array. 383 | _self.tmp = []; 384 | // Reset the hidden elements variable. 385 | _self.hidden = null; 386 | 387 | } // end reset 388 | 389 | }, 390 | 391 | off : function () { 392 | $(this.scope).off('.fndtn.forms'); 393 | } 394 | }; 395 | }(Foundation.zj, this, this.document)); 396 | -------------------------------------------------------------------------------- /js/foundation/foundation.joyride.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.joyride = { 7 | name: 'joyride', 8 | 9 | version : '4.0.0', 10 | 11 | defaults : { 12 | tipLocation : 'bottom', // 'top' or 'bottom' in relation to parent 13 | nubPosition : 'auto', // override on a per tooltip bases 14 | scrollSpeed : 300, // Page scrolling speed in milliseconds 15 | timer : 0, // 0 = no timer , all other numbers = timer in milliseconds 16 | startTimerOnClick : true, // true or false - true requires clicking the first button start the timer 17 | startOffset : 0, // the index of the tooltip you want to start on (index of the li) 18 | nextButton : true, // true or false to control whether a next button is used 19 | tipAnimation : 'fade', // 'pop' or 'fade' in each tip 20 | pauseAfter : [], // array of indexes where to pause the tour after 21 | tipAnimationFadeSpeed: 300, // when tipAnimation = 'fade' this is speed in milliseconds for the transition 22 | cookieMonster : false, // true or false to control whether cookies are used 23 | cookieName : 'joyride', // Name the cookie you'll use 24 | cookieDomain : false, // Will this cookie be attached to a domain, ie. '.notableapp.com' 25 | cookieExpires : 365, // set when you would like the cookie to expire. 26 | tipContainer : 'body', // Where will the tip be attached 27 | postRideCallback : function (){}, // A method to call once the tour closes (canceled or complete) 28 | postStepCallback : function (){}, // A method to call after each step 29 | template : { // HTML segments for tip layout 30 | link : '×', 31 | timer : '
        ', 32 | tip : '
        ', 33 | wrapper : '
        ', 34 | button : '' 35 | } 36 | }, 37 | 38 | settings : {}, 39 | 40 | init : function (scope, method, options) { 41 | this.scope = scope || this.scope; 42 | Foundation.inherit(this, 'throttle data_options scrollTo scrollLeft delay'); 43 | 44 | if (typeof method === 'object') { 45 | $.extend(true, this.settings, this.defaults, method); 46 | } else { 47 | $.extend(true, this.settings, this.defaults, options); 48 | } 49 | 50 | if (typeof method != 'string') { 51 | if (!this.settings.init) this.events(); 52 | 53 | return this.settings.init; 54 | } else { 55 | return this[method].call(this, options); 56 | } 57 | }, 58 | 59 | events : function () { 60 | var self = this; 61 | 62 | $(this.scope) 63 | .on('click.joyride', '.joyride-next-tip, .joyride-modal-bg', function (e) { 64 | e.preventDefault(); 65 | 66 | if (this.settings.$li.next().length < 1) { 67 | this.end(); 68 | } else if (this.settings.timer > 0) { 69 | clearTimeout(this.settings.automate); 70 | this.hide(); 71 | this.show(); 72 | this.startTimer(); 73 | } else { 74 | this.hide(); 75 | this.show(); 76 | } 77 | 78 | }.bind(this)) 79 | 80 | .on('click.joyride', '.joyride-close-tip', function (e) { 81 | e.preventDefault(); 82 | this.end(); 83 | }.bind(this)); 84 | 85 | $(window).on('resize.fndtn.joyride', self.throttle(function () { 86 | if ($('[data-joyride]').length > 0 && self.settings.$next_tip) { 87 | if (self.is_phone()) { 88 | self.pos_phone(); 89 | } else { 90 | self.pos_default(); 91 | } 92 | } 93 | }, 100)); 94 | 95 | this.settings.init = true; 96 | }, 97 | 98 | start : function () { 99 | var self = this, 100 | $this = $(this.scope).find('[data-joyride]'), 101 | integer_settings = ['timer', 'scrollSpeed', 'startOffset', 'tipAnimationFadeSpeed', 'cookieExpires'], 102 | int_settings_count = integer_settings.length; 103 | 104 | if (!this.settings.init) this.init(); 105 | $.extend(true, this.settings, this.data_options($this)); 106 | 107 | // non configureable settings 108 | this.settings.$content_el = $this; 109 | this.settings.body_offset = $(this.settings.tipContainer).position(); 110 | this.settings.$tip_content = this.settings.$content_el.find('> li'); 111 | this.settings.paused = false; 112 | this.settings.attempts = 0; 113 | 114 | // Make sure that settings parsed from data_options are integers where necessary 115 | for (var i = int_settings_count - 1; i >= 0; i--) { 116 | this.settings[integer_settings[i]] = parseInt(this.settings[integer_settings[i]], 10); 117 | } 118 | 119 | this.settings.tipLocationPatterns = { 120 | top: ['bottom'], 121 | bottom: [], // bottom should not need to be repositioned 122 | left: ['right', 'top', 'bottom'], 123 | right: ['left', 'top', 'bottom'] 124 | }; 125 | 126 | // can we create cookies? 127 | if (typeof $.cookie !== 'function') { 128 | this.settings.cookieMonster = false; 129 | } 130 | 131 | // generate the tips and insert into dom. 132 | if (!this.settings.cookieMonster || this.settings.cookieMonster && $.cookie(this.settings.cookieName) === null) { 133 | 134 | this.settings.$tip_content.each(function (index) { 135 | self.create({$li : $(this), index : index}); 136 | }); 137 | 138 | // show first tip 139 | if (!this.settings.startTimerOnClick && this.settings.timer > 0) { 140 | this.show('init'); 141 | this.startTimer(); 142 | } else { 143 | this.show('init'); 144 | } 145 | 146 | } 147 | }, 148 | 149 | resume : function () { 150 | this.set_li(); 151 | this.show(); 152 | }, 153 | 154 | tip_template : function (opts) { 155 | var $blank, content; 156 | 157 | opts.tip_class = opts.tip_class || ''; 158 | 159 | $blank = $(this.settings.template.tip).addClass(opts.tip_class); 160 | content = $.trim($(opts.li).html()) + 161 | this.button_text(opts.button_text) + 162 | this.settings.template.link + 163 | this.timer_instance(opts.index); 164 | 165 | $blank.append($(this.settings.template.wrapper)); 166 | $blank.first().attr('data-index', opts.index); 167 | $('.joyride-content-wrapper', $blank).append(content); 168 | 169 | return $blank[0]; 170 | }, 171 | 172 | timer_instance : function (index) { 173 | var txt; 174 | 175 | if ((index === 0 && this.settings.startTimerOnClick && this.settings.timer > 0) || this.settings.timer === 0) { 176 | txt = ''; 177 | } else { 178 | txt = this.outerHTML($(this.settings.template.timer)[0]); 179 | } 180 | return txt; 181 | }, 182 | 183 | button_text : function (txt) { 184 | if (this.settings.nextButton) { 185 | txt = $.trim(txt) || 'Next'; 186 | txt = this.outerHTML($(this.settings.template.button).append(txt)[0]); 187 | } else { 188 | txt = ''; 189 | } 190 | return txt; 191 | }, 192 | 193 | create : function (opts) { 194 | // backwards compatability with data-text attribute 195 | var buttonText = opts.$li.attr('data-button') || opts.$li.attr('data-text'), 196 | tipClass = opts.$li.attr('class'), 197 | $tip_content = $(this.tip_template({ 198 | tip_class : tipClass, 199 | index : opts.index, 200 | button_text : buttonText, 201 | li : opts.$li 202 | })); 203 | 204 | $(this.settings.tipContainer).append($tip_content); 205 | }, 206 | 207 | show : function (init) { 208 | var $timer = null; 209 | 210 | // are we paused? 211 | if (this.settings.$li === undefined 212 | || ($.inArray(this.settings.$li.index(), this.settings.pauseAfter) === -1)) { 213 | 214 | // don't go to the next li if the tour was paused 215 | if (this.settings.paused) { 216 | this.settings.paused = false; 217 | } else { 218 | this.set_li(init); 219 | } 220 | 221 | this.settings.attempts = 0; 222 | 223 | if (this.settings.$li.length && this.settings.$target.length > 0) { 224 | 225 | this.settings.tipSettings = $.extend(true, 226 | this.settings, this.data_options(this.settings.$li)); 227 | 228 | this.settings.timer = parseInt(this.settings.timer, 10); 229 | 230 | this.settings.tipSettings.tipLocationPattern = this.settings.tipLocationPatterns[this.settings.tipSettings.tipLocation]; 231 | 232 | // scroll if not modal 233 | if (!/body/i.test(this.settings.$target.selector)) { 234 | this.scroll_to(); 235 | } 236 | 237 | if (this.is_phone()) { 238 | this.pos_phone(true); 239 | } else { 240 | this.pos_default(true); 241 | } 242 | 243 | $timer = this.settings.$next_tip.find('.joyride-timer-indicator'); 244 | 245 | if (/pop/i.test(this.settings.tipAnimation)) { 246 | 247 | $timer.width(0); 248 | 249 | if (thsi.settings.timer > 0) { 250 | 251 | this.settings.$next_tip.show(); 252 | 253 | this.delay(function () { 254 | $timer.animate({ 255 | width: $timer.parent().width() 256 | }, this.settings.timer, 'linear'); 257 | }.bind(this), this.settings.tipAnimationFadeSpeed); 258 | 259 | } else { 260 | this.settings.$next_tip.show(); 261 | 262 | } 263 | 264 | 265 | } else if (/fade/i.test(this.settings.tipAnimation)) { 266 | 267 | $timer.width(0); 268 | 269 | if (this.settings.timer > 0) { 270 | 271 | this.settings.$next_tip 272 | .fadeIn(this.settings.tipAnimationFadeSpeed) 273 | .show(); 274 | 275 | this.delay(function () { 276 | $timer.animate({ 277 | width: $timer.parent().width() 278 | }, this.settings.timer, 'linear'); 279 | }.bind(this), this.settings.tipAnimationFadeSpeed); 280 | 281 | } else { 282 | this.settings.$next_tip.fadeIn(this.settings.tipAnimationFadeSpeed); 283 | 284 | } 285 | } 286 | 287 | this.settings.$current_tip = this.settings.$next_tip; 288 | 289 | // skip non-existant targets 290 | } else if (this.settings.$li && this.settings.$target.length < 1) { 291 | 292 | this.show(); 293 | 294 | } else { 295 | 296 | this.end(); 297 | 298 | } 299 | } else { 300 | 301 | this.settings.paused = true; 302 | 303 | } 304 | 305 | }, 306 | 307 | is_phone : function () { 308 | if (Modernizr) { 309 | return Modernizr.mq('only screen and (max-width: 767px)') || $('.lt-ie9').length > 0; 310 | } 311 | 312 | return (this.settings.$window.width() < 767) ? true : false; 313 | }, 314 | 315 | hide : function () { 316 | this.settings.postStepCallback(this.settings.$li.index(), 317 | this.settings.$current_tip); 318 | $('.joyride-modal-bg').hide(); 319 | this.settings.$current_tip.hide(); 320 | }, 321 | 322 | set_li : function (init) { 323 | if (init) { 324 | this.settings.$li = this.settings.$tip_content.eq(this.settings.startOffset); 325 | this.set_next_tip(); 326 | this.settings.$current_tip = this.settings.$next_tip; 327 | } else { 328 | this.settings.$li = this.settings.$li.next(); 329 | this.set_next_tip(); 330 | } 331 | 332 | this.set_target(); 333 | }, 334 | 335 | set_next_tip : function () { 336 | this.settings.$next_tip = $(".joyride-tip-guide[data-index='" + this.settings.$li.index() + "']"); 337 | this.settings.$next_tip.data('closed', ''); 338 | }, 339 | 340 | set_target : function () { 341 | var cl = this.settings.$li.attr('data-class'), 342 | id = this.settings.$li.attr('data-id'), 343 | $sel = function () { 344 | if (id) { 345 | return $(document.getElementById(id)); 346 | } else if (cl) { 347 | return $('.' + cl).first(); 348 | } else { 349 | return $('body'); 350 | } 351 | }; 352 | 353 | this.settings.$target = $sel(); 354 | }, 355 | 356 | scroll_to : function () { 357 | var window_half, tipOffset; 358 | 359 | window_half = $(window).height() / 2; 360 | tipOffset = Math.ceil(this.settings.$target.offset().top - window_half + this.outerHeight(this.settings.$next_tip)); 361 | if (tipOffset > 0) { 362 | this.scrollTo($('html, body'), tipOffset, this.settings.scrollSpeed); 363 | } 364 | }, 365 | 366 | paused : function () { 367 | if (($.inArray((this.settings.$li.index() + 1), this.settings.pauseAfter) === -1)) { 368 | return true; 369 | } 370 | 371 | return false; 372 | }, 373 | 374 | restart : function () { 375 | this.hide(); 376 | this.settings.$li = undefined; 377 | this.show('init'); 378 | }, 379 | 380 | pos_default : function (init) { 381 | var half_fold = Math.ceil($(window).height() / 2), 382 | tip_position = this.settings.$next_tip.offset(), 383 | $nub = this.settings.$next_tip.find('.joyride-nub'), 384 | nub_height = Math.ceil(this.outerHeight($nub) / 2), 385 | toggle = init || false; 386 | 387 | // tip must not be "display: none" to calculate position 388 | if (toggle) { 389 | this.settings.$next_tip.css('visibility', 'hidden'); 390 | this.settings.$next_tip.show(); 391 | } 392 | 393 | if (!/body/i.test(this.settings.$target.selector)) { 394 | 395 | if (this.bottom()) { 396 | this.settings.$next_tip.css({ 397 | top: (this.settings.$target.offset().top + nub_height + this.outerHeight(this.settings.$target)), 398 | left: this.settings.$target.offset().left}); 399 | 400 | this.nub_position($nub, this.settings.tipSettings.nubPosition, 'top'); 401 | 402 | } else if (this.top()) { 403 | 404 | this.settings.$next_tip.css({ 405 | top: (this.settings.$target.offset().top - this.outerHeight(this.settings.$next_tip) - nub_height), 406 | left: this.settings.$target.offset().left}); 407 | 408 | this.nub_position($nub, this.settings.tipSettings.nubPosition, 'bottom'); 409 | 410 | } else if (this.right()) { 411 | 412 | this.settings.$next_tip.css({ 413 | top: this.settings.$target.offset().top, 414 | left: (this.outerWidth(this.settings.$target) + this.settings.$target.offset().left)}); 415 | 416 | this.nub_position($nub, this.settings.tipSettings.nubPosition, 'left'); 417 | 418 | } else if (this.left()) { 419 | 420 | this.settings.$next_tip.css({ 421 | top: this.settings.$target.offset().top, 422 | left: (this.settings.$target.offset().left - this.outerWidth(this.settings.$next_tip) - nub_height)}); 423 | 424 | this.nub_position($nub, this.settings.tipSettings.nubPosition, 'right'); 425 | 426 | } 427 | 428 | if (!this.visible(this.corners(this.settings.$next_tip)) && this.settings.attempts < this.settings.tipSettings.tipLocationPattern.length) { 429 | 430 | $nub.removeClass('bottom') 431 | .removeClass('top') 432 | .removeClass('right') 433 | .removeClass('left'); 434 | 435 | this.settings.tipSettings.tipLocation = this.settings.tipSettings.tipLocationPattern[this.settings.attempts]; 436 | 437 | this.settings.attempts++; 438 | 439 | this.pos_default(true); 440 | 441 | } 442 | 443 | } else if (this.settings.$li.length) { 444 | 445 | this.pos_modal($nub); 446 | 447 | } 448 | 449 | if (toggle) { 450 | this.settings.$next_tip.hide(); 451 | this.settings.$next_tip.css('visibility', 'visible'); 452 | } 453 | 454 | }, 455 | 456 | pos_phone : function (init) { 457 | var tip_height = this.outerHeight(this.settings.$next_tip), 458 | tip_offset = this.settings.$next_tip.offset(), 459 | target_height = this.outerHeight(this.settings.$target), 460 | $nub = $('.joyride-nub', this.settings.$next_tip), 461 | nub_height = Math.ceil(this.outerHeight($nub) / 2), 462 | toggle = init || false; 463 | 464 | $nub.removeClass('bottom') 465 | .removeClass('top') 466 | .removeClass('right') 467 | .removeClass('left'); 468 | 469 | if (toggle) { 470 | this.settings.$next_tip.css('visibility', 'hidden'); 471 | this.settings.$next_tip.show(); 472 | } 473 | 474 | if (!/body/i.test(this.settings.$target.selector)) { 475 | 476 | if (this.top()) { 477 | 478 | this.settings.$next_tip.offset({top: this.settings.$target.offset().top - tip_height - nub_height}); 479 | $nub.addClass('bottom'); 480 | 481 | } else { 482 | 483 | this.settings.$next_tip.offset({top: this.settings.$target.offset().top + target_height + nub_height}); 484 | $nub.addClass('top'); 485 | 486 | } 487 | 488 | } else if (this.settings.$li.length) { 489 | this.pos_modal($nub); 490 | } 491 | 492 | if (toggle) { 493 | this.settings.$next_tip.hide(); 494 | this.settings.$next_tip.css('visibility', 'visible'); 495 | } 496 | }, 497 | 498 | pos_modal : function ($nub) { 499 | this.center(); 500 | $nub.hide(); 501 | if (!this.settings.$next_tip.data('closed')) { 502 | if ($('.joyride-modal-bg').length < 1) { 503 | $('body').append('
        ').show(); 504 | } 505 | 506 | if (/pop/i.test(this.settings.tipAnimation)) { 507 | $('.joyride-modal-bg').show(); 508 | } else { 509 | $('.joyride-modal-bg').fadeIn(this.settings.tipAnimationFadeSpeed); 510 | } 511 | } 512 | }, 513 | 514 | center : function () { 515 | var $w = $(window); 516 | 517 | this.settings.$next_tip.css({ 518 | top : ((($w.height() - this.outerHeight(this.settings.$next_tip)) / 2) + $w.scrollTop()), 519 | left : ((($w.width() - this.outerWidth(this.settings.$next_tip)) / 2) + this.scrollLeft($w)) 520 | }); 521 | 522 | return true; 523 | }, 524 | 525 | bottom : function () { 526 | return /bottom/i.test(this.settings.tipSettings.tipLocation); 527 | }, 528 | 529 | top : function () { 530 | return /top/i.test(this.settings.tipSettings.tipLocation); 531 | }, 532 | 533 | right : function () { 534 | return /right/i.test(this.settings.tipSettings.tipLocation); 535 | }, 536 | 537 | left : function () { 538 | return /left/i.test(this.settings.tipSettings.tipLocation); 539 | }, 540 | 541 | corners : function (el) { 542 | var w = $(window), 543 | right = w.width() + this.scrollLeft(w), 544 | bottom = w.width() + w.scrollTop(); 545 | 546 | return [ 547 | el.offset().top <= w.scrollTop(), 548 | right <= el.offset().left + this.outerWidth(el), 549 | bottom <= el.offset().top + this.outerHeight(el), 550 | this.scrollLeft(w) >= el.offset().left 551 | ]; 552 | }, 553 | 554 | visible : function (hidden_corners) { 555 | var i = hidden_corners.length; 556 | 557 | while (i--) { 558 | if (hidden_corners[i]) return false; 559 | } 560 | 561 | return true; 562 | }, 563 | 564 | nub_position : function (nub, pos, def) { 565 | if (pos === 'auto') { 566 | nub.addClass(def); 567 | } else { 568 | nub.addClass(pos); 569 | } 570 | }, 571 | 572 | startTimer : function () { 573 | if (this.settings.$li.length) { 574 | this.settings.automate = setTimeout(function () { 575 | this.hide(); 576 | this.show(); 577 | this.startTimer(); 578 | }.bind(this), this.settings.timer); 579 | } else { 580 | clearTimeout(this.settings.automate); 581 | } 582 | }, 583 | 584 | end : function () { 585 | if (this.settings.cookieMonster) { 586 | $.cookie(this.settings.cookieName, 'ridden', { expires: this.settings.cookieExpires, domain: this.settings.cookieDomain }); 587 | } 588 | 589 | if (this.settings.timer > 0) { 590 | clearTimeout(this.settings.automate); 591 | } 592 | 593 | this.settings.$next_tip.data('closed', true); 594 | 595 | $('.joyride-modal-bg').hide(); 596 | this.settings.$current_tip.hide(); 597 | this.settings.postStepCallback(this.settings.$li.index(), this.settings.$current_tip); 598 | this.settings.postRideCallback(this.settings.$li.index(), this.settings.$current_tip); 599 | }, 600 | 601 | outerHTML : function (el) { 602 | // support FireFox < 11 603 | return el.outerHTML || new XMLSerializer().serializeToString(el); 604 | }, 605 | 606 | off : function () { 607 | $(this.scope).off('.joyride'); 608 | $(window).off('.joyride'); 609 | $('.joyride-close-tip, .joyride-next-tip, .joyride-modal-bg').off('.joyride'); 610 | $('.joyride-tip-guide, .joyride-modal-bg').remove(); 611 | clearTimeout(this.settings.automate); 612 | this.settings = {}; 613 | } 614 | }; 615 | }(Foundation.zj, this, this.document)); 616 | -------------------------------------------------------------------------------- /js/foundation/foundation.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Foundation Responsive Library 3 | * http://foundation.zurb.com 4 | * Copyright 2013, ZURB 5 | * Free to use under the MIT license. 6 | * http://www.opensource.org/licenses/mit-license.php 7 | */ 8 | 9 | /*jslint unparam: true, browser: true, indent: 2 */ 10 | 11 | (function () { 12 | // add dusty browser stuff 13 | if (!Array.prototype.filter) { 14 | Array.prototype.filter = function(fun /*, thisp */) { 15 | "use strict"; 16 | 17 | if (this == null) { 18 | throw new TypeError(); 19 | } 20 | 21 | var t = Object(this), 22 | len = t.length >>> 0; 23 | if (typeof fun != "function") { 24 | try { 25 | throw new TypeError(); 26 | } catch (e) { 27 | return; 28 | } 29 | } 30 | 31 | var res = [], 32 | thisp = arguments[1]; 33 | for (var i = 0; i < len; i++) { 34 | if (i in t) { 35 | var val = t[i]; // in case fun mutates this 36 | if (fun && fun.call(thisp, val, i, t)) { 37 | res.push(val); 38 | } 39 | } 40 | } 41 | 42 | return res; 43 | }; 44 | 45 | if (!Function.prototype.bind) { 46 | Function.prototype.bind = function (oThis) { 47 | if (typeof this !== "function") { 48 | // closest thing possible to the ECMAScript 5 internal IsCallable function 49 | throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); 50 | } 51 | 52 | var aArgs = Array.prototype.slice.call(arguments, 1), 53 | fToBind = this, 54 | fNOP = function () {}, 55 | fBound = function () { 56 | return fToBind.apply(this instanceof fNOP && oThis 57 | ? this 58 | : oThis, 59 | aArgs.concat(Array.prototype.slice.call(arguments))); 60 | }; 61 | 62 | fNOP.prototype = this.prototype; 63 | fBound.prototype = new fNOP(); 64 | 65 | return fBound; 66 | }; 67 | } 68 | } 69 | 70 | // fake stop() for zepto. 71 | $.fn.stop = $.fn.stop || function() { 72 | return this; 73 | }; 74 | }()); 75 | 76 | ;(function (window, document, undefined) { 77 | 'use strict'; 78 | 79 | window.Foundation = { 80 | name : 'Foundation', 81 | 82 | version : '4.0.0', 83 | 84 | // global Foundation cache object 85 | cache : {}, 86 | 87 | init : function (scope, libraries, method, options, response, /* internal */ nc) { 88 | var library_arr, 89 | args = [scope, method, options, response], 90 | responses = [], 91 | nc = nc || false; 92 | 93 | // disable library error catching, 94 | // used for development only 95 | if (nc) this.nc = nc; 96 | 97 | // set foundation global scope 98 | this.scope = scope || this.scope; 99 | 100 | if (libraries && typeof libraries === 'string') { 101 | if (/off/i.test(libraries)) return this.off(); 102 | 103 | library_arr = libraries.split(' '); 104 | 105 | if (library_arr.length > 0) { 106 | for (var i = library_arr.length - 1; i >= 0; i--) { 107 | responses.push(this.init_lib(library_arr[i], args)); 108 | } 109 | } 110 | } else { 111 | for (var lib in this.libs) { 112 | responses.push(this.init_lib(lib, args)); 113 | } 114 | } 115 | 116 | // if first argument is callback, add to args 117 | if (typeof libraries === 'function') { 118 | args.unshift(libraries); 119 | } 120 | 121 | return this.response_obj(responses, args); 122 | }, 123 | 124 | response_obj : function (response_arr, args) { 125 | for (var callback in args) { 126 | if (typeof args[callback] === 'function') { 127 | return args[callback]({ 128 | errors: response_arr.filter(function (s) { 129 | if (typeof s === 'string') return s; 130 | }) 131 | }); 132 | } 133 | } 134 | 135 | return response_arr; 136 | }, 137 | 138 | init_lib : function (lib, args) { 139 | return this.trap(function () { 140 | if (this.libs.hasOwnProperty(lib)) { 141 | this.patch(this.libs[lib]); 142 | return this.libs[lib].init.apply(this.libs[lib], args); 143 | } 144 | }.bind(this), lib); 145 | }, 146 | 147 | trap : function (fun, lib) { 148 | if (!this.nc) { 149 | try { 150 | return fun(); 151 | } catch (e) { 152 | return this.error({name: lib, message: 'could not be initialized', more: e.name + ' ' + e.message}); 153 | } 154 | } 155 | 156 | return fun(); 157 | }, 158 | 159 | patch : function (lib) { 160 | this.fix_outer(lib); 161 | }, 162 | 163 | inherit : function (scope, methods) { 164 | var methods_arr = methods.split(' '); 165 | 166 | for (var i = methods_arr.length - 1; i >= 0; i--) { 167 | if (this.lib_methods.hasOwnProperty(methods_arr[i])) { 168 | this.libs[scope.name][methods_arr[i]] = this.lib_methods[methods_arr[i]]; 169 | } 170 | } 171 | }, 172 | 173 | libs : {}, 174 | 175 | // methods that can be inherited in libraries 176 | lib_methods : { 177 | set_data : function (node, data) { 178 | // this.name references the name of the library calling this method 179 | var id = this.name + (+new Date()); 180 | 181 | Foundation.cache[id] = data; 182 | node.attr('data-' + this.name + '-id', id); 183 | }, 184 | 185 | get_data : function (node) { 186 | return Foundation.cache[node.attr('data-' + this.name + '-id')]; 187 | }, 188 | 189 | remove_data : function (node) { 190 | if (node) { 191 | delete Foundation.cache[node.attr('data-' + this.name + '-id')]; 192 | node.attr('data-' + this.name + '-id', ''); 193 | } else { 194 | $('[data-' + this.name + '-id]').each(function () { 195 | delete Foundation.cache[$(this).attr('data-' + this.name + '-id')]; 196 | $(this).attr('data-' + this.name + '-id', ''); 197 | }); 198 | } 199 | }, 200 | 201 | throttle : function(fun, delay) { 202 | var timer = null; 203 | return function () { 204 | var context = this, args = arguments; 205 | clearTimeout(timer); 206 | timer = setTimeout(function () { 207 | fun.apply(context, args); 208 | }, delay); 209 | }; 210 | }, 211 | 212 | // parses dat-options attribute on page nodes and turns 213 | // them into an object 214 | data_options : function (el) { 215 | var opts = {}, ii, p, 216 | opts_arr = (el.attr('data-options') || ':').split(';'), 217 | opts_len = opts_arr.length; 218 | 219 | function trim(str) { 220 | if (typeof str === 'string') return $.trim(str); 221 | return str; 222 | } 223 | 224 | // parse options 225 | for (ii = opts_len - 1; ii >= 0; ii--) { 226 | p = opts_arr[ii].split(':'); 227 | 228 | if (/true/i.test(p[1])) p[1] = true; 229 | if (/false/i.test(p[1])) p[1] = false; 230 | 231 | if (p.length === 2) { 232 | opts[trim(p[0])] = trim(p[1]); 233 | } 234 | } 235 | 236 | return opts; 237 | }, 238 | 239 | delay : function (fun, delay) { 240 | return setTimeout(fun, delay); 241 | }, 242 | 243 | // animated scrolling 244 | scrollTo : function (el, to, duration) { 245 | if (duration < 0) return; 246 | var difference = to - $(window).scrollTop(); 247 | var perTick = difference / duration * 10; 248 | 249 | this.scrollToTimerCache = setTimeout(function() { 250 | if (!isNaN(parseInt(perTick, 10))) { 251 | window.scrollTo(0, $(window).scrollTop() + perTick); 252 | this.scrollTo(el, to, duration - 10); 253 | } 254 | }.bind(this), 10); 255 | }, 256 | 257 | // not supported in core Zepto 258 | scrollLeft : function (el) { 259 | if (!el.length) return; 260 | return ('scrollLeft' in el[0]) ? el[0].scrollLeft : el[0].pageXOffset; 261 | }, 262 | 263 | // test for empty object or array 264 | empty : function (obj) { 265 | if (obj.length && obj.length > 0) return false; 266 | if (obj.length && obj.length === 0) return true; 267 | 268 | for (var key in obj) { 269 | if (hasOwnProperty.call(obj, key)) return false; 270 | } 271 | 272 | return true; 273 | } 274 | }, 275 | 276 | fix_outer : function (lib) { 277 | lib.outerHeight = function (el, bool) { 278 | if (typeof Zepto === 'function') { 279 | return el.height(); 280 | } 281 | 282 | if (typeof bool !== 'undefined') { 283 | return el.outerHeight(bool); 284 | } 285 | 286 | return el.outerHeight(); 287 | }; 288 | 289 | lib.outerWidth = function (el) { 290 | if (typeof Zepto === 'function') { 291 | return el.width(); 292 | } 293 | 294 | if (typeof bool !== 'undefined') { 295 | return el.outerWidth(bool); 296 | } 297 | 298 | return el.outerWidth(); 299 | }; 300 | }, 301 | 302 | error : function (error) { 303 | return error.name + ' ' + error.message + '; ' + error.more; 304 | }, 305 | 306 | // remove all foundation events. 307 | off: function () { 308 | $(this.scope).off('.fndtn'); 309 | $(window).off('.fndtn'); 310 | return true; 311 | }, 312 | 313 | zj : function () { 314 | try { 315 | return Zepto; 316 | } catch (e) { 317 | return jQuery; 318 | } 319 | }() 320 | }, 321 | 322 | $.fn.foundation = function () { 323 | var args = Array.prototype.slice.call(arguments, 0); 324 | 325 | return this.each(function () { 326 | Foundation.init.apply(Foundation, [this].concat(args)); 327 | return this; 328 | }); 329 | }; 330 | 331 | }(this, this.document)); 332 | -------------------------------------------------------------------------------- /js/foundation/foundation.magellan.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.magellan = { 7 | name : 'magellan', 8 | 9 | version : '4.0.0', 10 | 11 | settings : { 12 | activeClass: 'active' 13 | }, 14 | 15 | init : function (scope, method, options) { 16 | this.scope = scope || this.scope; 17 | Foundation.inherit(this, 'data_options'); 18 | 19 | if (typeof method === 'object') { 20 | $.extend(true, this.settings, method); 21 | } 22 | 23 | if (typeof method != 'string') { 24 | if (!this.settings.init) { 25 | this.fixed_magellan = $("[data-magellan-expedition]"); 26 | this.set_threshold(); 27 | this.last_destination = $('[data-magellan-destination]').last(); 28 | this.events(); 29 | } 30 | 31 | return this.settings.init; 32 | } else { 33 | return this[method].call(this, options); 34 | } 35 | }, 36 | 37 | events : function () { 38 | var self = this; 39 | $(this.scope).on('arrival.fndtn.magellan', '[data-magellan-arrival]', function (e) { 40 | var $destination = $(this), 41 | $expedition = $destination.closest('[data-magellan-expedition]'), 42 | activeClass = $expedition.attr('data-magellan-active-class') 43 | || self.settings.activeClass; 44 | 45 | $destination 46 | .closest('[data-magellan-expedition]') 47 | .find('[data-magellan-arrival]') 48 | .not($destination) 49 | .removeClass(activeClass); 50 | $destination.addClass(activeClass); 51 | }); 52 | 53 | this.fixed_magellan 54 | .on('update-position.fndtn.magellan', function(){ 55 | var $el = $(this); 56 | // $el.data("magellan-fixed-position",""); 57 | //$el.data("magellan-top-offset", ""); 58 | }) 59 | .trigger('update-position'); 60 | 61 | $(window) 62 | .on('resize.fndtn.magellan', function() { 63 | this.fixed_magellan.trigger('update-position'); 64 | }.bind(this)) 65 | 66 | .on('scroll.fndtn.magellan', function() { 67 | var windowScrollTop = $(window).scrollTop(); 68 | self.fixed_magellan.each(function() { 69 | var $expedition = $(this); 70 | if (typeof $expedition.data('magellan-top-offset') === 'undefined') { 71 | $expedition.data('magellan-top-offset', $expedition.offset().top); 72 | } 73 | if (typeof $expedition.data('magellan-fixed-position') === 'undefined') { 74 | $expedition.data('magellan-fixed-position', false) 75 | } 76 | var fixed_position = (windowScrollTop + self.settings.threshold) > $expedition.data("magellan-top-offset"); 77 | var attr = $expedition.attr('data-magellan-top-offset'); 78 | 79 | if ($expedition.data("magellan-fixed-position") != fixed_position) { 80 | $expedition.data("magellan-fixed-position", fixed_position); 81 | if (fixed_position) { 82 | $expedition.css({position:"fixed", top:0}); 83 | } else { 84 | $expedition.css({position:"", top:""}); 85 | } 86 | if (fixed_position && typeof attr != 'undefined' && attr != false) { 87 | $expedition.css({position:"fixed", top:attr + "px"}); 88 | } 89 | } 90 | }); 91 | }); 92 | 93 | 94 | if (this.last_destination.length > 0) { 95 | $(window).on('scroll.fndtn.magellan', function (e) { 96 | var windowScrollTop = $(window).scrollTop(), 97 | scrolltopPlusHeight = windowScrollTop + $(window).height(), 98 | lastDestinationTop = Math.ceil(self.last_destination.offset().top); 99 | 100 | $('[data-magellan-destination]').each(function () { 101 | var $destination = $(this), 102 | destination_name = $destination.attr('data-magellan-destination'), 103 | topOffset = $destination.offset().top - windowScrollTop; 104 | 105 | if (topOffset <= self.settings.threshold) { 106 | $("[data-magellan-arrival='" + destination_name + "']").trigger('arrival'); 107 | } 108 | // In large screens we may hit the bottom of the page and dont reach the top of the last magellan-destination, so lets force it 109 | if (scrolltopPlusHeight >= $(self.scope).height() && lastDestinationTop > windowScrollTop && lastDestinationTop < scrolltopPlusHeight) { 110 | $('[data-magellan-arrival]').last().trigger('arrival'); 111 | } 112 | }); 113 | }); 114 | } 115 | 116 | this.settings.init = true; 117 | }, 118 | 119 | set_threshold : function () { 120 | if (!this.settings.threshold) { 121 | this.settings.threshold = (this.fixed_magellan.length > 0) ? 122 | this.outerHeight(this.fixed_magellan, true) : 0; 123 | } 124 | }, 125 | 126 | off : function () { 127 | $(this.scope).off('.fndtn.magellan'); 128 | } 129 | }; 130 | }(Foundation.zj, this, this.document)); 131 | -------------------------------------------------------------------------------- /js/foundation/foundation.orbit.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs = Foundation.libs || {}; 5 | 6 | Foundation.libs.orbit = { 7 | version: '4.0.0', 8 | 9 | settings: { 10 | timer_speed: 10000, 11 | animation_speed: 500, 12 | bullets: true, 13 | stack_on_small: true, 14 | container_class: 'orbit-container', 15 | stack_on_small_class: 'orbit-stack-on-small', 16 | next_class: 'orbit-next', 17 | prev_class: 'orbit-prev', 18 | timer_container_class: 'orbit-timer', 19 | timer_paused_class: 'paused', 20 | timer_progress_class: 'orbit-progress', 21 | slides_container_class: 'orbit-slides-container', 22 | bullets_container_class: 'orbit-bullets', 23 | bullets_active_class: 'active', 24 | slide_number_class: 'orbit-slide-number', 25 | caption_class: 'orbit-caption', 26 | active_slide_class: 'active', 27 | orbit_transition_class: 'orbit-transitioning' 28 | }, 29 | 30 | init: function (scope, method, options) { 31 | var self = this; 32 | 33 | if (typeof method === 'object') { 34 | $.extend(true, self.settings, method); 35 | } 36 | 37 | $('[data-orbit]', scope).each($.proxy(self._init, self)); 38 | }, 39 | 40 | _container_html: function() { 41 | var self = this; 42 | return '
        '; 43 | }, 44 | 45 | _bullets_container_html: function($slides) { 46 | var self = this, 47 | $list = $('
          '); 48 | $slides.each(function(idx, slide) { 49 | var $item = $('
        1. '); 50 | if (idx === 0) { 51 | $item.addClass(self.settings.bullets_active_class); 52 | } 53 | $list.append($item); 54 | }); 55 | return $list; 56 | }, 57 | 58 | _slide_number_html: function(slide_number, total_slides) { 59 | var self = this, 60 | $container = $('
          '); 61 | $container.append('' + slide_number + ' of ' + total_slides + ''); 62 | return $container; 63 | }, 64 | 65 | _timer_html: function() { 66 | var self = this; 67 | if (typeof self.settings.timer_speed === 'number' && self.settings.timer_speed > 0) { 68 | return '
          '; 71 | } else { 72 | return ''; 73 | } 74 | }, 75 | 76 | _next_html: function() { 77 | var self = this; 78 | return 'Next '; 79 | }, 80 | 81 | _prev_html: function() { 82 | var self = this; 83 | return 'Prev '; 84 | }, 85 | 86 | _init: function (idx, slider) { 87 | var self = this, 88 | $slides_container = $(slider), 89 | $container = $slides_container.wrap(self._container_html()).parent(), 90 | $slides = $slides_container.children(); 91 | 92 | $container.append(self._prev_html()); 93 | $container.append(self._next_html()); 94 | $slides_container.addClass(self.settings.slides_container_class); 95 | if (self.settings.stack_on_small) { 96 | $container.addClass(self.settings.stack_on_small_class); 97 | } 98 | $container.append(self._slide_number_html(1, $slides.length)); 99 | $container.append(self._timer_html()); 100 | if (self.settings.bullets) { 101 | $container.after(self._bullets_container_html($slides)); 102 | } 103 | // To better support the "sliding" effect it's easier 104 | // if we just clone the first and last slides 105 | $slides_container.append($slides.first().clone().attr('data-orbit-slide','')); 106 | $slides_container.prepend($slides.last().clone().attr('data-orbit-slide','')); 107 | // Make the first "real" slide active 108 | $slides_container.css('marginLeft', '-100%'); 109 | $slides.first().addClass(self.settings.active_slide_class); 110 | 111 | self._init_events($slides_container); 112 | self._init_dimensions($slides_container); 113 | self._start_timer($slides_container); 114 | }, 115 | 116 | _init_events: function ($slides_container) { 117 | var self = this, 118 | $container = $slides_container.parent(); 119 | 120 | $(window) 121 | .on('load.fndtn.orbit', function() { 122 | $slides_container.height(''); 123 | $slides_container.height($slides_container.height($container.height())); 124 | $slides_container.trigger('orbit:ready'); 125 | }) 126 | .on('resize.fndtn.orbit', function() { 127 | $slides_container.height(''); 128 | $slides_container.height($slides_container.height($container.height())); 129 | }); 130 | 131 | $(document).on('click.fndtn.orbit', '[data-orbit-link]', function(e) { 132 | e.preventDefault(); 133 | var id = $(e.currentTarget).attr('data-orbit-link'), 134 | $slide = $slides_container.find('[data-orbit-slide=' + id + ']').first(); 135 | 136 | if ($slide.length === 1) { 137 | self._reset_timer($slides_container, true); 138 | self.goto($slides_container, $slide.index(), function() {}); 139 | } 140 | }); 141 | 142 | $container.siblings('.' + self.settings.bullets_container_class) 143 | .on('click.fndtn.orbit', '[data-orbit-slide-number]', function(e) { 144 | e.preventDefault(); 145 | self._reset_timer($slides_container, true); 146 | self.goto($slides_container, $(e.currentTarget).data('orbit-slide-number'),function() {}); 147 | }); 148 | 149 | $container 150 | .on('orbit:after-slide-change.fndtn.orbit', function(e, orbit) { 151 | var $slide_number = $container.find('.' + self.settings.slide_number_class); 152 | 153 | if ($slide_number.length === 1) { 154 | $slide_number.replaceWith(self._slide_number_html(orbit.slide_number, orbit.total_slides)); 155 | } 156 | }) 157 | .on('orbit:next-slide.fndtn.orbit click.fndtn.orbit', '.' + self.settings.next_class, function(e) { 158 | e.preventDefault(); 159 | self._reset_timer($slides_container, true); 160 | self.goto($slides_container, 'next', function() {}); 161 | }) 162 | .on('orbit:prev-slide.fndtn.orbit click.fndtn.orbit', '.' + self.settings.prev_class, function(e) { 163 | e.preventDefault(); 164 | self._reset_timer($slides_container, true); 165 | self.goto($slides_container, 'prev', function() {}); 166 | }) 167 | .on('orbit:toggle-play-pause.fndtn.orbit click.fndtn.orbit touchstart.fndtn.orbit', '.' + self.settings.timer_container_class, function(e) { 168 | e.preventDefault(); 169 | var $timer = $(e.currentTarget).toggleClass(self.settings.timer_paused_class), 170 | $slides_container = $timer.closest('.' + self.settings.container_class) 171 | .find('.' + self.settings.slides_container_class); 172 | 173 | if ($timer.hasClass(self.settings.timer_paused_class)) { 174 | self._stop_timer($slides_container); 175 | } else { 176 | self._start_timer($slides_container); 177 | } 178 | }) 179 | .on('touchstart.fndtn.orbit', function(e) { 180 | if (!e.touches) { e = e.originalEvent; } 181 | var data = { 182 | start_page_x: e.touches[0].pageX, 183 | start_page_y: e.touches[0].pageY, 184 | start_time: (new Date()).getTime(), 185 | delta_x: 0, 186 | is_scrolling: undefined 187 | }; 188 | $container.data('swipe-transition', data); 189 | e.stopPropagation(); 190 | }) 191 | .on('touchmove.fndtn.orbit', function(e) { 192 | if (!e.touches) { e = e.originalEvent; } 193 | // Ignore pinch/zoom events 194 | if(e.touches.length > 1 || e.scale && e.scale !== 1) return; 195 | 196 | var data = $container.data('swipe-transition'); 197 | if (typeof data === 'undefined') { 198 | data = {}; 199 | } 200 | 201 | data.delta_x = e.touches[0].pageX - data.start_page_x; 202 | 203 | if ( typeof data.is_scrolling === 'undefined') { 204 | data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) ); 205 | } 206 | 207 | if (!data.is_scrolling && !data.active) { 208 | e.preventDefault(); 209 | self._stop_timer($slides_container); 210 | var direction = (data.delta_x < 0) ? 'next' : 'prev'; 211 | data.active = true; 212 | self.goto($slides_container, direction, function() {}); 213 | } 214 | }) 215 | .on('touchend.fndtn.orbit', function(e) { 216 | $container.data('swipe-transition', {}); 217 | e.stopPropagation(); 218 | }); 219 | }, 220 | 221 | _init_dimensions: function ($slides_container) { 222 | var $container = $slides_container.parent(), 223 | $slides = $slides_container.children(); 224 | 225 | $slides_container.css('width', $slides.length * 100 + '%'); 226 | $slides.css('width', 100 / $slides.length + '%'); 227 | $slides_container.height($container.height()); 228 | $slides_container.css('width', $slides.length * 100 + '%'); 229 | }, 230 | 231 | _start_timer: function ($slides_container) { 232 | var self = this, 233 | $container = $slides_container.parent(); 234 | 235 | var callback = function() { 236 | self._reset_timer($slides_container, false); 237 | self.goto($slides_container, 'next', function() { 238 | self._start_timer($slides_container); 239 | }); 240 | }; 241 | 242 | var $timer = $container.find('.' + self.settings.timer_container_class), 243 | $progress = $timer.find('.' + self.settings.timer_progress_class), 244 | progress_pct = ($progress.width() / $timer.width()), 245 | delay = self.settings.timer_speed - (progress_pct * self.settings.timer_speed); 246 | 247 | $progress.animate({'width': '100%'}, delay, 'linear', callback).data('is-original', 'beans?'); 248 | $slides_container.trigger('orbit:timer-started'); 249 | }, 250 | 251 | _stop_timer: function ($slides_container) { 252 | var self = this, 253 | $container = $slides_container.parent(), 254 | $timer = $container.find('.' + self.settings.timer_container_class), 255 | $progress = $timer.find('.' + self.settings.timer_progress_class), 256 | progress_pct = $progress.width() / $timer.width() 257 | self._rebuild_timer($container, progress_pct * 100 + '%'); 258 | // $progress.stop(); 259 | $slides_container.trigger('orbit:timer-stopped'); 260 | $timer = $container.find('.' + self.settings.timer_container_class); 261 | $timer.addClass(self.settings.timer_paused_class); 262 | }, 263 | 264 | _reset_timer: function($slides_container, is_paused) { 265 | var self = this, 266 | $container = $slides_container.parent(); 267 | self._rebuild_timer($container, '0%'); 268 | if (typeof is_paused === 'boolean' && is_paused) { 269 | var $timer = $container.find('.' + self.settings.timer_container_class); 270 | $timer.addClass(self.settings.timer_paused_class); 271 | } 272 | }, 273 | 274 | _rebuild_timer: function ($container, width_pct) { 275 | // Zepto is unable to stop animations since they 276 | // are css-based. This is a workaround for that 277 | // limitation, which rebuilds the dom element 278 | // thus stopping the animation 279 | var self = this, 280 | $timer = $container.find('.' + self.settings.timer_container_class), 281 | $new_timer = $(self._timer_html()), 282 | $new_timer_progress = $new_timer.find('.' + self.settings.timer_progress_class); 283 | 284 | if (typeof Zepto === 'function') { 285 | $timer.remove(); 286 | $container.append($new_timer); 287 | $new_timer_progress.css('width', width_pct); 288 | } else if (typeof jQuery === 'function') { 289 | var $progress = $timer.find('.' + self.settings.timer_progress_class); 290 | $progress.css('width', width_pct); 291 | $progress.stop(); 292 | } 293 | }, 294 | 295 | goto: function($slides_container, index_or_direction, callback) { 296 | var self = this, 297 | $container = $slides_container.parent(), 298 | $slides = $slides_container.children(), 299 | $active_slide = $slides_container.find('.' + self.settings.active_slide_class), 300 | active_index = $active_slide.index(); 301 | 302 | if ($container.hasClass(self.settings.orbit_transition_class)) { 303 | return false; 304 | } 305 | 306 | if (index_or_direction === 'prev') { 307 | if (active_index === 0) { 308 | active_index = $slides.length - 1; 309 | } 310 | else { 311 | active_index--; 312 | } 313 | } 314 | else if (index_or_direction === 'next') { 315 | active_index = (active_index+1) % $slides.length; 316 | } 317 | else if (typeof index_or_direction === 'number') { 318 | active_index = (index_or_direction % $slides.length); 319 | } 320 | if (active_index === ($slides.length - 1) && index_or_direction === 'next') { 321 | $slides_container.css('marginLeft', '0%'); 322 | active_index = 1; 323 | } 324 | else if (active_index === 0 && index_or_direction === 'prev') { 325 | $slides_container.css('marginLeft', '-' + ($slides.length - 1) * 100 + '%'); 326 | active_index = $slides.length - 2; 327 | } 328 | // Start transition, make next slide active 329 | $container.addClass(self.settings.orbit_transition_class); 330 | $active_slide.removeClass(self.settings.active_slide_class); 331 | $($slides[active_index]).addClass(self.settings.active_slide_class); 332 | // Make next bullet active 333 | var $bullets = $container.siblings('.' + self.settings.bullets_container_class); 334 | if ($bullets.length === 1) { 335 | $bullets.children().removeClass(self.settings.bullets_active_class); 336 | $($bullets.children()[active_index-1]).addClass(self.settings.bullets_active_class); 337 | } 338 | var new_margin_left = '-' + (active_index * 100) + '%'; 339 | // Check to see if animation will occur, otherwise perform 340 | // callbacks manually 341 | $slides_container.trigger('orbit:before-slide-change'); 342 | if ($slides_container.css('marginLeft') === new_margin_left) { 343 | $container.removeClass(self.settings.orbit_transition_class); 344 | $slides_container.trigger('orbit:after-slide-change', [{slide_number: active_index, total_slides: $slides_container.children().length - 2}]); 345 | callback(); 346 | } else { 347 | $slides_container.animate({ 348 | 'marginLeft' : new_margin_left 349 | }, self.settings.animation_speed, 'linear', function() { 350 | $container.removeClass(self.settings.orbit_transition_class); 351 | $slides_container.trigger('orbit:after-slide-change', [{slide_number: active_index, total_slides: $slides_container.children().length - 2}]); 352 | callback(); 353 | }); 354 | } 355 | } 356 | }; 357 | }(Foundation.zj, this, this.document)); 358 | -------------------------------------------------------------------------------- /js/foundation/foundation.placeholder.js: -------------------------------------------------------------------------------- 1 | /*! http://mths.be/placeholder v2.0.7 by @mathias 2 | Modified to work with Zepto.js by ZURB 3 | */ 4 | ;(function(window, document, $) { 5 | 6 | var isInputSupported = 'placeholder' in document.createElement('input'), 7 | isTextareaSupported = 'placeholder' in document.createElement('textarea'), 8 | prototype = $.fn, 9 | valHooks = $.valHooks, 10 | hooks, 11 | placeholder; 12 | 13 | if (isInputSupported && isTextareaSupported) { 14 | 15 | placeholder = prototype.placeholder = function() { 16 | return this; 17 | }; 18 | 19 | placeholder.input = placeholder.textarea = true; 20 | 21 | } else { 22 | 23 | placeholder = prototype.placeholder = function() { 24 | var $this = this; 25 | $this 26 | .filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]') 27 | .not('.placeholder') 28 | .bind({ 29 | 'focus.placeholder': clearPlaceholder, 30 | 'blur.placeholder': setPlaceholder 31 | }) 32 | .data('placeholder-enabled', true) 33 | .trigger('blur.placeholder'); 34 | return $this; 35 | }; 36 | 37 | placeholder.input = isInputSupported; 38 | placeholder.textarea = isTextareaSupported; 39 | 40 | hooks = { 41 | 'get': function(element) { 42 | var $element = $(element); 43 | return $element.data('placeholder-enabled') && $element.hasClass('placeholder') ? '' : element.value; 44 | }, 45 | 'set': function(element, value) { 46 | var $element = $(element); 47 | if (!$element.data('placeholder-enabled')) { 48 | return element.value = value; 49 | } 50 | if (value == '') { 51 | element.value = value; 52 | // Issue #56: Setting the placeholder causes problems if the element continues to have focus. 53 | if (element != document.activeElement) { 54 | // We can't use `triggerHandler` here because of dummy text/password inputs :( 55 | setPlaceholder.call(element); 56 | } 57 | } else if ($element.hasClass('placeholder')) { 58 | clearPlaceholder.call(element, true, value) || (element.value = value); 59 | } else { 60 | element.value = value; 61 | } 62 | // `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363 63 | return $element; 64 | } 65 | }; 66 | 67 | isInputSupported || (valHooks.input = hooks); 68 | isTextareaSupported || (valHooks.textarea = hooks); 69 | 70 | $(function() { 71 | // Look for forms 72 | $(document).delegate('form', 'submit.placeholder', function() { 73 | // Clear the placeholder values so they don't get submitted 74 | var $inputs = $('.placeholder', this).each(clearPlaceholder); 75 | setTimeout(function() { 76 | $inputs.each(setPlaceholder); 77 | }, 10); 78 | }); 79 | }); 80 | 81 | // Clear placeholder values upon page reload 82 | $(window).bind('beforeunload.placeholder', function() { 83 | $('.placeholder').each(function() { 84 | this.value = ''; 85 | }); 86 | }); 87 | 88 | } 89 | 90 | function args(elem) { 91 | // Return an object of element attributes 92 | var newAttrs = {}, 93 | rinlinejQuery = /^jQuery\d+$/; 94 | $.each(elem.attributes, function(i, attr) { 95 | if (attr.specified && !rinlinejQuery.test(attr.name)) { 96 | newAttrs[attr.name] = attr.value; 97 | } 98 | }); 99 | return newAttrs; 100 | } 101 | 102 | function clearPlaceholder(event, value) { 103 | var input = this, 104 | $input = $(input); 105 | if (input.value == $input.attr('placeholder') && $input.hasClass('placeholder')) { 106 | if ($input.data('placeholder-password')) { 107 | $input = $input.hide().next().show().attr('id', $input.removeAttr('id').data('placeholder-id')); 108 | // If `clearPlaceholder` was called from `$.valHooks.input.set` 109 | if (event === true) { 110 | return $input[0].value = value; 111 | } 112 | $input.focus(); 113 | } else { 114 | input.value = ''; 115 | $input.removeClass('placeholder'); 116 | input == document.activeElement && input.select(); 117 | } 118 | } 119 | } 120 | 121 | function setPlaceholder() { 122 | var $replacement, 123 | input = this, 124 | $input = $(input), 125 | $origInput = $input, 126 | id = this.id; 127 | if (input.value == '') { 128 | if (input.type == 'password') { 129 | if (!$input.data('placeholder-textinput')) { 130 | try { 131 | $replacement = $input.clone().attr({ 'type': 'text' }); 132 | } catch(e) { 133 | $replacement = $('').attr($.extend(args(this), { 'type': 'text' })); 134 | } 135 | $replacement 136 | .removeAttr('name') 137 | .data({ 138 | 'placeholder-password': true, 139 | 'placeholder-id': id 140 | }) 141 | .bind('focus.placeholder', clearPlaceholder); 142 | $input 143 | .data({ 144 | 'placeholder-textinput': $replacement, 145 | 'placeholder-id': id 146 | }) 147 | .before($replacement); 148 | } 149 | $input = $input.removeAttr('id').hide().prev().attr('id', id).show(); 150 | // Note: `$input[0] != input` now! 151 | } 152 | $input.addClass('placeholder'); 153 | $input[0].value = $input.attr('placeholder'); 154 | } else { 155 | $input.removeClass('placeholder'); 156 | } 157 | } 158 | 159 | }(this, document, Foundation.zj)); 160 | -------------------------------------------------------------------------------- /js/foundation/foundation.reveal.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.reveal = { 7 | name: 'reveal', 8 | 9 | version : '4.0.4', 10 | 11 | locked : false, 12 | 13 | settings : { 14 | animation: 'fadeAndPop', 15 | animationSpeed: 250, 16 | closeOnBackgroundClick: true, 17 | dismissModalClass: 'close-reveal-modal', 18 | bgClass: 'reveal-modal-bg', 19 | open: function(){}, 20 | opened: function(){}, 21 | close: function(){}, 22 | closed: function(){}, 23 | bg : $('.reveal-modal-bg'), 24 | css : { 25 | open : { 26 | 'opacity': 0, 27 | 'visibility': 'visible', 28 | 'display' : 'block' 29 | }, 30 | close : { 31 | 'opacity': 1, 32 | 'visibility': 'hidden', 33 | 'display': 'none' 34 | } 35 | } 36 | }, 37 | 38 | init : function (scope, method, options) { 39 | this.scope = scope || this.scope; 40 | Foundation.inherit(this, 'data_options delay'); 41 | 42 | if (typeof method === 'object') { 43 | $.extend(true, this.settings, method); 44 | } 45 | 46 | if (typeof method != 'string') { 47 | if (!this.settings.init) this.events(); 48 | 49 | return this.settings.init; 50 | } else { 51 | return this[method].call(this, options); 52 | } 53 | }, 54 | 55 | events : function () { 56 | var self = this; 57 | 58 | $(this.scope) 59 | .on('click.fndtn.reveal', '[data-reveal-id]', function (e) { 60 | e.preventDefault(); 61 | if (!self.locked) { 62 | self.locked = true; 63 | self.open.call(self, $(this)); 64 | } 65 | }) 66 | .on('click.fndtn.reveal touchend.click.fndtn.reveal', this.close_targets(), function (e) { 67 | if (!self.locked) { 68 | self.locked = true; 69 | self.close.call(self, $(this).closest('.reveal-modal')); 70 | } 71 | }) 72 | .on('open.fndtn.reveal', '.reveal-modal', this.settings.open) 73 | .on('opened.fndtn.reveal', '.reveal-modal', this.settings.opened) 74 | .on('opened.fndtn.reveal', '.reveal-modal', this.open_video) 75 | .on('close.fndtn.reveal', '.reveal-modal', this.settings.close) 76 | .on('closed.fndtn.reveal', '.reveal-modal', this.settings.closed) 77 | .on('closed.fndtn.reveal', '.reveal-modal', this.close_video); 78 | }, 79 | 80 | open : function (target) { 81 | if (target) { 82 | var modal = $('#' + target.data('reveal-id')); 83 | } else { 84 | var modal = $(this.scope); 85 | } 86 | 87 | var open_modal = $('.reveal-modal.open'); 88 | 89 | if (!modal.data('css-top')) { 90 | modal.data('css-top', parseInt(modal.css('top'), 10)) 91 | .data('offset', this.cache_offset(modal)); 92 | } 93 | 94 | modal.trigger('open'); 95 | 96 | if (open_modal.length < 1) { 97 | this.toggle_bg(modal); 98 | } 99 | 100 | this.toggle_modals(open_modal, modal); 101 | }, 102 | 103 | close : function (modal) { 104 | var modal = modal || $(this.scope); 105 | this.locked = true; 106 | var open_modal = $('.reveal-modal.open').not(modal); 107 | modal.trigger('close'); 108 | this.toggle_bg(modal); 109 | this.toggle_modals(open_modal, modal); 110 | }, 111 | 112 | close_targets : function () { 113 | var base = '.' + this.settings.dismissModalClass; 114 | 115 | if (this.settings.closeOnBackgroundClick) { 116 | return base + ', .' + this.settings.bgClass; 117 | } 118 | 119 | return base; 120 | }, 121 | 122 | toggle_modals : function (open_modal, modal) { 123 | if (open_modal.length > 0) { 124 | this.hide(open_modal, this.settings.css.close); 125 | } 126 | 127 | if (modal.filter(':visible').length > 0) { 128 | this.hide(modal, this.settings.css.close); 129 | } else { 130 | this.show(modal, this.settings.css.open); 131 | } 132 | }, 133 | 134 | toggle_bg : function (modal) { 135 | if (this.settings.bg.length === 0) { 136 | this.settings.bg = $('
          ', {'class': this.settings.bgClass}) 137 | .insertAfter(modal); 138 | } 139 | 140 | if (this.settings.bg.filter(':visible').length > 0) { 141 | this.hide(this.settings.bg); 142 | } else { 143 | this.show(this.settings.bg); 144 | } 145 | }, 146 | 147 | show : function (el, css) { 148 | // is modal 149 | if (css) { 150 | if (/pop/i.test(this.settings.animation)) { 151 | css.top = $(window).scrollTop() - el.data('offset') + 'px'; 152 | var end_css = { 153 | top: $(window).scrollTop() + el.data('css-top') + 'px', 154 | opacity: 1 155 | } 156 | 157 | return this.delay(function () { 158 | return el 159 | .css(css) 160 | .animate(end_css, this.settings.animationSpeed, 'linear', function () { 161 | this.locked = false; 162 | el.trigger('opened'); 163 | }.bind(this)) 164 | .addClass('open'); 165 | }.bind(this), this.settings.animationSpeed / 2); 166 | } 167 | 168 | if (/fade/i.test(this.settings.animation)) { 169 | var end_css = {opacity: 1}; 170 | 171 | return this.delay(function () { 172 | return el 173 | .css(css) 174 | .animate(end_css, this.settings.animationSpeed, 'linear', function () { 175 | this.locked = false; 176 | el.trigger('opened'); 177 | }.bind(this)) 178 | .addClass('open'); 179 | }.bind(this), this.settings.animationSpeed / 2); 180 | } 181 | 182 | return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened'); 183 | } 184 | 185 | // should we animate the background? 186 | if (/fade/i.test(this.settings.animation)) { 187 | return el.fadeIn(this.settings.animationSpeed / 2); 188 | } 189 | 190 | return el.show(); 191 | }, 192 | 193 | hide : function (el, css) { 194 | // is modal 195 | if (css) { 196 | if (/pop/i.test(this.settings.animation)) { 197 | var end_css = { 198 | top: - $(window).scrollTop() - el.data('offset') + 'px', 199 | opacity: 0 200 | }; 201 | 202 | return this.delay(function () { 203 | return el 204 | .animate(end_css, this.settings.animationSpeed, 'linear', function () { 205 | this.locked = false; 206 | el.css(css).trigger('closed'); 207 | }.bind(this)) 208 | .removeClass('open'); 209 | }.bind(this), this.settings.animationSpeed / 2); 210 | } 211 | 212 | if (/fade/i.test(this.settings.animation)) { 213 | var end_css = {opacity: 0}; 214 | 215 | return this.delay(function () { 216 | return el 217 | .animate(end_css, this.settings.animationSpeed, 'linear', function () { 218 | this.locked = false; 219 | el.css(css).trigger('closed'); 220 | }.bind(this)) 221 | .removeClass('open'); 222 | }.bind(this), this.settings.animationSpeed / 2); 223 | } 224 | 225 | return el.hide().css(css).removeClass('open').trigger('closed'); 226 | } 227 | 228 | // should we animate the background? 229 | if (/fade/i.test(this.settings.animation)) { 230 | return el.fadeOut(this.settings.animationSpeed / 2); 231 | } 232 | 233 | return el.hide(); 234 | }, 235 | 236 | close_video : function (e) { 237 | var video = $(this).find('.flex-video'), 238 | iframe = video.find('iframe'); 239 | 240 | if (iframe.length > 0) { 241 | iframe.attr('data-src', iframe[0].src); 242 | iframe.attr('src', 'about:blank'); 243 | video.fadeOut(100).hide(); 244 | } 245 | }, 246 | 247 | open_video : function (e) { 248 | var video = $(this).find('.flex-video'), 249 | iframe = video.find('iframe'); 250 | 251 | if (iframe.length > 0) { 252 | var data_src = iframe.attr('data-src'); 253 | if (typeof data_src === 'string') { 254 | iframe[0].src = iframe.attr('data-src'); 255 | } 256 | video.show().fadeIn(100); 257 | } 258 | }, 259 | 260 | cache_offset : function (modal) { 261 | var offset = modal.show().height() + parseInt(modal.css('top'), 10); 262 | 263 | modal.hide(); 264 | 265 | return offset; 266 | }, 267 | 268 | off : function () { 269 | $(this.scope).off('.fndtn.reveal'); 270 | } 271 | }; 272 | }(Foundation.zj, this, this.document)); 273 | -------------------------------------------------------------------------------- /js/foundation/foundation.section.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.section = { 7 | name: 'section', 8 | 9 | version : '4.0.5', 10 | 11 | settings : { 12 | deep_linking: false, 13 | one_up: true, 14 | callback: function (){} 15 | }, 16 | 17 | init : function (scope, method, options) { 18 | this.scope = scope || this.scope; 19 | Foundation.inherit(this, 'throttle data_options'); 20 | 21 | if (typeof method === 'object') { 22 | $.extend(true, this.settings, method); 23 | } 24 | 25 | if (typeof method != 'string') { 26 | this.set_active_from_hash(); 27 | if (!this.settings.init) this.events(); 28 | 29 | return this.settings.init; 30 | } else { 31 | return this[method].call(this, options); 32 | } 33 | }, 34 | 35 | events : function () { 36 | var self = this; 37 | $(this.scope).on('click.fndtn.section', '[data-section] .title', function (e) { 38 | $.extend(true, self.settings, self.data_options($(this).closest('[data-section]'))); 39 | self.toggle_active.call(this, e, self); 40 | }); 41 | 42 | $(window).on('resize.fndtn.section', self.throttle(function () { 43 | self.resize.call(this); 44 | }, 30)).trigger('resize'); 45 | 46 | $('[data-section] .content').on('click.fndtn.section', function (e) { 47 | e.stopPropagation(); 48 | }); 49 | 50 | $('*, html, body').on('click.fndtn.section', function (e) { 51 | if ($(e.target).closest('.title').length < 1) { 52 | $('[data-section].vertical-nav, [data-section].horizontal-nav') 53 | .find('section, .section') 54 | .removeClass('active') 55 | .attr('style', ''); 56 | } 57 | }); 58 | 59 | this.settings.init = true; 60 | }, 61 | 62 | toggle_active : function (e, self) { 63 | var $this = $(this), 64 | section = $this.closest('section, .section'), 65 | content = section.find('.content'), 66 | parent = section.closest('[data-section]'), 67 | self = Foundation.libs.section; 68 | 69 | if (!self.settings.deep_linking && content.length > 0) { 70 | e.preventDefault(); 71 | } 72 | 73 | if (section.hasClass('active')) { 74 | if (self.small(parent) 75 | || self.is_vertical(parent) 76 | || self.is_horizontal(parent) 77 | || self.is_accordion(parent)) { 78 | section 79 | .removeClass('active') 80 | .attr('style', ''); 81 | } 82 | } else { 83 | if (self.small(parent) || self.settings.one_up) { 84 | $this 85 | .closest('[data-section]') 86 | .find('section, .section') 87 | .removeClass('active') 88 | .attr('style', ''); 89 | 90 | section.css('padding-top', self.outerHeight(section.find('.title'))); 91 | } 92 | 93 | $('[data-section].vertical-nav, [data-section].horizontal-nav') 94 | .find('section, .section') 95 | .removeClass('active') 96 | .attr('style', ''); 97 | 98 | if (self.small(parent)) { 99 | section.attr('style', ''); 100 | } 101 | 102 | section.addClass('active'); 103 | } 104 | 105 | self.settings.callback(); 106 | }, 107 | 108 | resize : function () { 109 | var sections = $('[data-section]'), 110 | self = Foundation.libs.section; 111 | 112 | sections.each(function() { 113 | var $this = $(this), 114 | active_section = $this.find('section.active, .section.active'); 115 | if (active_section.length > 1) { 116 | active_section 117 | .not(':first') 118 | .removeClass('active') 119 | .attr('style', ''); 120 | } else if (active_section.length < 1 121 | && !self.is_vertical($this) 122 | && !self.is_horizontal($this) 123 | && !self.is_accordion($this)) { 124 | var first = $this.find('section, .section').first(); 125 | first.addClass('active'); 126 | 127 | if (self.small($this)) { 128 | first.attr('style', ''); 129 | } else { 130 | first.css('padding-top', self.outerHeight(first.find('.title'))); 131 | } 132 | } 133 | 134 | if (self.small($this)) { 135 | active_section.attr('style', ''); 136 | } else { 137 | active_section.css('padding-top', self.outerHeight(active_section.find('.title'))); 138 | } 139 | self.position_titles($this); 140 | 141 | if (self.is_horizontal($this) && !self.small($this)) { 142 | self.position_content($this); 143 | } else { 144 | self.position_content($this, false); 145 | } 146 | }); 147 | }, 148 | 149 | is_vertical : function (el) { 150 | return el.hasClass('vertical-nav'); 151 | }, 152 | 153 | is_horizontal : function (el) { 154 | return el.hasClass('horizontal-nav'); 155 | }, 156 | 157 | is_accordion : function (el) { 158 | return el.hasClass('accordion'); 159 | }, 160 | 161 | set_active_from_hash : function () { 162 | var hash = window.location.hash.substring(1), 163 | sections = $('[data-section]'), 164 | self = this; 165 | 166 | sections.each(function () { 167 | var section = $(this); 168 | $.extend(true, self.settings, self.data_options(section)); 169 | 170 | if (hash.length > 0 && self.settings.deep_linking) { 171 | section 172 | .find('.content[data-slug="' + hash + '"]') 173 | .closest('section, .section') 174 | .addClass('active'); 175 | } 176 | }); 177 | }, 178 | 179 | position_titles : function (section, off) { 180 | var titles = section.find('.title'), 181 | previous_width = 0, 182 | self = this; 183 | 184 | if (typeof off === 'boolean') { 185 | titles.attr('style', ''); 186 | 187 | } else { 188 | titles.each(function () { 189 | $(this).css('left', previous_width); 190 | previous_width += self.outerWidth($(this)); 191 | }); 192 | } 193 | }, 194 | 195 | position_content : function (section, off) { 196 | var titles = section.find('.title'), 197 | content = section.find('.content'), 198 | self = this; 199 | 200 | if (typeof off === 'boolean') { 201 | content.attr('style', ''); 202 | section.attr('style', ''); 203 | } else { 204 | section.find('section, .section').each(function () { 205 | var title = $(this).find('.title'), 206 | content = $(this).find('.content'); 207 | 208 | content.css({left: title.position().left - 1, top: self.outerHeight(title) - 2}); 209 | }); 210 | 211 | // temporary work around for Zepto outerheight calculation issues. 212 | if (typeof Zepto === 'function') { 213 | section.height(this.outerHeight(titles.first())); 214 | } else { 215 | section.height(this.outerHeight(titles.first()) - 2); 216 | } 217 | } 218 | 219 | }, 220 | 221 | small : function (el) { 222 | if (el && this.is_accordion(el)) { 223 | return true; 224 | } 225 | if ($('html').hasClass('lt-ie9')) { 226 | return true; 227 | } 228 | if ($('html').hasClass('ie8compat')) { 229 | return true; 230 | } 231 | return $(this.scope).width() < 768; 232 | }, 233 | 234 | off : function () { 235 | $(this.scope).off('.fndtn.section'); 236 | $(window).off('.fndtn.section'); 237 | this.settings.init = false; 238 | } 239 | }; 240 | }(Foundation.zj, this, this.document)); 241 | -------------------------------------------------------------------------------- /js/foundation/foundation.tooltips.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.tooltips = { 7 | name: 'tooltips', 8 | 9 | version : '4.0.2', 10 | 11 | settings : { 12 | selector : '.has-tip', 13 | additionalInheritableClasses : [], 14 | tooltipClass : '.tooltip', 15 | tipTemplate : function (selector, content) { 16 | return '' + content + ''; 19 | } 20 | }, 21 | 22 | cache : {}, 23 | 24 | init : function (scope, method, options) { 25 | var self = this; 26 | this.scope = scope || this.scope; 27 | 28 | if (typeof method === 'object') { 29 | $.extend(true, this.settings, method); 30 | } 31 | 32 | if (typeof method != 'string') { 33 | if (Modernizr.touch) { 34 | $(this.scope) 35 | .on('click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip', 36 | '[data-tooltip]', function (e) { 37 | e.preventDefault(); 38 | $(self.settings.tooltipClass).hide(); 39 | self.showOrCreateTip($(this)); 40 | }) 41 | .on('click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip', 42 | this.settings.tooltipClass, function (e) { 43 | e.preventDefault(); 44 | $(this).fadeOut(150); 45 | }); 46 | } else { 47 | $(this.scope) 48 | .on('mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip', 49 | '[data-tooltip]', function (e) { 50 | var $this = $(this); 51 | 52 | if (e.type === 'mouseover' || e.type === 'mouseenter') { 53 | self.showOrCreateTip($this); 54 | } else if (e.type === 'mouseout' || e.type === 'mouseleave') { 55 | self.hide($this); 56 | } 57 | }); 58 | } 59 | 60 | // $(this.scope).data('fndtn-tooltips', true); 61 | } else { 62 | return this[method].call(this, options); 63 | } 64 | 65 | }, 66 | 67 | showOrCreateTip : function ($target) { 68 | var $tip = this.getTip($target); 69 | 70 | if ($tip && $tip.length > 0) { 71 | return this.show($target); 72 | } 73 | 74 | return this.create($target); 75 | }, 76 | 77 | getTip : function ($target) { 78 | var selector = this.selector($target), 79 | tip = null; 80 | 81 | if (selector) { 82 | tip = $('span[data-selector=' + selector + ']' + this.settings.tooltipClass); 83 | } 84 | 85 | return (typeof tip === 'object') ? tip : false; 86 | }, 87 | 88 | selector : function ($target) { 89 | var id = $target.attr('id'), 90 | dataSelector = $target.attr('data-tooltip') || $target.attr('data-selector'); 91 | 92 | if ((id && id.length < 1 || !id) && typeof dataSelector != 'string') { 93 | dataSelector = 'tooltip' + Math.random().toString(36).substring(7); 94 | $target.attr('data-selector', dataSelector); 95 | } 96 | 97 | return (id && id.length > 0) ? id : dataSelector; 98 | }, 99 | 100 | create : function ($target) { 101 | var $tip = $(this.settings.tipTemplate(this.selector($target), $('
          ').html($target.attr('title')).html())), 102 | classes = this.inheritable_classes($target); 103 | 104 | $tip.addClass(classes).appendTo('body'); 105 | if (Modernizr.touch) { 106 | $tip.append('tap to close '); 107 | } 108 | $target.removeAttr('title').attr('title',''); 109 | this.show($target); 110 | }, 111 | 112 | reposition : function (target, tip, classes) { 113 | var width, nub, nubHeight, nubWidth, column, objPos; 114 | 115 | tip.css('visibility', 'hidden').show(); 116 | 117 | width = target.data('width'); 118 | nub = tip.children('.nub'); 119 | nubHeight = this.outerHeight(nub); 120 | nubWidth = this.outerHeight(nub); 121 | 122 | objPos = function (obj, top, right, bottom, left, width) { 123 | return obj.css({ 124 | 'top' : (top) ? top : 'auto', 125 | 'bottom' : (bottom) ? bottom : 'auto', 126 | 'left' : (left) ? left : 'auto', 127 | 'right' : (right) ? right : 'auto', 128 | 'width' : (width) ? width : 'auto' 129 | }).end(); 130 | }; 131 | 132 | objPos(tip, (target.offset().top + this.outerHeight(target) + 10), 'auto', 'auto', target.offset().left, width); 133 | 134 | if ($(window).width() < 767) { 135 | objPos(tip, (target.offset().top + this.outerHeight(target) + 10), 'auto', 'auto', 12.5, $(this.scope).width()); 136 | tip.addClass('tip-override'); 137 | objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left); 138 | } else { 139 | objPos(tip, (target.offset().top + this.outerHeight(target) + 10), 'auto', 'auto', target.offset().left, width); 140 | tip.removeClass('tip-override'); 141 | if (classes && classes.indexOf('tip-top') > -1) { 142 | objPos(tip, (target.offset().top - this.outerHeight(tip)), 'auto', 'auto', target.offset().left, width) 143 | .removeClass('tip-override'); 144 | } else if (classes && classes.indexOf('tip-left') > -1) { 145 | objPos(tip, (target.offset().top + (this.outerHeight(target) / 2) - nubHeight*2.5), 'auto', 'auto', (target.offset().left - this.outerWidth(tip) - nubHeight), width) 146 | .removeClass('tip-override'); 147 | } else if (classes && classes.indexOf('tip-right') > -1) { 148 | objPos(tip, (target.offset().top + (this.outerHeight(target) / 2) - nubHeight*2.5), 'auto', 'auto', (target.offset().left + this.outerWidth(target) + nubHeight), width) 149 | .removeClass('tip-override'); 150 | } 151 | } 152 | 153 | tip.css('visibility', 'visible').hide(); 154 | }, 155 | 156 | inheritable_classes : function (target) { 157 | var inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'noradius'].concat(this.settings.additionalInheritableClasses), 158 | classes = target.attr('class'), 159 | filtered = classes ? $.map(classes.split(' '), function (el, i) { 160 | if ($.inArray(el, inheritables) !== -1) { 161 | return el; 162 | } 163 | }).join(' ') : ''; 164 | 165 | return $.trim(filtered); 166 | }, 167 | 168 | show : function ($target) { 169 | var $tip = this.getTip($target); 170 | 171 | this.reposition($target, $tip, $target.attr('class')); 172 | $tip.fadeIn(150); 173 | }, 174 | 175 | hide : function ($target) { 176 | var $tip = this.getTip($target); 177 | 178 | $tip.fadeOut(150); 179 | }, 180 | 181 | // deprecate reload 182 | reload : function () { 183 | var $self = $(this); 184 | 185 | return ($self.data('fndtn-tooltips')) ? $self.foundationTooltips('destroy').foundationTooltips('init') : $self.foundationTooltips('init'); 186 | }, 187 | 188 | off : function () { 189 | $(this.scope).off('.fndtn.tooltip'); 190 | $(this.settings.tooltipClass).each(function (i) { 191 | $('[data-tooltip]').get(i).attr('title', $(this).text()); 192 | }).remove(); 193 | } 194 | }; 195 | }(Foundation.zj, this, this.document)); 196 | -------------------------------------------------------------------------------- /js/foundation/foundation.topbar.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.topbar = { 7 | name : 'topbar', 8 | 9 | version : '4.0.0', 10 | 11 | settings : { 12 | index : 0, 13 | stickyClass : 'sticky', 14 | custom_back_text: true, 15 | back_text: 'Back', 16 | init : false 17 | }, 18 | 19 | init : function (scope, method, options) { 20 | var self = this; 21 | this.scope = scope || this.scope; 22 | 23 | if (typeof method === 'object') { 24 | $.extend(true, this.settings, method); 25 | } 26 | 27 | if (typeof method != 'string') { 28 | 29 | $('nav.top-bar').each(function () { 30 | self.settings.$w = $(window); 31 | self.settings.$topbar = $(this); 32 | self.settings.$section = self.settings.$topbar.find('section'); 33 | self.settings.$titlebar = self.settings.$topbar.children('ul').first(); 34 | 35 | 36 | self.settings.$topbar.data('index', 0); 37 | 38 | var breakpoint = $("
          ").insertAfter(self.settings.$topbar); 39 | self.settings.breakPoint = breakpoint.width(); 40 | breakpoint.remove(); 41 | 42 | self.assemble(); 43 | 44 | if (self.settings.$topbar.parent().hasClass('fixed')) { 45 | $('body').css('padding-top', self.outerHeight(self.settings.$topbar)); 46 | } 47 | }); 48 | 49 | if (!self.settings.init) { 50 | this.events(); 51 | } 52 | 53 | return this.settings.init; 54 | } else { 55 | // fire method 56 | return this[method].call(this, options); 57 | } 58 | }, 59 | 60 | events : function () { 61 | var self = this; 62 | 63 | $(this.scope) 64 | .on('click.fndtn.topbar', '.top-bar .toggle-topbar', function (e) { 65 | var topbar = $(this).closest('.top-bar'), 66 | section = topbar.find('section, .section'), 67 | titlebar = topbar.children('ul').first(); 68 | 69 | if (!self.settings.$topbar.data('height')) self.largestUL(); 70 | 71 | e.preventDefault(); 72 | 73 | if (self.breakpoint()) { 74 | topbar 75 | .toggleClass('expanded') 76 | .css('min-height', ''); 77 | } 78 | 79 | if (!topbar.hasClass('expanded')) { 80 | section.css({left: '0%'}); 81 | section.find('>.name').css({left: '100%'}); 82 | section.find('li.moved').removeClass('moved'); 83 | topbar.data('index', 0); 84 | } 85 | }) 86 | 87 | .on('click.fndtn.topbar', '.top-bar .has-dropdown>a', function (e) { 88 | var topbar = $(this).closest('.top-bar'), 89 | section = topbar.find('section, .section'), 90 | titlebar = topbar.children('ul').first(); 91 | 92 | if (Modernizr.touch || self.breakpoint()) { 93 | e.preventDefault(); 94 | } 95 | 96 | if (self.breakpoint()) { 97 | var $this = $(this), 98 | $selectedLi = $this.closest('li'); 99 | 100 | topbar.data('index', topbar.data('index') + 1); 101 | $selectedLi.addClass('moved'); 102 | section.css({left: -(100 * topbar.data('index')) + '%'}); 103 | section.find('>.name').css({left: 100 * topbar.data('index') + '%'}); 104 | 105 | $this.siblings('ul') 106 | .height(topbar.data('height') + self.outerHeight(titlebar, true)); 107 | topbar 108 | .css('min-height', topbar.data('height') + self.outerHeight(titlebar, true) * 2) 109 | } 110 | }); 111 | 112 | $(window).on('resize.fndtn.topbar', function () { 113 | if (!this.breakpoint()) { 114 | $('.top-bar').css('min-height', ''); 115 | } 116 | }.bind(this)); 117 | 118 | // Go up a level on Click 119 | $(this.scope).on('click.fndtn', '.top-bar .has-dropdown .back', function (e) { 120 | e.preventDefault(); 121 | 122 | var $this = $(this), 123 | topbar = $this.closest('.top-bar'), 124 | section = topbar.find('section, .section'), 125 | $movedLi = $this.closest('li.moved'), 126 | $previousLevelUl = $movedLi.parent(); 127 | 128 | topbar.data('index', topbar.data('index') - 1); 129 | section.css({left: -(100 * topbar.data('index')) + '%'}); 130 | section.find('>.name').css({'left': 100 * topbar.data('index') + '%'}); 131 | 132 | if (topbar.data('index') === 0) { 133 | topbar.css('min-height', 0); 134 | } 135 | 136 | setTimeout(function () { 137 | $movedLi.removeClass('moved'); 138 | }, 300); 139 | }); 140 | }, 141 | 142 | breakpoint : function () { 143 | return $(window).width() <= this.settings.breakPoint || $('html').hasClass('lt-ie9'); 144 | }, 145 | 146 | assemble : function () { 147 | var self = this; 148 | // Pull element out of the DOM for manipulation 149 | this.settings.$section.detach(); 150 | 151 | this.settings.$section.find('.has-dropdown>a').each(function () { 152 | var $link = $(this), 153 | $dropdown = $link.siblings('.dropdown'), 154 | $titleLi = $('
        2. '); 155 | 156 | // Copy link to subnav 157 | if (self.settings.custom_back_text == true) { 158 | $titleLi.find('h5>a').html('« ' + self.settings.back_text); 159 | } else { 160 | $titleLi.find('h5>a').html('« ' + $link.html()); 161 | } 162 | $dropdown.prepend($titleLi); 163 | }); 164 | 165 | // Put element back in the DOM 166 | this.settings.$section.appendTo(this.settings.$topbar); 167 | 168 | // check for sticky 169 | this.sticky(); 170 | }, 171 | 172 | largestUL : function () { 173 | var uls = this.settings.$topbar.find('section ul ul'), 174 | largest = uls.first(), 175 | total = 0, 176 | self = this; 177 | 178 | uls.each(function () { 179 | if ($(this).children('li').length > largest.children('li').length) { 180 | largest = $(this); 181 | } 182 | }); 183 | 184 | largest.children('li').each(function () { total += self.outerHeight($(this), true); }); 185 | 186 | this.settings.$topbar.data('height', total); 187 | }, 188 | 189 | sticky : function () { 190 | var klass = '.' + this.settings.stickyClass; 191 | if ($(klass).length > 0) { 192 | var distance = $(klass).length ? $(klass).offset().top: 0, 193 | $window = $(window); 194 | var offst = this.outerHeight($('nav.top-bar'))+20; 195 | 196 | $window.scroll(function() { 197 | if ($window.scrollTop() >= (distance)) { 198 | $(klass).addClass("fixed"); 199 | $('body').css('padding-top',offst); 200 | } 201 | 202 | else if ($window.scrollTop() < distance) { 203 | $(klass).removeClass("fixed"); 204 | $('body').css('padding-top','0'); 205 | } 206 | }); 207 | } 208 | }, 209 | 210 | off : function () { 211 | $(this.scope).off('.fndtn.topbar'); 212 | $(window).off('.fndtn.topbar'); 213 | } 214 | }; 215 | }(Foundation.zj, this, this.document)); 216 | -------------------------------------------------------------------------------- /js/vendor/custom.modernizr.js: -------------------------------------------------------------------------------- 1 | /* Modernizr 2.6.2 (Custom Build) | MIT & BSD 2 | * Build: http://modernizr.com/download/#-inlinesvg-svg-svgclippaths-touch-shiv-mq-cssclasses-teststyles-prefixes-ie8compat-load 3 | */ 4 | ;window.Modernizr=function(a,b,c){function y(a){j.cssText=a}function z(a,b){return y(m.join(a+";")+(b||""))}function A(a,b){return typeof a===b}function B(a,b){return!!~(""+a).indexOf(b)}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:A(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={svg:"http://www.w3.org/2000/svg"},o={},p={},q={},r=[],s=r.slice,t,u=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},v=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return u("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},w={}.hasOwnProperty,x;!A(w,"undefined")&&!A(w.call,"undefined")?x=function(a,b){return w.call(a,b)}:x=function(a,b){return b in a&&A(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=s.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(s.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(s.call(arguments)))};return e}),o.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:u(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},o.svg=function(){return!!b.createElementNS&&!!b.createElementNS(n.svg,"svg").createSVGRect},o.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="",(a.firstChild&&a.firstChild.namespaceURI)==n.svg},o.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(l.call(b.createElementNS(n.svg,"clipPath")))};for(var D in o)x(o,D)&&(t=D.toLowerCase(),e[t]=o[D](),r.push((e[t]?"":"no-")+t));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)x(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},y(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=m,e.mq=v,e.testStyles=u,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+r.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f