'));var s=t.next(),n=t.find(\"option\"),i=t.find(\"option:selected\");s.find(\".current\").html(i.data(\"display\")||i.text()),n.each(function(t){var n=e(this),i=n.data(\"display\");s.find(\"ul\").append(e(\"\").attr(\"data-value\",n.val()).attr(\"data-display\",i||null).addClass(\"option\"+(n.is(\":selected\")?\" selected\":\"\")+(n.is(\":disabled\")?\" disabled\":\"\")).html(n.text()))})}if(\"string\"==typeof t)return\"update\"==t?this.each(function(){var t=e(this),n=e(this).next(\".nice-select\"),i=n.hasClass(\"open\");n.length&&(n.remove(),s(t),i&&t.next().trigger(\"click\"))}):\"destroy\"==t?(this.each(function(){var t=e(this),s=e(this).next(\".nice-select\");s.length&&(s.remove(),t.css(\"display\",\"\"))}),0==e(\".nice-select\").length&&e(document).off(\".nice_select\")):console.log('Method \"'+t+'\" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass(\"nice-select\")||s(t)}),e(document).off(\".nice_select\"),e(document).on(\"click.nice_select\",\".nice-select\",function(t){var s=e(this);e(\".nice-select\").not(s).removeClass(\"open\"),s.toggleClass(\"open\"),s.hasClass(\"open\")?(s.find(\".option\"),s.find(\".focus\").removeClass(\"focus\"),s.find(\".selected\").addClass(\"focus\")):s.focus()}),e(document).on(\"click.nice_select\",function(t){0===e(t.target).closest(\".nice-select\").length&&e(\".nice-select\").removeClass(\"open\").find(\".option\")}),e(document).on(\"click.nice_select\",\".nice-select .option:not(.disabled)\",function(t){var s=e(this),n=s.closest(\".nice-select\");n.find(\".selected\").removeClass(\"selected\"),s.addClass(\"selected\");var i=s.data(\"display\")||s.text();n.find(\".current\").text(i),n.prev(\"select\").val(s.data(\"value\")).trigger(\"change\")}),e(document).on(\"keydown.nice_select\",\".nice-select\",function(t){var s=e(this),n=e(s.find(\".focus\")||s.find(\".list .option.selected\"));if(32==t.keyCode||13==t.keyCode)return s.hasClass(\"open\")?n.trigger(\"click\"):s.trigger(\"click\"),!1;if(40==t.keyCode){if(s.hasClass(\"open\")){var i=n.nextAll(\".option:not(.disabled)\").first();i.length>0&&(s.find(\".focus\").removeClass(\"focus\"),i.addClass(\"focus\"))}else s.trigger(\"click\");return!1}if(38==t.keyCode){if(s.hasClass(\"open\")){var l=n.prevAll(\".option:not(.disabled)\").first();l.length>0&&(s.find(\".focus\").removeClass(\"focus\"),l.addClass(\"focus\"))}else s.trigger(\"click\");return!1}if(27==t.keyCode)s.hasClass(\"open\")&&s.trigger(\"click\");else if(9==t.keyCode&&s.hasClass(\"open\"))return!1});var n=document.createElement(\"a\").style;return n.cssText=\"pointer-events:auto\",\"auto\"!==n.pointerEvents&&e(\"html\").addClass(\"no-csspointerevents\"),this}}(jQuery);";
var mod_pagespeed_uj3_366yvw = "// Sticky Plugin v1.0.4 for jQuery\n// =============\n// Author: Anthony Garand\n// Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)\n// Improvements by Leonardo C. Daronco (daronco)\n// Created: 02/14/2011\n// Date: 07/20/2015\n// Website: http://stickyjs.com/\n// Description: Makes an element on the page stick on the screen as you scroll\n// It will only set the 'top' and 'position' of your element, you\n// might need to adjust the width in some cases.\n\n(function (factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['jquery'], factory);\n } else if (typeof module === 'object' && module.exports) {\n // Node/CommonJS\n module.exports = factory(require('jquery'));\n } else {\n // Browser globals\n factory(jQuery);\n }\n}(function ($) {\n var slice = Array.prototype.slice; // save ref to original slice()\n var splice = Array.prototype.splice; // save ref to original slice()\n\n var defaults = {\n topSpacing: 0,\n bottomSpacing: 0,\n className: 'is-sticky',\n wrapperClassName: 'sticky-wrapper',\n center: false,\n getWidthFrom: '',\n widthFromWrapper: true, // works only when .getWidthFrom is empty\n responsiveWidth: false,\n zIndex: 'inherit'\n },\n $window = $(window),\n $document = $(document),\n sticked = [],\n windowHeight = $window.height(),\n scroller = function() {\n var scrollTop = $window.scrollTop(),\n documentHeight = $document.height(),\n dwh = documentHeight - windowHeight,\n extra = (scrollTop > dwh) ? dwh - scrollTop : 0;\n\n for (var i = 0, l = sticked.length; i < l; i++) {\n var s = sticked[i],\n elementTop = s.stickyWrapper.offset().top,\n etse = elementTop - s.topSpacing - extra;\n\n //update height in case of dynamic content\n s.stickyWrapper.css('height', s.stickyElement.outerHeight());\n\n if (scrollTop <= etse) {\n if (s.currentTop !== null) {\n s.stickyElement\n .css({\n 'width': '',\n 'position': '',\n 'top': '',\n 'z-index': ''\n });\n s.stickyElement.parent().removeClass(s.className);\n s.stickyElement.trigger('sticky-end', [s]);\n s.currentTop = null;\n }\n }\n else {\n var newTop = documentHeight - s.stickyElement.outerHeight()\n - s.topSpacing - s.bottomSpacing - scrollTop - extra;\n if (newTop < 0) {\n newTop = newTop + s.topSpacing;\n } else {\n newTop = s.topSpacing;\n }\n if (s.currentTop !== newTop) {\n var newWidth;\n if (s.getWidthFrom) {\n padding = s.stickyElement.innerWidth() - s.stickyElement.width();\n newWidth = $(s.getWidthFrom).width() - padding || null;\n } else if (s.widthFromWrapper) {\n newWidth = s.stickyWrapper.width();\n }\n if (newWidth == null) {\n newWidth = s.stickyElement.width();\n }\n s.stickyElement\n .css('width', newWidth)\n .css('position', 'fixed')\n .css('top', newTop)\n .css('z-index', s.zIndex);\n\n s.stickyElement.parent().addClass(s.className);\n\n if (s.currentTop === null) {\n s.stickyElement.trigger('sticky-start', [s]);\n } else {\n // sticky is started but it have to be repositioned\n s.stickyElement.trigger('sticky-update', [s]);\n }\n\n if (s.currentTop === s.topSpacing && s.currentTop > newTop || s.currentTop === null && newTop < s.topSpacing) {\n // just reached bottom || just started to stick but bottom is already reached\n s.stickyElement.trigger('sticky-bottom-reached', [s]);\n } else if(s.currentTop !== null && newTop === s.topSpacing && s.currentTop < newTop) {\n // sticky is started && sticked at topSpacing && overflowing from top just finished\n s.stickyElement.trigger('sticky-bottom-unreached', [s]);\n }\n\n s.currentTop = newTop;\n }\n\n // Check if sticky has reached end of container and stop sticking\n var stickyWrapperContainer = s.stickyWrapper.parent();\n var unstick = (s.stickyElement.offset().top + s.stickyElement.outerHeight() >= stickyWrapperContainer.offset().top + stickyWrapperContainer.outerHeight()) && (s.stickyElement.offset().top <= s.topSpacing);\n\n if( unstick ) {\n s.stickyElement\n .css('position', 'absolute')\n .css('top', '')\n .css('bottom', 0)\n .css('z-index', '');\n } else {\n s.stickyElement\n .css('position', 'fixed')\n .css('top', newTop)\n .css('bottom', '')\n .css('z-index', s.zIndex);\n }\n }\n }\n },\n resizer = function() {\n windowHeight = $window.height();\n\n for (var i = 0, l = sticked.length; i < l; i++) {\n var s = sticked[i];\n var newWidth = null;\n if (s.getWidthFrom) {\n if (s.responsiveWidth) {\n newWidth = $(s.getWidthFrom).width();\n }\n } else if(s.widthFromWrapper) {\n newWidth = s.stickyWrapper.width();\n }\n if (newWidth != null) {\n s.stickyElement.css('width', newWidth);\n }\n }\n },\n methods = {\n init: function(options) {\n return this.each(function() {\n var o = $.extend({}, defaults, options);\n var stickyElement = $(this);\n\n var stickyId = stickyElement.attr('id');\n var wrapperId = stickyId ? stickyId + '-' + defaults.wrapperClassName : defaults.wrapperClassName;\n var wrapper = $('')\n .attr('id', wrapperId)\n .addClass(o.wrapperClassName);\n\n stickyElement.wrapAll(function() {\n if ($(this).parent(\"#\" + wrapperId).length == 0) {\n return wrapper;\n }\n});\n\n var stickyWrapper = stickyElement.parent();\n\n if (o.center) {\n stickyWrapper.css({width:stickyElement.outerWidth(),marginLeft:\"auto\",marginRight:\"auto\"});\n }\n\n if (stickyElement.css(\"float\") === \"right\") {\n stickyElement.css({\"float\":\"none\"}).parent().css({\"float\":\"right\"});\n }\n\n o.stickyElement = stickyElement;\n o.stickyWrapper = stickyWrapper;\n o.currentTop = null;\n\n sticked.push(o);\n\n methods.setWrapperHeight(this);\n methods.setupChangeListeners(this);\n });\n },\n\n setWrapperHeight: function(stickyElement) {\n var element = $(stickyElement);\n var stickyWrapper = element.parent();\n if (stickyWrapper) {\n stickyWrapper.css('height', element.outerHeight());\n }\n },\n\n setupChangeListeners: function(stickyElement) {\n if (window.MutationObserver) {\n var mutationObserver = new window.MutationObserver(function(mutations) {\n if (mutations[0].addedNodes.length || mutations[0].removedNodes.length) {\n methods.setWrapperHeight(stickyElement);\n }\n });\n mutationObserver.observe(stickyElement, {subtree: true, childList: true});\n } else {\n if (window.addEventListener) {\n stickyElement.addEventListener('DOMNodeInserted', function() {\n methods.setWrapperHeight(stickyElement);\n }, false);\n stickyElement.addEventListener('DOMNodeRemoved', function() {\n methods.setWrapperHeight(stickyElement);\n }, false);\n } else if (window.attachEvent) {\n stickyElement.attachEvent('onDOMNodeInserted', function() {\n methods.setWrapperHeight(stickyElement);\n });\n stickyElement.attachEvent('onDOMNodeRemoved', function() {\n methods.setWrapperHeight(stickyElement);\n });\n }\n }\n },\n update: scroller,\n unstick: function(options) {\n return this.each(function() {\n var that = this;\n var unstickyElement = $(that);\n\n var removeIdx = -1;\n var i = sticked.length;\n while (i-- > 0) {\n if (sticked[i].stickyElement.get(0) === that) {\n splice.call(sticked,i,1);\n removeIdx = i;\n }\n }\n if(removeIdx !== -1) {\n unstickyElement.unwrap();\n unstickyElement\n .css({\n 'width': '',\n 'position': '',\n 'top': '',\n 'float': '',\n 'z-index': ''\n })\n ;\n }\n });\n }\n };\n\n // should be more efficient than using $window.scroll(scroller) and $window.resize(resizer):\n if (window.addEventListener) {\n window.addEventListener('scroll', scroller, false);\n window.addEventListener('resize', resizer, false);\n } else if (window.attachEvent) {\n window.attachEvent('onscroll', scroller);\n window.attachEvent('onresize', resizer);\n }\n\n $.fn.sticky = function(method) {\n if (methods[method]) {\n return methods[method].apply(this, slice.call(arguments, 1));\n } else if (typeof method === 'object' || !method ) {\n return methods.init.apply( this, arguments );\n } else {\n $.error('Method ' + method + ' does not exist on jQuery.sticky');\n }\n };\n\n $.fn.unstick = function(method) {\n if (methods[method]) {\n return methods[method].apply(this, slice.call(arguments, 1));\n } else if (typeof method === 'object' || !method ) {\n return methods.unstick.apply( this, arguments );\n } else {\n $.error('Method ' + method + ' does not exist on jQuery.sticky');\n }\n };\n $(function() {\n setTimeout(scroller, 0);\n });\n}));\n";
var mod_pagespeed_$aVQOkhxuF = "/*\n* File: jquery.barfiller.js\n* Version: 1.0.1\n* Description: A plugin that fills bars with a percentage you set.\n* Author: 9bit Studios\n* Copyright 2012, 9bit Studios\n* http://www.9bitstudios.com\n* Free to use and abuse under the MIT license.\n* http://www.opensource.org/licenses/mit-license.php\n*/\n\n(function ($) {\n\n $.fn.barfiller = function (options) {\n\n var defaults = $.extend({\n barColor: '#09CC7F',\n tooltip: true,\n duration: 1000,\n animateOnResize: true,\n symbol: \"%\"\n }, options);\n\n\n /******************************\n Private Variables\n *******************************/ \n\n var object = $(this);\n var settings = $.extend(defaults, options);\n var barWidth = object.width();\n var fill = object.find('.fill');\n var toolTip = object.find('.tip');\n var fillPercentage = fill.attr('data-percentage');\n var resizeTimeout;\n var transitionSupport = false;\n var transitionPrefix;\n\n /******************************\n Public Methods\n *******************************/ \n \n var methods = {\n\n init: function() {\n return this.each(function () {\n if(methods.getTransitionSupport()) {\n transitionSupport = true;\n transitionPrefix = methods.getTransitionPrefix();\n }\n\n methods.appendHTML();\n methods.setEventHandlers();\n methods.initializeItems();\n });\n },\n\n /******************************\n Append HTML\n *******************************/ \n\n appendHTML: function() {\n fill.css('background', settings.barColor);\n\n if(!settings.tooltip) {\n toolTip.css('display', 'none');\n }\n toolTip.text(fillPercentage + settings.symbol);\n },\n \n\n /******************************\n Set Event Handlers\n *******************************/\n setEventHandlers: function() {\n if(settings.animateOnResize) {\n $(window).on(\"resize\", function(event){\n clearTimeout(resizeTimeout);\n resizeTimeout = setTimeout(function() { \n methods.refill(); \n }, 300);\n }); \n }\n }, \n\n /******************************\n Initialize\n *******************************/ \n\n initializeItems: function() {\n var pctWidth = methods.calculateFill(fillPercentage);\n object.find('.tipWrap').css({ display: 'inline' });\n\n if(transitionSupport)\n methods.transitionFill(pctWidth);\n else\n methods.animateFill(pctWidth);\n },\n\n getTransitionSupport: function() {\n\n var thisBody = document.body || document.documentElement,\n thisStyle = thisBody.style;\n var support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined;\n return support; \n },\n \n getTransitionPrefix: function() {\n if(/mozilla/.test(navigator.userAgent.toLowerCase()) && !/webkit/.test(navigator.userAgent.toLowerCase())) {\n return '-moz-transition';\n }\n if(/webkit/.test(navigator.userAgent.toLowerCase())) {\n return '-webkit-transition';\n }\n if(/opera/.test(navigator.userAgent.toLowerCase())) {\n return '-o-transition';\n }\n if (/msie/.test(navigator.userAgent.toLowerCase())) {\n return '-ms-transition';\n }\n else {\n return 'transition';\n }\n },\n\n getTransition: function(val, time, type) {\n\n var CSSObj;\n if(type === 'width') {\n CSSObj = { width : val };\n }\n else if (type === 'left') {\n CSSObj = { left: val };\n }\n\n time = time/1000;\n CSSObj[transitionPrefix] = type+' '+time+'s ease-in-out'; \n return CSSObj;\n\n }, \n\n refill: function() {\n fill.css('width', 0);\n toolTip.css('left', 0);\n barWidth = object.width();\n methods.initializeItems();\n },\n\n calculateFill: function(percentage) {\n percentage = percentage * 0.01;\n var finalWidth = barWidth * percentage;\n return finalWidth;\n }, \n\n transitionFill: function(barWidth) {\n\n var toolTipOffset = barWidth - toolTip.width();\n fill.css( methods.getTransition(barWidth, settings.duration, 'width'));\n toolTip.css( methods.getTransition(toolTipOffset, settings.duration, 'left'));\n\n }, \n\n animateFill: function(barWidth) {\n var toolTipOffset = barWidth - toolTip.width();\n fill.stop().animate({width: '+=' + barWidth}, settings.duration);\n toolTip.stop().animate({left: '+=' + toolTipOffset}, settings.duration);\n }\n \n };\n \n if (methods[options]) { // $(\"#element\").pluginName('methodName', 'arg1', 'arg2');\n return methods[options].apply(this, Array.prototype.slice.call(arguments, 1));\n } else if (typeof options === 'object' || !options) { // $(\"#element\").pluginName({ option: 1, option:2 });\n return methods.init.apply(this); \n } else {\n $.error( 'Method \"' + method + '\" does not exist in barfiller plugin!');\n } \n };\n\n})(jQuery);";
var mod_pagespeed_D6JdEXoYbg = "/*!\n* jquery.counterup.js 1.0\n*\n* Copyright 2013, Benjamin Intal http://gambit.ph @bfintal\n* Released under the GPL v2 License\n*\n* Date: Nov 26, 2013\n*/(function(e){\"use strict\";e.fn.counterUp=function(t){var n=e.extend({time:400,delay:10},t);return this.each(function(){var t=e(this),r=n,i=function(){var e=[],n=r.time/r.delay,i=t.text(),s=/[0-9]+,[0-9]+/.test(i);i=i.replace(/,/g,\"\");var o=/^[0-9]+$/.test(i),u=/^[0-9]+\\.[0-9]+$/.test(i),a=u?(i.split(\".\")[1]||[]).length:0;for(var f=n;f>=1;f--){var l=parseInt(i/n*f);u&&(l=parseFloat(i/n*f).toFixed(a));if(s)while(/(\\d+)(\\d{3})/.test(l.toString()))l=l.toString().replace(/(\\d+)(\\d{3})/,\"$1,$2\");e.unshift(l)}t.data(\"counterup-nums\",e);t.text(\"0\");var c=function(){t.text(t.data(\"counterup-nums\").shift());if(t.data(\"counterup-nums\").length)setTimeout(t.data(\"counterup-func\"),r.delay);else{delete t.data(\"counterup-nums\");t.data(\"counterup-nums\",null);t.data(\"counterup-func\",null)}};t.data(\"counterup-func\",c);setTimeout(t.data(\"counterup-func\"),r.delay)};t.waypoint(i,{offset:\"100%\",triggerOnce:!0})})}})(jQuery);";
var mod_pagespeed_DJZUQoMFmC = "// Generated by CoffeeScript 1.6.2\n/*\njQuery Waypoints - v2.0.3\nCopyright (c) 2011-2013 Caleb Troughton\nDual licensed under the MIT license and GPL license.\nhttps://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt\n*/\n(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e=0;s={horizontal:{},vertical:{}};f=1;a={};u=\"waypoints-context-id\";p=\"resize.waypoints\";y=\"scroll.waypoints\";v=1;w=\"waypoints-waypoint-ids\";g=\"waypoint\";m=\"waypoints\";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id=\"context\"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||c)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m](\"refresh\");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:\"right\",backward:\"left\"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:\"down\",backward:\"up\"}};if(c&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m](\"refresh\")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:\"right\",backward:\"left\",offsetProp:\"left\"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m](\"viewportHeight\"):this.$element.height(),oldScroll:this.oldScroll.y,forward:\"down\",backward:\"up\",offsetProp:\"top\"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i===\"string\"){i=parseFloat(i);if(r.options.offset.indexOf(\"%\")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(\" \"));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset===\"bottom-in-view\"){r.offset=function(){var t;t=n[m](\"viewportHeight\");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?\"horizontal\":\"vertical\";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id=\"waypoints\"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m](\"refresh\");return this},disable:function(){return d._invoke(this,\"disable\")},enable:function(){return d._invoke(this,\"enable\")},destroy:function(){return d._invoke(this,\"destroy\")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,\"horizontal\",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,\"horizontal\",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke(\"enable\")},disable:function(){return h._invoke(\"disable\")},destroy:function(){return h._invoke(\"destroy\")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.load(function(){return n[m](\"refresh\")})})}).call(this);";
var mod_pagespeed_SFo07ryeXn = "/*!\n * The Final Countdown for jQuery v2.2.0 (http://hilios.github.io/jQuery.countdown/)\n * Copyright (c) 2016 Edson Hilios\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n!function(a){\"use strict\";\"function\"==typeof define&&define.amd?define([\"jquery\"],a):a(jQuery)}(function(a){\"use strict\";function b(a){if(a instanceof Date)return a;if(String(a).match(g))return String(a).match(/^[0-9]*$/)&&(a=Number(a)),String(a).match(/\\-/)&&(a=String(a).replace(/\\-/g,\"/\")),new Date(a);throw new Error(\"Couldn't cast `\"+a+\"` to a date object.\")}function c(a){var b=a.toString().replace(/([.?*+^$[\\]\\\\(){}|-])/g,\"\\\\$1\");return new RegExp(b)}function d(a){return function(b){var d=b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(d)for(var f=0,g=d.length;f1?c:d}var f=[],g=[],h={precision:100,elapse:!1,defer:!1};g.push(/^[0-9]*$/.source),g.push(/([0-9]{1,2}\\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g.push(/[0-9]{4}([\\/\\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g=new RegExp(g.join(\"|\"));var i={Y:\"years\",m:\"months\",n:\"daysToMonth\",d:\"daysToWeek\",w:\"weeks\",W:\"weeksToMonth\",H:\"hours\",M:\"minutes\",S:\"seconds\",D:\"totalDays\",I:\"totalHours\",N:\"totalMinutes\",T:\"totalSeconds\"},j=function(b,c,d){this.el=b,this.$el=a(b),this.interval=null,this.offset={},this.options=a.extend({},h),this.firstTick=!0,this.instanceNumber=f.length,f.push(this),this.$el.data(\"countdown-instance\",this.instanceNumber),d&&(\"function\"==typeof d?(this.$el.on(\"update.countdown\",d),this.$el.on(\"stoped.countdown\",d),this.$el.on(\"finish.countdown\",d)):this.options=a.extend({},h,d)),this.setFinalDate(c),this.options.defer===!1&&this.start()};a.extend(j.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var a=this;this.update(),this.interval=setInterval(function(){a.update.call(a)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent(\"stoped\")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),f[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(a){this.finalDate=b(a)},update:function(){if(0===this.$el.closest(\"html\").length)return void this.remove();var a,b=new Date;return a=this.finalDate.getTime()-b.getTime(),a=Math.ceil(a/1e3),a=!this.options.elapse&&a<0?0:Math.abs(a),this.totalSecsLeft===a||this.firstTick?void(this.firstTick=!1):(this.totalSecsLeft=a,this.elapsed=b>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),weeksToMonth:Math.floor(this.totalSecsLeft/60/60/24/7)%4,months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-b.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/60/60/24),totalHours:Math.floor(this.totalSecsLeft/60/60),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft},void(this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent(\"update\"):(this.stop(),this.dispatchEvent(\"finish\"))))},dispatchEvent:function(b){var c=a.Event(b+\".countdown\");c.finalDate=this.finalDate,c.elapsed=this.elapsed,c.offset=a.extend({},this.offset),c.strftime=d(this.offset),this.$el.trigger(c)}}),a.fn.countdown=function(){var b=Array.prototype.slice.call(arguments,0);return this.each(function(){var c=a(this).data(\"countdown-instance\");if(void 0!==c){var d=f[c],e=b[0];j.prototype.hasOwnProperty(e)?d[e].apply(d,b.slice(1)):null===String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(d.setFinalDate.call(d,e),d.start()):a.error(\"Method %s does not exist on jQuery.countdown\".replace(/\\%s/gi,e))}else new j(this,b[0],b[1])})}});";
var mod_pagespeed_5km5F09kY6 = "!function(a){a.fn.snakeify=function(b){var c=a.extend({inaccuracy:30,speed:200},b);this.find(\".overlay\").css({top:-9999999}),this.mouseenter(function(b){const d=a(this),e=d.find(\".overlay\"),f=d.offset(),g=b.pageX-f.left,h=b.pageY-f.top;e.css({top:0,left:0,width:d.width(),height:d.height()}),g>d.width()-c.inaccuracy?e.css({top:0,left:d.width()}):gd.width()-c.inaccuracy?e.css({top:d.width(),left:0}):h=d.width()&&e.animate({top:0,left:d.width()},c.speed),h<=0&&e.animate({left:0,top:-d.height()},c.speed),h>=d.height()&&e.animate({left:0,top:d.height()},c.speed)})}}(jQuery);";
var mod_pagespeed_xxZ5a3VG9v = "$(document).ready(function(){\r\n \r\n (function($) {\r\n \"use strict\";\r\n\r\n \r\n jQuery.validator.addMethod('answercheck', function (value, element) {\r\n return this.optional(element) || /^\\bcat\\b$/.test(value)\r\n }, \"type the correct answer -_-\");\r\n\r\n // validate contactForm form\r\n $(function() {\r\n $('#contactForm').validate({\r\n rules: {\r\n name: {\r\n required: true,\r\n minlength: 2\r\n },\r\n subject: {\r\n required: true,\r\n minlength: 4\r\n },\r\n number: {\r\n required: true,\r\n minlength: 5\r\n },\r\n email: {\r\n required: true,\r\n email: true\r\n },\r\n message: {\r\n required: true,\r\n minlength: 20\r\n }\r\n },\r\n messages: {\r\n name: {\r\n required: \"come on, you have a name, don't you?\",\r\n minlength: \"your name must consist of at least 2 characters\"\r\n },\r\n subject: {\r\n required: \"come on, you have a subject, don't you?\",\r\n minlength: \"your subject must consist of at least 4 characters\"\r\n },\r\n number: {\r\n required: \"come on, you have a number, don't you?\",\r\n minlength: \"your Number must consist of at least 5 characters\"\r\n },\r\n email: {\r\n required: \"no email, no message\"\r\n },\r\n message: {\r\n required: \"um...yea, you have to write something to send this form.\",\r\n minlength: \"thats all? really?\"\r\n }\r\n },\r\n submitHandler: function(form) {\r\n $(form).ajaxSubmit({\r\n type:\"POST\",\r\n data: $(form).serialize(),\r\n url:\"contact_process.php\",\r\n success: function() {\r\n $('#contactForm :input').attr('disabled', 'disabled');\r\n $('#contactForm').fadeTo( \"slow\", 1, function() {\r\n $(this).find(':input').attr('disabled', 'disabled');\r\n $(this).find('label').css('cursor','default');\r\n $('#success').fadeIn()\r\n $('.modal').modal('hide');\r\n $('#success').modal('show');\r\n })\r\n },\r\n error: function() {\r\n $('#contactForm').fadeTo( \"slow\", 1, function() {\r\n $('#error').fadeIn()\r\n $('.modal').modal('hide');\r\n $('#error').modal('show');\r\n })\r\n }\r\n })\r\n }\r\n })\r\n })\r\n \r\n })(jQuery)\r\n})";
var mod_pagespeed_PHhY4VehVY = "/*!\n * jQuery Form Plugin\n * version: 3.32.0-2013.04.09\n * @requires jQuery v1.5 or later\n * Copyright (c) 2013 M. Alsup\n * Examples and documentation at: http://malsup.com/jquery/form/\n * Project repository: https://github.com/malsup/form\n * Dual licensed under the MIT and GPL licenses.\n * https://github.com/malsup/form#copyright-and-license\n */\n/*global ActiveXObject */\n;(function($) {\n\"use strict\";\n\n/*\n Usage Note:\n -----------\n Do not use both ajaxSubmit and ajaxForm on the same form. These\n functions are mutually exclusive. Use ajaxSubmit if you want\n to bind your own submit handler to the form. For example,\n\n $(document).ready(function() {\n $('#myForm').on('submit', function(e) {\n e.preventDefault(); // <-- important\n $(this).ajaxSubmit({\n target: '#output'\n });\n });\n });\n\n Use ajaxForm when you want the plugin to manage all the event binding\n for you. For example,\n\n $(document).ready(function() {\n $('#myForm').ajaxForm({\n target: '#output'\n });\n });\n\n You can also use ajaxForm with delegation (requires jQuery v1.7+), so the\n form does not have to exist when you invoke ajaxForm:\n\n $('#myForm').ajaxForm({\n delegation: true,\n target: '#output'\n });\n\n When using ajaxForm, the ajaxSubmit function will be invoked for you\n at the appropriate time.\n*/\n\n/**\n * Feature detection\n */\nvar feature = {};\nfeature.fileapi = $(\"\").get(0).files !== undefined;\nfeature.formdata = window.FormData !== undefined;\n\nvar hasProp = !!$.fn.prop;\n\n// attr2 uses prop when it can but checks the return type for\n// an expected string. this accounts for the case where a form \n// contains inputs with names like \"action\" or \"method\"; in those\n// cases \"prop\" returns the element\n$.fn.attr2 = function() {\n if ( ! hasProp )\n return this.attr.apply(this, arguments);\n var val = this.prop.apply(this, arguments);\n if ( ( val && val.jquery ) || typeof val === 'string' )\n return val;\n return this.attr.apply(this, arguments);\n};\n\n/**\n * ajaxSubmit() provides a mechanism for immediately submitting\n * an HTML form using AJAX.\n */\n$.fn.ajaxSubmit = function(options) {\n /*jshint scripturl:true */\n\n // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)\n if (!this.length) {\n log('ajaxSubmit: skipping submit process - no element selected');\n return this;\n }\n\n var method, action, url, $form = this;\n\n if (typeof options == 'function') {\n options = { success: options };\n }\n\n method = this.attr2('method');\n action = this.attr2('action');\n\n url = (typeof action === 'string') ? $.trim(action) : '';\n url = url || window.location.href || '';\n if (url) {\n // clean url (don't include hash vaue)\n url = (url.match(/^([^#]+)/)||[])[1];\n }\n\n options = $.extend(true, {\n url: url,\n success: $.ajaxSettings.success,\n type: method || 'GET',\n iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'\n }, options);\n\n // hook for manipulating the form data before it is extracted;\n // convenient for use with rich editors like tinyMCE or FCKEditor\n var veto = {};\n this.trigger('form-pre-serialize', [this, options, veto]);\n if (veto.veto) {\n log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');\n return this;\n }\n\n // provide opportunity to alter form data before it is serialized\n if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {\n log('ajaxSubmit: submit aborted via beforeSerialize callback');\n return this;\n }\n\n var traditional = options.traditional;\n if ( traditional === undefined ) {\n traditional = $.ajaxSettings.traditional;\n }\n\n var elements = [];\n var qx, a = this.formToArray(options.semantic, elements);\n if (options.data) {\n options.extraData = options.data;\n qx = $.param(options.data, traditional);\n }\n\n // give pre-submit callback an opportunity to abort the submit\n if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {\n log('ajaxSubmit: submit aborted via beforeSubmit callback');\n return this;\n }\n\n // fire vetoable 'validate' event\n this.trigger('form-submit-validate', [a, this, options, veto]);\n if (veto.veto) {\n log('ajaxSubmit: submit vetoed via form-submit-validate trigger');\n return this;\n }\n\n var q = $.param(a, traditional);\n if (qx) {\n q = ( q ? (q + '&' + qx) : qx );\n }\n if (options.type.toUpperCase() == 'GET') {\n options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;\n options.data = null; // data is null for 'get'\n }\n else {\n options.data = q; // data is the query string for 'post'\n }\n\n var callbacks = [];\n if (options.resetForm) {\n callbacks.push(function() { $form.resetForm(); });\n }\n if (options.clearForm) {\n callbacks.push(function() { $form.clearForm(options.includeHidden); });\n }\n\n // perform a load on the target only if dataType is not provided\n if (!options.dataType && options.target) {\n var oldSuccess = options.success || function(){};\n callbacks.push(function(data) {\n var fn = options.replaceTarget ? 'replaceWith' : 'html';\n $(options.target)[fn](data).each(oldSuccess, arguments);\n });\n }\n else if (options.success) {\n callbacks.push(options.success);\n }\n\n options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg\n var context = options.context || this ; // jQuery 1.4+ supports scope context\n for (var i=0, max=callbacks.length; i < max; i++) {\n callbacks[i].apply(context, [data, status, xhr || $form, $form]);\n }\n };\n\n // are there files to upload?\n\n // [value] (issue #113), also see comment:\n // https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219\n var fileInputs = $('input[type=file]:enabled[value!=\"\"]', this);\n\n var hasFileInputs = fileInputs.length > 0;\n var mp = 'multipart/form-data';\n var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);\n\n var fileAPI = feature.fileapi && feature.formdata;\n log(\"fileAPI :\" + fileAPI);\n var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;\n\n var jqxhr;\n\n // options.iframe allows user to force iframe mode\n // 06-NOV-09: now defaulting to iframe mode if file input is detected\n if (options.iframe !== false && (options.iframe || shouldUseFrame)) {\n // hack to fix Safari hang (thanks to Tim Molendijk for this)\n // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d\n if (options.closeKeepAlive) {\n $.get(options.closeKeepAlive, function() {\n jqxhr = fileUploadIframe(a);\n });\n }\n else {\n jqxhr = fileUploadIframe(a);\n }\n }\n else if ((hasFileInputs || multipart) && fileAPI) {\n jqxhr = fileUploadXhr(a);\n }\n else {\n jqxhr = $.ajax(options);\n }\n\n $form.removeData('jqxhr').data('jqxhr', jqxhr);\n\n // clear element array\n for (var k=0; k < elements.length; k++)\n elements[k] = null;\n\n // fire 'notify' event\n this.trigger('form-submit-notify', [this, options]);\n return this;\n\n // utility fn for deep serialization\n function deepSerialize(extraData){\n var serialized = $.param(extraData).split('&');\n var len = serialized.length;\n var result = [];\n var i, part;\n for (i=0; i < len; i++) {\n // #252; undo param space replacement\n serialized[i] = serialized[i].replace(/\\+/g,' ');\n part = serialized[i].split('=');\n // #278; use array instead of object storage, favoring array serializations\n result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]);\n }\n return result;\n }\n\n // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)\n function fileUploadXhr(a) {\n var formdata = new FormData();\n\n for (var i=0; i < a.length; i++) {\n formdata.append(a[i].name, a[i].value);\n }\n\n if (options.extraData) {\n var serializedData = deepSerialize(options.extraData);\n for (i=0; i < serializedData.length; i++)\n if (serializedData[i])\n formdata.append(serializedData[i][0], serializedData[i][1]);\n }\n\n options.data = null;\n\n var s = $.extend(true, {}, $.ajaxSettings, options, {\n contentType: false,\n processData: false,\n cache: false,\n type: method || 'POST'\n });\n\n if (options.uploadProgress) {\n // workaround because jqXHR does not expose upload property\n s.xhr = function() {\n var xhr = jQuery.ajaxSettings.xhr();\n if (xhr.upload) {\n xhr.upload.addEventListener('progress', function(event) {\n var percent = 0;\n var position = event.loaded || event.position; /*event.position is deprecated*/\n var total = event.total;\n if (event.lengthComputable) {\n percent = Math.ceil(position / total * 100);\n }\n options.uploadProgress(event, position, total, percent);\n }, false);\n }\n return xhr;\n };\n }\n\n s.data = null;\n var beforeSend = s.beforeSend;\n s.beforeSend = function(xhr, o) {\n o.data = formdata;\n if(beforeSend)\n beforeSend.call(this, xhr, o);\n };\n return $.ajax(s);\n }\n\n // private function for handling file uploads (hat tip to YAHOO!)\n function fileUploadIframe(a) {\n var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;\n var deferred = $.Deferred();\n\n if (a) {\n // ensure that every serialized input is still enabled\n for (i=0; i < elements.length; i++) {\n el = $(elements[i]);\n if ( hasProp )\n el.prop('disabled', false);\n else\n el.removeAttr('disabled');\n }\n }\n\n s = $.extend(true, {}, $.ajaxSettings, options);\n s.context = s.context || s;\n id = 'jqFormIO' + (new Date().getTime());\n if (s.iframeTarget) {\n $io = $(s.iframeTarget);\n n = $io.attr2('name');\n if (!n)\n $io.attr2('name', id);\n else\n id = n;\n }\n else {\n $io = $('');\n $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });\n }\n io = $io[0];\n\n\n xhr = { // mock object\n aborted: 0,\n responseText: null,\n responseXML: null,\n status: 0,\n statusText: 'n/a',\n getAllResponseHeaders: function() {},\n getResponseHeader: function() {},\n setRequestHeader: function() {},\n abort: function(status) {\n var e = (status === 'timeout' ? 'timeout' : 'aborted');\n log('aborting upload... ' + e);\n this.aborted = 1;\n\n try { // #214, #257\n if (io.contentWindow.document.execCommand) {\n io.contentWindow.document.execCommand('Stop');\n }\n }\n catch(ignore) {}\n\n $io.attr('src', s.iframeSrc); // abort op in progress\n xhr.error = e;\n if (s.error)\n s.error.call(s.context, xhr, e, status);\n if (g)\n $.event.trigger(\"ajaxError\", [xhr, s, e]);\n if (s.complete)\n s.complete.call(s.context, xhr, e);\n }\n };\n\n g = s.global;\n // trigger ajax global events so that activity/block indicators work like normal\n if (g && 0 === $.active++) {\n $.event.trigger(\"ajaxStart\");\n }\n if (g) {\n $.event.trigger(\"ajaxSend\", [xhr, s]);\n }\n\n if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {\n if (s.global) {\n $.active--;\n }\n deferred.reject();\n return deferred;\n }\n if (xhr.aborted) {\n deferred.reject();\n return deferred;\n }\n\n // add submitting element to data if we know it\n sub = form.clk;\n if (sub) {\n n = sub.name;\n if (n && !sub.disabled) {\n s.extraData = s.extraData || {};\n s.extraData[n] = sub.value;\n if (sub.type == \"image\") {\n s.extraData[n+'.x'] = form.clk_x;\n s.extraData[n+'.y'] = form.clk_y;\n }\n }\n }\n\n var CLIENT_TIMEOUT_ABORT = 1;\n var SERVER_ABORT = 2;\n \n function getDoc(frame) {\n /* it looks like contentWindow or contentDocument do not\n * carry the protocol property in ie8, when running under ssl\n * frame.document is the only valid response document, since\n * the protocol is know but not on the other two objects. strange?\n * \"Same origin policy\" http://en.wikipedia.org/wiki/Same_origin_policy\n */\n \n var doc = null;\n \n // IE8 cascading access check\n try {\n if (frame.contentWindow) {\n doc = frame.contentWindow.document;\n }\n } catch(err) {\n // IE8 access denied under ssl & missing protocol\n log('cannot get iframe.contentWindow document: ' + err);\n }\n\n if (doc) { // successful getting content\n return doc;\n }\n\n try { // simply checking may throw in ie8 under ssl or mismatched protocol\n doc = frame.contentDocument ? frame.contentDocument : frame.document;\n } catch(err) {\n // last attempt\n log('cannot get iframe.contentDocument: ' + err);\n doc = frame.document;\n }\n return doc;\n }\n\n // Rails CSRF hack (thanks to Yvan Barthelemy)\n var csrf_token = $('meta[name=csrf-token]').attr('content');\n var csrf_param = $('meta[name=csrf-param]').attr('content');\n if (csrf_param && csrf_token) {\n s.extraData = s.extraData || {};\n s.extraData[csrf_param] = csrf_token;\n }\n\n // take a breath so that pending repaints get some cpu time before the upload starts\n function doSubmit() {\n // make sure form attrs are set\n var t = $form.attr2('target'), a = $form.attr2('action');\n\n // update form attrs in IE friendly way\n form.setAttribute('target',id);\n if (!method) {\n form.setAttribute('method', 'POST');\n }\n if (a != s.url) {\n form.setAttribute('action', s.url);\n }\n\n // ie borks in some cases when setting encoding\n if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {\n $form.attr({\n encoding: 'multipart/form-data',\n enctype: 'multipart/form-data'\n });\n }\n\n // support timout\n if (s.timeout) {\n timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);\n }\n\n // look for server aborts\n function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }\n\n // add \"extra\" data to form if provided in options\n var extraInputs = [];\n try {\n if (s.extraData) {\n for (var n in s.extraData) {\n if (s.extraData.hasOwnProperty(n)) {\n // if using the $.param format that allows for multiple values with the same name\n if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {\n extraInputs.push(\n $('').val(s.extraData[n].value)\n .appendTo(form)[0]);\n } else {\n extraInputs.push(\n $('').val(s.extraData[n])\n .appendTo(form)[0]);\n }\n }\n }\n }\n\n if (!s.iframeTarget) {\n // add iframe to doc and submit the form\n $io.appendTo('body');\n if (io.attachEvent)\n io.attachEvent('onload', cb);\n else\n io.addEventListener('load', cb, false);\n }\n setTimeout(checkState,15);\n\n try {\n form.submit();\n } catch(err) {\n // just in case form has element with name/id of 'submit'\n var submitFn = document.createElement('form').submit;\n submitFn.apply(form);\n }\n }\n finally {\n // reset attrs and remove \"extra\" input elements\n form.setAttribute('action',a);\n if(t) {\n form.setAttribute('target', t);\n } else {\n $form.removeAttr('target');\n }\n $(extraInputs).remove();\n }\n }\n\n if (s.forceSync) {\n doSubmit();\n }\n else {\n setTimeout(doSubmit, 10); // this lets dom updates render\n }\n\n var data, doc, domCheckCount = 50, callbackProcessed;\n\n function cb(e) {\n if (xhr.aborted || callbackProcessed) {\n return;\n }\n \n doc = getDoc(io);\n if(!doc) {\n log('cannot access response document');\n e = SERVER_ABORT;\n }\n if (e === CLIENT_TIMEOUT_ABORT && xhr) {\n xhr.abort('timeout');\n deferred.reject(xhr, 'timeout');\n return;\n }\n else if (e == SERVER_ABORT && xhr) {\n xhr.abort('server abort');\n deferred.reject(xhr, 'error', 'server abort');\n return;\n }\n\n if (!doc || doc.location.href == s.iframeSrc) {\n // response not received yet\n if (!timedOut)\n return;\n }\n if (io.detachEvent)\n io.detachEvent('onload', cb);\n else\n io.removeEventListener('load', cb, false);\n\n var status = 'success', errMsg;\n try {\n if (timedOut) {\n throw 'timeout';\n }\n\n var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);\n log('isXml='+isXml);\n if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {\n if (--domCheckCount) {\n // in some browsers (Opera) the iframe DOM is not always traversable when\n // the onload callback fires, so we loop a bit to accommodate\n log('requeing onLoad callback, DOM not available');\n setTimeout(cb, 250);\n return;\n }\n // let this fall through because server response could be an empty document\n //log('Could not access iframe DOM after mutiple tries.');\n //throw 'DOMException: not available';\n }\n\n //log('response detected');\n var docRoot = doc.body ? doc.body : doc.documentElement;\n xhr.responseText = docRoot ? docRoot.innerHTML : null;\n xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;\n if (isXml)\n s.dataType = 'xml';\n xhr.getResponseHeader = function(header){\n var headers = {'content-type': s.dataType};\n return headers[header];\n };\n // support for XHR 'status' & 'statusText' emulation :\n if (docRoot) {\n xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;\n xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;\n }\n\n var dt = (s.dataType || '').toLowerCase();\n var scr = /(json|script|text)/.test(dt);\n if (scr || s.textarea) {\n // see if user embedded response in textarea\n var ta = doc.getElementsByTagName('textarea')[0];\n if (ta) {\n xhr.responseText = ta.value;\n // support for XHR 'status' & 'statusText' emulation :\n xhr.status = Number( ta.getAttribute('status') ) || xhr.status;\n xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;\n }\n else if (scr) {\n // account for browsers injecting pre around json response\n var pre = doc.getElementsByTagName('pre')[0];\n var b = doc.getElementsByTagName('body')[0];\n if (pre) {\n xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;\n }\n else if (b) {\n xhr.responseText = b.textContent ? b.textContent : b.innerText;\n }\n }\n }\n else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {\n xhr.responseXML = toXml(xhr.responseText);\n }\n\n try {\n data = httpData(xhr, dt, s);\n }\n catch (err) {\n status = 'parsererror';\n xhr.error = errMsg = (err || status);\n }\n }\n catch (err) {\n log('error caught: ',err);\n status = 'error';\n xhr.error = errMsg = (err || status);\n }\n\n if (xhr.aborted) {\n log('upload aborted');\n status = null;\n }\n\n if (xhr.status) { // we've set xhr.status\n status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';\n }\n\n // ordering of these callbacks/triggers is odd, but that's how $.ajax does it\n if (status === 'success') {\n if (s.success)\n s.success.call(s.context, data, 'success', xhr);\n deferred.resolve(xhr.responseText, 'success', xhr);\n if (g)\n $.event.trigger(\"ajaxSuccess\", [xhr, s]);\n }\n else if (status) {\n if (errMsg === undefined)\n errMsg = xhr.statusText;\n if (s.error)\n s.error.call(s.context, xhr, status, errMsg);\n deferred.reject(xhr, 'error', errMsg);\n if (g)\n $.event.trigger(\"ajaxError\", [xhr, s, errMsg]);\n }\n\n if (g)\n $.event.trigger(\"ajaxComplete\", [xhr, s]);\n\n if (g && ! --$.active) {\n $.event.trigger(\"ajaxStop\");\n }\n\n if (s.complete)\n s.complete.call(s.context, xhr, status);\n\n callbackProcessed = true;\n if (s.timeout)\n clearTimeout(timeoutHandle);\n\n // clean up\n setTimeout(function() {\n if (!s.iframeTarget)\n $io.remove();\n xhr.responseXML = null;\n }, 100);\n }\n\n var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)\n if (window.ActiveXObject) {\n doc = new ActiveXObject('Microsoft.XMLDOM');\n doc.async = 'false';\n doc.loadXML(s);\n }\n else {\n doc = (new DOMParser()).parseFromString(s, 'text/xml');\n }\n return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;\n };\n var parseJSON = $.parseJSON || function(s) {\n /*jslint evil:true */\n return window['eval']('(' + s + ')');\n };\n\n var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4\n\n var ct = xhr.getResponseHeader('content-type') || '',\n xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,\n data = xml ? xhr.responseXML : xhr.responseText;\n\n if (xml && data.documentElement.nodeName === 'parsererror') {\n if ($.error)\n $.error('parsererror');\n }\n if (s && s.dataFilter) {\n data = s.dataFilter(data, type);\n }\n if (typeof data === 'string') {\n if (type === 'json' || !type && ct.indexOf('json') >= 0) {\n data = parseJSON(data);\n } else if (type === \"script\" || !type && ct.indexOf(\"javascript\") >= 0) {\n $.globalEval(data);\n }\n }\n return data;\n };\n\n return deferred;\n }\n};\n\n/**\n * ajaxForm() provides a mechanism for fully automating form submission.\n *\n * The advantages of using this method instead of ajaxSubmit() are:\n *\n * 1: This method will include coordinates for elements (if the element\n * is used to submit the form).\n * 2. This method will include the submit element's name/value data (for the element that was\n * used to submit the form).\n * 3. This method binds the submit() method to the form for you.\n *\n * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely\n * passes the options argument along after properly binding events for submit elements and\n * the form itself.\n */\n$.fn.ajaxForm = function(options) {\n options = options || {};\n options.delegation = options.delegation && $.isFunction($.fn.on);\n\n // in jQuery 1.3+ we can fix mistakes with the ready state\n if (!options.delegation && this.length === 0) {\n var o = { s: this.selector, c: this.context };\n if (!$.isReady && o.s) {\n log('DOM not ready, queuing ajaxForm');\n $(function() {\n $(o.s,o.c).ajaxForm(options);\n });\n return this;\n }\n // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()\n log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));\n return this;\n }\n\n if ( options.delegation ) {\n $(document)\n .off('submit.form-plugin', this.selector, doAjaxSubmit)\n .off('click.form-plugin', this.selector, captureSubmittingElement)\n .on('submit.form-plugin', this.selector, options, doAjaxSubmit)\n .on('click.form-plugin', this.selector, options, captureSubmittingElement);\n return this;\n }\n\n return this.ajaxFormUnbind()\n .bind('submit.form-plugin', options, doAjaxSubmit)\n .bind('click.form-plugin', options, captureSubmittingElement);\n};\n\n// private event handlers\nfunction doAjaxSubmit(e) {\n /*jshint validthis:true */\n var options = e.data;\n if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed\n e.preventDefault();\n $(this).ajaxSubmit(options);\n }\n}\n\nfunction captureSubmittingElement(e) {\n /*jshint validthis:true */\n var target = e.target;\n var $el = $(target);\n if (!($el.is(\"[type=submit],[type=image]\"))) {\n // is this a child element of the submit el? (ex: a span within a button)\n var t = $el.closest('[type=submit]');\n if (t.length === 0) {\n return;\n }\n target = t[0];\n }\n var form = this;\n form.clk = target;\n if (target.type == 'image') {\n if (e.offsetX !== undefined) {\n form.clk_x = e.offsetX;\n form.clk_y = e.offsetY;\n } else if (typeof $.fn.offset == 'function') {\n var offset = $el.offset();\n form.clk_x = e.pageX - offset.left;\n form.clk_y = e.pageY - offset.top;\n } else {\n form.clk_x = e.pageX - target.offsetLeft;\n form.clk_y = e.pageY - target.offsetTop;\n }\n }\n // clear form vars\n setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);\n}\n\n\n// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm\n$.fn.ajaxFormUnbind = function() {\n return this.unbind('submit.form-plugin click.form-plugin');\n};\n\n/**\n * formToArray() gathers form element data into an array of objects that can\n * be passed to any of the following ajax functions: $.get, $.post, or load.\n * Each object in the array has both a 'name' and 'value' property. An example of\n * an array for a simple login form might be:\n *\n * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]\n *\n * It is this array that is passed to pre-submit callback functions provided to the\n * ajaxSubmit() and ajaxForm() methods.\n */\n$.fn.formToArray = function(semantic, elements) {\n var a = [];\n if (this.length === 0) {\n return a;\n }\n\n var form = this[0];\n var els = semantic ? form.getElementsByTagName('*') : form.elements;\n if (!els) {\n return a;\n }\n\n var i,j,n,v,el,max,jmax;\n for(i=0, max=els.length; i < max; i++) {\n el = els[i];\n n = el.name;\n if (!n || el.disabled) {\n continue;\n }\n\n if (semantic && form.clk && el.type == \"image\") {\n // handle image inputs on the fly when semantic == true\n if(form.clk == el) {\n a.push({name: n, value: $(el).val(), type: el.type });\n a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});\n }\n continue;\n }\n\n v = $.fieldValue(el, true);\n if (v && v.constructor == Array) {\n if (elements)\n elements.push(el);\n for(j=0, jmax=v.length; j < jmax; j++) {\n a.push({name: n, value: v[j]});\n }\n }\n else if (feature.fileapi && el.type == 'file') {\n if (elements)\n elements.push(el);\n var files = el.files;\n if (files.length) {\n for (j=0; j < files.length; j++) {\n a.push({name: n, value: files[j], type: el.type});\n }\n }\n else {\n // #180\n a.push({ name: n, value: '', type: el.type });\n }\n }\n else if (v !== null && typeof v != 'undefined') {\n if (elements)\n elements.push(el);\n a.push({name: n, value: v, type: el.type, required: el.required});\n }\n }\n\n if (!semantic && form.clk) {\n // input type=='image' are not found in elements array! handle it here\n var $input = $(form.clk), input = $input[0];\n n = input.name;\n if (n && !input.disabled && input.type == 'image') {\n a.push({name: n, value: $input.val()});\n a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});\n }\n }\n return a;\n};\n\n/**\n * Serializes form data into a 'submittable' string. This method will return a string\n * in the format: name1=value1&name2=value2\n */\n$.fn.formSerialize = function(semantic) {\n //hand off to jQuery.param for proper encoding\n return $.param(this.formToArray(semantic));\n};\n\n/**\n * Serializes all field elements in the jQuery object into a query string.\n * This method will return a string in the format: name1=value1&name2=value2\n */\n$.fn.fieldSerialize = function(successful) {\n var a = [];\n this.each(function() {\n var n = this.name;\n if (!n) {\n return;\n }\n var v = $.fieldValue(this, successful);\n if (v && v.constructor == Array) {\n for (var i=0,max=v.length; i < max; i++) {\n a.push({name: n, value: v[i]});\n }\n }\n else if (v !== null && typeof v != 'undefined') {\n a.push({name: this.name, value: v});\n }\n });\n //hand off to jQuery.param for proper encoding\n return $.param(a);\n};\n\n/**\n * Returns the value(s) of the element in the matched set. For example, consider the following form:\n *\n * \n *\n * var v = $('input[type=text]').fieldValue();\n * // if no values are entered into the text inputs\n * v == ['','']\n * // if values entered into the text inputs are 'foo' and 'bar'\n * v == ['foo','bar']\n *\n * var v = $('input[type=checkbox]').fieldValue();\n * // if neither checkbox is checked\n * v === undefined\n * // if both checkboxes are checked\n * v == ['B1', 'B2']\n *\n * var v = $('input[type=radio]').fieldValue();\n * // if neither radio is checked\n * v === undefined\n * // if first radio is checked\n * v == ['C1']\n *\n * The successful argument controls whether or not the field element must be 'successful'\n * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).\n * The default value of the successful argument is true. If this value is false the value(s)\n * for each element is returned.\n *\n * Note: This method *always* returns an array. If no valid value can be determined the\n * array will be empty, otherwise it will contain one or more values.\n */\n$.fn.fieldValue = function(successful) {\n for (var val=[], i=0, max=this.length; i < max; i++) {\n var el = this[i];\n var v = $.fieldValue(el, successful);\n if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {\n continue;\n }\n if (v.constructor == Array)\n $.merge(val, v);\n else\n val.push(v);\n }\n return val;\n};\n\n/**\n * Returns the value of the field element.\n */\n$.fieldValue = function(el, successful) {\n var n = el.name, t = el.type, tag = el.tagName.toLowerCase();\n if (successful === undefined) {\n successful = true;\n }\n\n if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||\n (t == 'checkbox' || t == 'radio') && !el.checked ||\n (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||\n tag == 'select' && el.selectedIndex == -1)) {\n return null;\n }\n\n if (tag == 'select') {\n var index = el.selectedIndex;\n if (index < 0) {\n return null;\n }\n var a = [], ops = el.options;\n var one = (t == 'select-one');\n var max = (one ? index+1 : ops.length);\n for(var i=(one ? index : 0); i < max; i++) {\n var op = ops[i];\n if (op.selected) {\n var v = op.value;\n if (!v) { // extra pain for IE...\n v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;\n }\n if (one) {\n return v;\n }\n a.push(v);\n }\n }\n return a;\n }\n return $(el).val();\n};\n\n/**\n * Clears the form data. Takes the following actions on the form's input fields:\n * - input text fields will have their 'value' property set to the empty string\n * - select elements will have their 'selectedIndex' property set to -1\n * - checkbox and radio inputs will have their 'checked' property set to false\n * - inputs of type submit, button, reset, and hidden will *not* be effected\n * - button elements will *not* be effected\n */\n$.fn.clearForm = function(includeHidden) {\n return this.each(function() {\n $('input,select,textarea', this).clearFields(includeHidden);\n });\n};\n\n/**\n * Clears the selected form elements.\n */\n$.fn.clearFields = $.fn.clearInputs = function(includeHidden) {\n var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list\n return this.each(function() {\n var t = this.type, tag = this.tagName.toLowerCase();\n if (re.test(t) || tag == 'textarea') {\n this.value = '';\n }\n else if (t == 'checkbox' || t == 'radio') {\n this.checked = false;\n }\n else if (tag == 'select') {\n this.selectedIndex = -1;\n }\n else if (t == \"file\") {\n if (/MSIE/.test(navigator.userAgent)) {\n $(this).replaceWith($(this).clone(true));\n } else {\n $(this).val('');\n }\n }\n else if (includeHidden) {\n // includeHidden can be the value true, or it can be a selector string\n // indicating a special test; for example:\n // $('#myForm').clearForm('.special:hidden')\n // the above would clean hidden inputs that have the class of 'special'\n if ( (includeHidden === true && /hidden/.test(t)) ||\n (typeof includeHidden == 'string' && $(this).is(includeHidden)) )\n this.value = '';\n }\n });\n};\n\n/**\n * Resets the form data. Causes all form elements to be reset to their original value.\n */\n$.fn.resetForm = function() {\n return this.each(function() {\n // guard against an input with the name of 'reset'\n // note that IE reports the reset function as an 'object'\n if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {\n this.reset();\n }\n });\n};\n\n/**\n * Enables or disables any matching elements.\n */\n$.fn.enable = function(b) {\n if (b === undefined) {\n b = true;\n }\n return this.each(function() {\n this.disabled = !b;\n });\n};\n\n/**\n * Checks/unchecks any matching checkboxes or radio buttons and\n * selects/deselects and matching option elements.\n */\n$.fn.selected = function(select) {\n if (select === undefined) {\n select = true;\n }\n return this.each(function() {\n var t = this.type;\n if (t == 'checkbox' || t == 'radio') {\n this.checked = select;\n }\n else if (this.tagName.toLowerCase() == 'option') {\n var $sel = $(this).parent('select');\n if (select && $sel[0] && $sel[0].type == 'select-one') {\n // deselect all other options\n $sel.find('option').selected(false);\n }\n this.selected = select;\n }\n });\n};\n\n// expose debug var\n$.fn.ajaxSubmit.debug = false;\n\n// helper fn for console logging\nfunction log() {\n if (!$.fn.ajaxSubmit.debug)\n return;\n var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');\n if (window.console && window.console.log) {\n window.console.log(msg);\n }\n else if (window.opera && window.opera.postError) {\n window.opera.postError(msg);\n }\n}\n\n})(jQuery);\n";