
try {
    var omCookieGroups = JSON.parse(document.getElementById('om-cookie-consent').innerHTML);
    var omGtmEvents = [];
}
catch(err) {
    console.log('OM Cookie Manager: No Cookie Groups found! Maybe you have forgot to set the page id inside the constants of the extension')
}


//$(document).ready(function() {
//	console.log(clean_1[0]);
//});


document.addEventListener('DOMContentLoaded', function(){
    var panelButtons = document.querySelectorAll('[data-omcookie-panel-save]');
    var openButtons = document.querySelectorAll('[data-omcookie-panel-show]');
    var i;
    var omCookiePanel = document.querySelectorAll('[data-omcookie-panel]')[0];
    if(omCookiePanel === undefined) return;
    var openCookiePanel = true;

    //Enable stuff by Cookie
    var cookieConsentData = omCookieUtility.getCookie('omCookieConsent');
    if(cookieConsentData !== null && cookieConsentData.length > 0){
        //dont open the panel if we have the cookie
        openCookiePanel = false;
        var checkboxes = document.querySelectorAll('[data-omcookie-panel-grp]');
        var cookieConsentGrps = cookieConsentData.split(',');
        var cookieConsentActiveGrps = '';

        for(i = 0; i < cookieConsentGrps.length; i++){
            if(cookieConsentGrps[i] !== 'dismiss'){
                var grpSettings = cookieConsentGrps[i].split('.');
                if(parseInt(grpSettings[1]) === 1){
                    omCookieEnableCookieGrp(grpSettings[0]);
                    cookieConsentActiveGrps += grpSettings[0] + ',';
                }
            }
        }
        for(i = 0; i < checkboxes.length; i++){
            if(cookieConsentActiveGrps.indexOf(checkboxes[i].value)  !== -1){
                checkboxes[i].checked = true;
            }
            //check if we have a new group
            if(cookieConsentData.indexOf(checkboxes[i].value) === -1){
                openCookiePanel = true;
            }
        }
        //push stored events(sored by omCookieEnableCookieGrp) to gtm. We push this last so we are sure that gtm is loaded
        pushGtmEvents(omGtmEvents);
        omTriggerPanelEvent(['cookieconsentscriptsloaded']);
    }
    if(openCookiePanel === true){
        //timeout, so the user can see the page before he get the nice cookie panel
        setTimeout(function () {
            omCookiePanel.classList.toggle('active');
        },1000);
    }

    //check for button click
    for (i = 0; i < panelButtons.length; i++) {
        panelButtons[i].addEventListener('click', omCookieSaveAction, false);
    }
    for (i = 0; i < openButtons.length; i++) {
        openButtons[i].addEventListener('click', function () {
            omCookiePanel.classList.toggle('active');
        }, false);
    }

});

//activates the groups
var omCookieSaveAction = function() {
    action = this.getAttribute('data-omcookie-panel-save');
    var checkboxes = document.querySelectorAll('[data-omcookie-panel-grp]');
    var i;
    var cookie = '';
    // disable, disgroup added by fmu
    var disable = '';
    var disgroup = [];
    switch (action) {
        case 'all':
            for (i = 0; i < checkboxes.length; i++) {
                omCookieEnableCookieGrp(checkboxes[i].value);
                cookie += checkboxes[i].value + '.1,';
                checkboxes[i].checked = true;
            }
        break;
        case 'save':
            for (i = 0; i < checkboxes.length; i++) {
                if(checkboxes[i].checked === true){
                    omCookieEnableCookieGrp(checkboxes[i].value);
                    cookie += checkboxes[i].value + '.1,';
                }else{
                    cookie += checkboxes[i].value + '.0,';
                    // start added by fmu for cleanup
                    disable = checkboxes[i].value;
                    disgrp = disable.replace("group-","clean_");
                    //disgroup = clean_2;
                    disgroup = eval(disgrp);
                    //console.log('Disgrp: ' + disgrp);
                    //console.log('Disgroup: ' + disgroup);
                    for (j = 0; j < disgroup.length; j++) {
                        //console.log('Disgroup in Schleife: ' + disgroup[j]);
                        omCookieUtility.cleanupCookie(disgroup[j][0],disgroup[j][1]);
                    }
                    // end added by fmu
                }
            }
            // fmu log
            // console.log('Domain: ' + document.domain);
            // end log
        break;
        case 'min':
            for (i = 0; i < checkboxes.length; i++) {
                if(checkboxes[i].getAttribute('data-omcookie-panel-essential') !== null){
                    omCookieEnableCookieGrp(checkboxes[i].value);
                    cookie += checkboxes[i].value + '.1,';
                }else{
                    cookie += checkboxes[i].value + '.0,';
                    checkboxes[i].checked = false;
                    // start added by fmu for cleanup
                    disable = checkboxes[i].value;
                    disgrp = disable.replace("group-","clean_");
                    //disgroup = clean_2;
                    disgroup = eval(disgrp);
                    //console.log('Disgrp: ' + disgrp);
                    //console.log('Disgroup: ' + disgroup);
                    for (j = 0; j < disgroup.length; j++) {
                        //console.log('Disgroup in Schleife: ' + disgroup[j]);
                        omCookieUtility.cleanupCookie(disgroup[j][0],disgroup[j][1]);
                    }
                    // end added by fmu
                }
            }
            // added by fmu - delete all
//            omCookieUtility.cleanupCookie('_ga');
//            omCookieUtility.cleanupCookie('_gat');
//            omCookieUtility.cleanupCookie('_gid');
//            omCookieUtility.cleanupCookie('testcookie_one','');
            // end added by fmu
        break;
    }
    cookie += 'dismiss';
    //cookie = cookie.slice(0, -1);
    omCookieUtility.setCookie('omCookieConsent',cookie,364);
    //push stored events to gtm. We push this last so we are sure that gtm is loaded
    pushGtmEvents(omGtmEvents);
    //added by fmu
    //omCookieUtility.cleanupCookie('_ga');
    //omCookieUtility.cleanupCookie('_gat');
    //omCookieUtility.cleanupCookie('_gid');
    //end added by fmu
    omTriggerPanelEvent(['cookieconsentsave','cookieconsentscriptsloaded']);

    setTimeout(function () {
        document.querySelectorAll('[data-omcookie-panel]')[0].classList.toggle('active');
    },350)

};

var omTriggerPanelEvent = function(events){
  events.forEach(function (event) {
      var eventObj = new CustomEvent(event, {bubbles: true});
      document.querySelectorAll('[data-omcookie-panel]')[0].dispatchEvent(eventObj);
  })
};

var pushGtmEvents = function (events) {
    window.dataLayer = window.dataLayer || [];
    events.forEach(function (event) {
        window.dataLayer.push({
            'event': event,
        });
    });
};
var omCookieEnableCookieGrp = function (groupKey){
    if(omCookieGroups[groupKey] !== undefined){
        for (var key in omCookieGroups[groupKey]) {
            // skip loop if the property is from prototype
            if (!omCookieGroups[groupKey].hasOwnProperty(key)) continue;
            var obj = omCookieGroups[groupKey][key];
            
                
            //save gtm event for pushing
            if(key === 'gtm'){
                if(omCookieGroups[groupKey][key]){
                    omGtmEvents.push(omCookieGroups[groupKey][key]);
                }
                continue;
            }
            // console.logs added by fmu
            //console.log('GroupKey: ' + groupKey);
            //console.log('Key: ' + key);
            //set the cookie html
            for (var prop in obj) {
                // skip loop if the property is from prototype
                if (!obj.hasOwnProperty(prop)) continue;
                // added by fmu
                //console.log('Property: ' + prop);
                // end added by fmu
                if(Array.isArray(obj[prop])){
                    var content = '';
                    //get the html content
                    obj[prop].forEach(function (htmlContent) {
                        content += htmlContent
                    });
                    var range = document.createRange();
                    if(prop === 'header'){
                        // add the html to header
                        range.selectNode(document.getElementsByTagName('head')[0]);
                        var documentFragHead = range.createContextualFragment(content);
                        document.getElementsByTagName('head')[0].appendChild(documentFragHead);
                    }else{
                        //add the html to body
                        range.selectNode(document.getElementsByTagName('body')[0]);
                        var documentFragBody = range.createContextualFragment(content);
                        document.getElementsByTagName('body')[0].appendChild(documentFragBody);
                    }
                }
                
            }
        }
        //remove the group so we don't set it again
        delete omCookieGroups[groupKey];
        // added by fmu
        //console.log('Deleted Group Key: ' + groupKey);
    }
};
var omCookieUtility = {
    getCookie: function(name) {
            var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
            return v ? v[2] : null;
        },
    setCookie: function(name, value, days) {
            var d = new Date;
            d.setTime(d.getTime() + 24*60*60*1000*days);
            document.cookie = name + "=" + value + ";path=/;expires=" + d.toGMTString();
        },
    deleteCookie: function(name){ setCookie(name, '', -1); },
    // added by fmu
    cleanupCookie: function(name,prefix){ 
	    // document.cookie = name + "=" + '' + ";path=/;expires=Thu, 01 Jan 1970 00:00:00 GMT;domain=" + document.domain.replace("www","")
	    if(prefix === 'nowww'){
		    document.cookie = name + "=" + '' + ";path=/;expires=Thu, 01 Jan 1970 00:00:00 GMT;domain=" + document.domain.replace("www","");
		}else{
		    document.cookie = name + "=" + '' + ";path=/;expires=Thu, 01 Jan 1970 00:00:00 GMT";
		}
	}
	// end fmu
};

(function () {

    if ( typeof window.CustomEvent === "function" ) return false;

    function CustomEvent ( event, params ) {
        params = params || { bubbles: false, cancelable: false, detail: null };
        var evt = document.createEvent( 'CustomEvent' );
        evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
        return evt;
    }

    window.CustomEvent = CustomEvent;
})();


function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}var _slice=Array.prototype.slice,_slicedToArray=function(){function e(e,t){var i=[],n=!0,r=!1,s=void 0;try{for(var a,o=e[Symbol.iterator]();!(n=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);n=!0);}catch(l){r=!0,s=l}finally{try{!n&&o["return"]&&o["return"]()}finally{if(r)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e};!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):e.parsley=t(e.jQuery)}(this,function(e){"use strict";function t(e,t){return e.parsleyAdaptedCallback||(e.parsleyAdaptedCallback=function(){var i=Array.prototype.slice.call(arguments,0);i.unshift(this),e.apply(t||T,i)}),e.parsleyAdaptedCallback}function i(e){return 0===e.lastIndexOf(D,0)?e.substr(D.length):e}function n(){var t=this,i=window||global;_extends(this,{isNativeEvent:function(e){return e.originalEvent&&e.originalEvent.isTrusted!==!1},fakeInputEvent:function(i){t.isNativeEvent(i)&&e(i.target).trigger("input")},misbehaves:function(i){t.isNativeEvent(i)&&(t.behavesOk(i),e(document).on("change.inputevent",i.data.selector,t.fakeInputEvent),t.fakeInputEvent(i))},behavesOk:function(i){t.isNativeEvent(i)&&e(document).off("input.inputevent",i.data.selector,t.behavesOk).off("change.inputevent",i.data.selector,t.misbehaves)},install:function(){if(!i.inputEventPatched){i.inputEventPatched="0.0.3";for(var n=["select",'input[type="checkbox"]','input[type="radio"]','input[type="file"]'],r=0;r<n.length;r++){var s=n[r];e(document).on("input.inputevent",s,{selector:s},t.behavesOk).on("change.inputevent",s,{selector:s},t.misbehaves)}}},uninstall:function(){delete i.inputEventPatched,e(document).off(".inputevent")}})}var r=1,s={},a={attr:function(e,t,i){var n,r,s,a=new RegExp("^"+t,"i");if("undefined"==typeof i)i={};else for(n in i)i.hasOwnProperty(n)&&delete i[n];if(!e)return i;for(s=e.attributes,n=s.length;n--;)r=s[n],r&&r.specified&&a.test(r.name)&&(i[this.camelize(r.name.slice(t.length))]=this.deserializeValue(r.value));return i},checkAttr:function(e,t,i){return e.hasAttribute(t+i)},setAttr:function(e,t,i,n){e.setAttribute(this.dasherize(t+i),String(n))},generateID:function(){return""+r++},deserializeValue:function(t){var i;try{return t?"true"==t||"false"!=t&&("null"==t?null:isNaN(i=Number(t))?/^[\[\{]/.test(t)?e.parseJSON(t):t:i):t}catch(n){return t}},camelize:function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},dasherize:function(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()},warn:function(){var e;window.console&&"function"==typeof window.console.warn&&(e=window.console).warn.apply(e,arguments)},warnOnce:function(e){s[e]||(s[e]=!0,this.warn.apply(this,arguments))},_resetWarnings:function(){s={}},trimString:function(e){return e.replace(/^\s+|\s+$/g,"")},parse:{date:function S(e){var t=e.match(/^(\d{4,})-(\d\d)-(\d\d)$/);if(!t)return null;var i=t.map(function(e){return parseInt(e,10)}),n=_slicedToArray(i,4),r=(n[0],n[1]),s=n[2],a=n[3],S=new Date(r,s-1,a);return S.getFullYear()!==r||S.getMonth()+1!==s||S.getDate()!==a?null:S},string:function(e){return e},integer:function(e){return isNaN(e)?null:parseInt(e,10)},number:function(e){if(isNaN(e))throw null;return parseFloat(e)},"boolean":function(e){return!/^\s*false\s*$/i.test(e)},object:function(e){return a.deserializeValue(e)},regexp:function(e){var t="";return/^\/.*\/(?:[gimy]*)$/.test(e)?(t=e.replace(/.*\/([gimy]*)$/,"$1"),e=e.replace(new RegExp("^/(.*?)/"+t+"$"),"$1")):e="^"+e+"$",new RegExp(e,t)}},parseRequirement:function(e,t){var i=this.parse[e||"string"];if(!i)throw'Unknown requirement specification: "'+e+'"';var n=i(t);if(null===n)throw"Requirement is not a "+e+': "'+t+'"';return n},namespaceEvents:function(t,i){return t=this.trimString(t||"").split(/\s+/),t[0]?e.map(t,function(e){return e+"."+i}).join(" "):""},difference:function(t,i){var n=[];return e.each(t,function(e,t){i.indexOf(t)==-1&&n.push(t)}),n},all:function(t){return e.when.apply(e,_toConsumableArray(t).concat([42,42]))},objectCreate:Object.create||function(){var e=function(){};return function(t){if(arguments.length>1)throw Error("Second argument not supported");if("object"!=typeof t)throw TypeError("Argument must be an object");e.prototype=t;var i=new e;return e.prototype=null,i}}(),_SubmitSelector:'input[type="submit"], button:submit'},o={namespace:"data-parsley-",inputs:"input, textarea, select",excluded:"input[type=button], input[type=submit], input[type=reset], input[type=hidden]",priorityEnabled:!0,multiple:null,group:null,uiEnabled:!0,validationThreshold:3,focus:"first",trigger:!1,triggerAfterFailure:"input",errorClass:"parsley-error",successClass:"parsley-success",classHandler:function(e){},errorsContainer:function(e){},errorsWrapper:'<ul class="parsley-errors-list"></ul>',errorTemplate:"<li></li>"},l=function(){this.__id__=a.generateID()};l.prototype={asyncSupport:!0,_pipeAccordingToValidationResult:function(){var t=this,i=function(){var i=e.Deferred();return!0!==t.validationResult&&i.reject(),i.resolve().promise()};return[i,i]},actualizeOptions:function(){return a.attr(this.element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(e){this.domOptions=a.objectCreate(this.parent.options),this.options=a.objectCreate(this.domOptions);for(var t in e)e.hasOwnProperty(t)&&(this.options[t]=e[t]);this.actualizeOptions()},_listeners:null,on:function(e,t){this._listeners=this._listeners||{};var i=this._listeners[e]=this._listeners[e]||[];return i.push(t),this},subscribe:function(t,i){e.listenTo(this,t.toLowerCase(),i)},off:function(e,t){var i=this._listeners&&this._listeners[e];if(i)if(t)for(var n=i.length;n--;)i[n]===t&&i.splice(n,1);else delete this._listeners[e];return this},unsubscribe:function(t,i){e.unsubscribeTo(this,t.toLowerCase())},trigger:function(e,t,i){t=t||this;var n,r=this._listeners&&this._listeners[e];if(r)for(var s=r.length;s--;)if(n=r[s].call(t,t,i),n===!1)return n;return!this.parent||this.parent.trigger(e,t,i)},asyncIsValid:function(e,t){return a.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:e,force:t})},_findRelated:function(){return this.options.multiple?e(this.parent.element.querySelectorAll("["+this.options.namespace+'multiple="'+this.options.multiple+'"]')):this.$element}};var u=function(e,t){var i=e.match(/^\s*\[(.*)\]\s*$/);if(!i)throw'Requirement is not an array: "'+e+'"';var n=i[1].split(",").map(a.trimString);if(n.length!==t)throw"Requirement has "+n.length+" values when "+t+" are needed";return n},d=function(e,t,i){var n=null,r={};for(var s in e)if(s){var o=i(s);"string"==typeof o&&(o=a.parseRequirement(e[s],o)),r[s]=o}else n=a.parseRequirement(e[s],t);return[n,r]},h=function(t){e.extend(!0,this,t)};h.prototype={validate:function(e,t){if(this.fn)return arguments.length>3&&(t=[].slice.call(arguments,1,-1)),this.fn(e,t);if(Array.isArray(e)){if(!this.validateMultiple)throw"Validator `"+this.name+"` does not handle multiple values";return this.validateMultiple.apply(this,arguments)}var i=arguments[arguments.length-1];if(this.validateDate&&i._isDateInput())return arguments[0]=a.parse.date(arguments[0]),null!==arguments[0]&&this.validateDate.apply(this,arguments);if(this.validateNumber)return!isNaN(e)&&(arguments[0]=parseFloat(arguments[0]),this.validateNumber.apply(this,arguments));if(this.validateString)return this.validateString.apply(this,arguments);throw"Validator `"+this.name+"` only handles multiple values"},parseRequirements:function(t,i){if("string"!=typeof t)return Array.isArray(t)?t:[t];var n=this.requirementType;if(Array.isArray(n)){for(var r=u(t,n.length),s=0;s<r.length;s++)r[s]=a.parseRequirement(n[s],r[s]);return r}return e.isPlainObject(n)?d(n,t,i):[a.parseRequirement(n,t)]},requirementType:"string",priority:2};var p=function(e,t){this.__class__="ValidatorRegistry",this.locale="en",this.init(e||{},t||{})},c={email:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,number:/^-?(\d*\.)?\d+(e[-+]?\d+)?$/i,integer:/^-?\d+$/,digits:/^\d+$/,alphanum:/^\w+$/i,date:{test:function(e){return null!==a.parse.date(e)}},url:new RegExp("^(?:(?:https?|ftp)://)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:/\\S*)?$","i")};c.range=c.number;var f=function(e){var t=(""+e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0},m=function(e,t){return t.map(a.parse[e])},g=function(e,t){return function(i){for(var n=arguments.length,r=Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.pop(),t.apply(void 0,[i].concat(_toConsumableArray(m(e,r))))}},v=function(e){return{validateDate:g("date",e),validateNumber:g("number",e),requirementType:e.length<=2?"string":["string","string"],priority:30}};p.prototype={init:function(e,t){this.catalog=t,this.validators=_extends({},this.validators);for(var i in e)this.addValidator(i,e[i].fn,e[i].priority);window.Parsley.trigger("parsley:validator:init")},setLocale:function(e){if("undefined"==typeof this.catalog[e])throw new Error(e+" is not available in the catalog");return this.locale=e,this},addCatalog:function(e,t,i){return"object"==typeof t&&(this.catalog[e]=t),!0===i?this.setLocale(e):this},addMessage:function(e,t,i){return"undefined"==typeof this.catalog[e]&&(this.catalog[e]={}),this.catalog[e][t]=i,this},addMessages:function(e,t){for(var i in t)this.addMessage(e,i,t[i]);return this},addValidator:function(e,t,i){if(this.validators[e])a.warn('Validator "'+e+'" is already defined.');else if(o.hasOwnProperty(e))return void a.warn('"'+e+'" is a restricted keyword and is not a valid validator name.');return this._setValidator.apply(this,arguments)},updateValidator:function(e,t,i){return this.validators[e]?this._setValidator.apply(this,arguments):(a.warn('Validator "'+e+'" is not already defined.'),this.addValidator.apply(this,arguments))},removeValidator:function(e){return this.validators[e]||a.warn('Validator "'+e+'" is not defined.'),delete this.validators[e],this},_setValidator:function(e,t,i){"object"!=typeof t&&(t={fn:t,priority:i}),t.validate||(t=new h(t)),this.validators[e]=t;for(var n in t.messages||{})this.addMessage(n,e,t.messages[n]);return this},getErrorMessage:function(e){var t;if("type"===e.name){var i=this.catalog[this.locale][e.name]||{};t=i[e.requirements]}else t=this.formatMessage(this.catalog[this.locale][e.name],e.requirements);return t||this.catalog[this.locale].defaultMessage||this.catalog.en.defaultMessage},formatMessage:function(e,t){if("object"==typeof t){for(var i in t)e=this.formatMessage(e,t[i]);return e}return"string"==typeof e?e.replace(/%s/i,t):""},validators:{notblank:{validateString:function(e){return/\S/.test(e)},priority:2},required:{validateMultiple:function(e){return e.length>0},validateString:function(e){return/\S/.test(e)},priority:512},type:{validateString:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n=i.step,r=void 0===n?"any":n,s=i.base,a=void 0===s?0:s,o=c[t];if(!o)throw new Error("validator type `"+t+"` is not supported");if(!o.test(e))return!1;if("number"===t&&!/^any$/i.test(r||"")){var l=Number(e),u=Math.max(f(r),f(a));if(f(l)>u)return!1;var d=function(e){return Math.round(e*Math.pow(10,u))};if((d(l)-d(a))%d(r)!=0)return!1}return!0},requirementType:{"":"string",step:"string",base:"number"},priority:256},pattern:{validateString:function(e,t){return t.test(e)},requirementType:"regexp",priority:64},minlength:{validateString:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxlength:{validateString:function(e,t){return e.length<=t},requirementType:"integer",priority:30},length:{validateString:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},mincheck:{validateMultiple:function(e,t){return e.length>=t},requirementType:"integer",priority:30},maxcheck:{validateMultiple:function(e,t){return e.length<=t},requirementType:"integer",priority:30},check:{validateMultiple:function(e,t,i){return e.length>=t&&e.length<=i},requirementType:["integer","integer"],priority:30},min:v(function(e,t){return e>=t}),max:v(function(e,t){return e<=t}),range:v(function(e,t,i){return e>=t&&e<=i}),equalto:{validateString:function(t,i){var n=e(i);return n.length?t===n.val():t===i},priority:256}}};var y={},_=function k(e,t,i){for(var n=[],r=[],s=0;s<e.length;s++){for(var a=!1,o=0;o<t.length;o++)if(e[s].assert.name===t[o].assert.name){a=!0;break}a?r.push(e[s]):n.push(e[s])}return{kept:r,added:n,removed:i?[]:k(t,e,!0).added}};y.Form={_actualizeTriggers:function(){var e=this;this.$element.on("submit.Parsley",function(t){e.onSubmitValidate(t)}),this.$element.on("click.Parsley",a._SubmitSelector,function(t){e.onSubmitButton(t)}),!1!==this.options.uiEnabled&&this.element.setAttribute("novalidate","")},focus:function(){if(this._focusedField=null,!0===this.validationResult||"none"===this.options.focus)return null;for(var e=0;e<this.fields.length;e++){var t=this.fields[e];if(!0!==t.validationResult&&t.validationResult.length>0&&"undefined"==typeof t.options.noFocus&&(this._focusedField=t.$element,"first"===this.options.focus))break}return null===this._focusedField?null:this._focusedField.focus()},_destroyUI:function(){this.$element.off(".Parsley")}},y.Field={_reflowUI:function(){if(this._buildUI(),this._ui){var e=_(this.validationResult,this._ui.lastValidationResult);this._ui.lastValidationResult=this.validationResult,this._manageStatusClass(),this._manageErrorsMessages(e),this._actualizeTriggers(),!e.kept.length&&!e.added.length||this._failedOnce||(this._failedOnce=!0,this._actualizeTriggers())}},getErrorsMessages:function(){if(!0===this.validationResult)return[];for(var e=[],t=0;t<this.validationResult.length;t++)e.push(this.validationResult[t].errorMessage||this._getErrorMessage(this.validationResult[t].assert));return e},addError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.message,n=t.assert,r=t.updateClass,s=void 0===r||r;this._buildUI(),this._addError(e,{message:i,assert:n}),s&&this._errorClass()},updateError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.message,n=t.assert,r=t.updateClass,s=void 0===r||r;this._buildUI(),this._updateError(e,{message:i,assert:n}),s&&this._errorClass()},removeError:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=t.updateClass,n=void 0===i||i;this._buildUI(),this._removeError(e),n&&this._manageStatusClass()},_manageStatusClass:function(){this.hasConstraints()&&this.needsValidation()&&!0===this.validationResult?this._successClass():this.validationResult.length>0?this._errorClass():this._resetClass()},_manageErrorsMessages:function(t){if("undefined"==typeof this.options.errorsMessagesDisabled){if("undefined"!=typeof this.options.errorMessage)return t.added.length||t.kept.length?(this._insertErrorWrapper(),0===this._ui.$errorsWrapper.find(".parsley-custom-error-message").length&&this._ui.$errorsWrapper.append(e(this.options.errorTemplate).addClass("parsley-custom-error-message")),this._ui.$errorsWrapper.addClass("filled").find(".parsley-custom-error-message").html(this.options.errorMessage)):this._ui.$errorsWrapper.removeClass("filled").find(".parsley-custom-error-message").remove();for(var i=0;i<t.removed.length;i++)this._removeError(t.removed[i].assert.name);for(i=0;i<t.added.length;i++)this._addError(t.added[i].assert.name,{message:t.added[i].errorMessage,assert:t.added[i].assert});for(i=0;i<t.kept.length;i++)this._updateError(t.kept[i].assert.name,{message:t.kept[i].errorMessage,assert:t.kept[i].assert})}},_addError:function(t,i){var n=i.message,r=i.assert;this._insertErrorWrapper(),this._ui.$errorsWrapper.addClass("filled").append(e(this.options.errorTemplate).addClass("parsley-"+t).html(n||this._getErrorMessage(r)))},_updateError:function(e,t){var i=t.message,n=t.assert;this._ui.$errorsWrapper.addClass("filled").find(".parsley-"+e).html(i||this._getErrorMessage(n))},_removeError:function(e){this._ui.$errorsWrapper.removeClass("filled").find(".parsley-"+e).remove()},_getErrorMessage:function(e){var t=e.name+"Message";return"undefined"!=typeof this.options[t]?window.Parsley.formatMessage(this.options[t],e.requirements):window.Parsley.getErrorMessage(e)},_buildUI:function(){if(!this._ui&&!1!==this.options.uiEnabled){var t={};this.element.setAttribute(this.options.namespace+"id",this.__id__),t.$errorClassHandler=this._manageClassHandler(),t.errorsWrapperId="parsley-id-"+(this.options.multiple?"multiple-"+this.options.multiple:this.__id__),t.$errorsWrapper=e(this.options.errorsWrapper).attr("id",t.errorsWrapperId),t.lastValidationResult=[],t.validationInformationVisible=!1,this._ui=t}},_manageClassHandler:function(){if("string"==typeof this.options.classHandler)return 0===e(this.options.classHandler).length&&ParsleyUtils.warn("No elements found that match the selector `"+this.options.classHandler+"` set in options.classHandler or data-parsley-class-handler"),e(this.options.classHandler);if("function"==typeof this.options.classHandler)var t=this.options.classHandler.call(this,this);return"undefined"!=typeof t&&t.length?t:this._inputHolder()},_inputHolder:function(){return this.options.multiple&&"SELECT"!==this.element.nodeName?this.$element.parent():this.$element},_insertErrorWrapper:function(){var t;if(0!==this._ui.$errorsWrapper.parent().length)return this._ui.$errorsWrapper.parent();if("string"==typeof this.options.errorsContainer){if(e(this.options.errorsContainer).length)return e(this.options.errorsContainer).append(this._ui.$errorsWrapper);a.warn("The errors container `"+this.options.errorsContainer+"` does not exist in DOM")}else"function"==typeof this.options.errorsContainer&&(t=this.options.errorsContainer.call(this,this));return"undefined"!=typeof t&&t.length?t.append(this._ui.$errorsWrapper):this._inputHolder().after(this._ui.$errorsWrapper)},_actualizeTriggers:function(){var e,t=this,i=this._findRelated();i.off(".Parsley"),this._failedOnce?i.on(a.namespaceEvents(this.options.triggerAfterFailure,"Parsley"),function(){t._validateIfNeeded()}):(e=a.namespaceEvents(this.options.trigger,"Parsley"))&&i.on(e,function(e){t._validateIfNeeded(e)})},_validateIfNeeded:function(e){var t=this;e&&/key|input/.test(e.type)&&(!this._ui||!this._ui.validationInformationVisible)&&this.getValue().length<=this.options.validationThreshold||(this.options.debounce?(window.clearTimeout(this._debounced),this._debounced=window.setTimeout(function(){return t.validate()},this.options.debounce)):this.validate())},_resetUI:function(){this._failedOnce=!1,this._actualizeTriggers(),"undefined"!=typeof this._ui&&(this._ui.$errorsWrapper.removeClass("filled").children().remove(),this._resetClass(),this._ui.lastValidationResult=[],this._ui.validationInformationVisible=!1)},_destroyUI:function(){this._resetUI(),"undefined"!=typeof this._ui&&this._ui.$errorsWrapper.remove(),delete this._ui},_successClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass)},_errorClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass)},_resetClass:function(){this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass)}};var w=function(t,i,n){this.__class__="Form",this.element=t,this.$element=e(t),this.domOptions=i,this.options=n,this.parent=window.Parsley,this.fields=[],this.validationResult=null},b={pending:null,resolved:!0,rejected:!1};w.prototype={onSubmitValidate:function(e){var t=this;if(!0!==e.parsley){var i=this._submitSource||this.$element.find(a._SubmitSelector)[0];if(this._submitSource=null,this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!0),!i||null===i.getAttribute("formnovalidate")){window.Parsley._remoteCache={};var n=this.whenValidate({event:e});"resolved"===n.state()&&!1!==this._trigger("submit")||(e.stopImmediatePropagation(),e.preventDefault(),"pending"===n.state()&&n.done(function(){t._submit(i)}))}}},onSubmitButton:function(e){this._submitSource=e.currentTarget},_submit:function(t){if(!1!==this._trigger("submit")){if(t){var i=this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!1);0===i.length&&(i=e('<input class="parsley-synthetic-submit-button" type="hidden">').appendTo(this.$element)),i.attr({name:t.getAttribute("name"),value:t.getAttribute("value")})}this.$element.trigger(_extends(e.Event("submit"),{parsley:!0}))}},validate:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling validate on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1],s=i[2];t={group:n,force:r,event:s}}return b[this.whenValidate(t).state()]},whenValidate:function(){var t,i=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=n.group,s=n.force,o=n.event;this.submitEvent=o,o&&(this.submitEvent=_extends({},o,{preventDefault:function(){a.warnOnce("Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`"),i.validationResult=!1}})),this.validationResult=!0,this._trigger("validate"),this._refreshFields();var l=this._withoutReactualizingFormOptions(function(){return e.map(i.fields,function(e){return e.whenValidate({force:s,group:r})})});return(t=a.all(l).done(function(){i._trigger("success")}).fail(function(){i.validationResult=!1,i.focus(),i._trigger("error")}).always(function(){i._trigger("validated")})).pipe.apply(t,_toConsumableArray(this._pipeAccordingToValidationResult()))},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley form without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={group:n,force:r}}return b[this.whenValid(t).state()]},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.group,r=i.force;this._refreshFields();var s=this._withoutReactualizingFormOptions(function(){return e.map(t.fields,function(e){return e.whenValid({group:n,force:r})})});return a.all(s)},reset:function(){for(var e=0;e<this.fields.length;e++)this.fields[e].reset();this._trigger("reset")},destroy:function(){this._destroyUI();for(var e=0;e<this.fields.length;e++)this.fields[e].destroy();this.$element.removeData("Parsley"),this._trigger("destroy")},_refreshFields:function(){return this.actualizeOptions()._bindFields()},_bindFields:function(){var t=this,i=this.fields;return this.fields=[],this.fieldsMappedById={},this._withoutReactualizingFormOptions(function(){t.$element.find(t.options.inputs).not(t.options.excluded).each(function(e,i){var n=new window.Parsley.Factory(i,{},t);if(("Field"===n.__class__||"FieldMultiple"===n.__class__)&&!0!==n.options.excluded){var r=n.__class__+"-"+n.__id__;"undefined"==typeof t.fieldsMappedById[r]&&(t.fieldsMappedById[r]=n,t.fields.push(n))}}),e.each(a.difference(i,t.fields),function(e,t){t.reset()})}),this},_withoutReactualizingFormOptions:function(e){var t=this.actualizeOptions;this.actualizeOptions=function(){return this};var i=e();return this.actualizeOptions=t,i},_trigger:function(e){return this.trigger("form:"+e)}};var F=function(e,t,i,n,r){var s=window.Parsley._validatorRegistry.validators[t],a=new h(s);n=n||e.options[t+"Priority"]||a.priority,r=!0===r,_extends(this,{validator:a,name:t,requirements:i,priority:n,isDomConstraint:r}),this._parseRequirements(e.options)},C=function(e){var t=e[0].toUpperCase();return t+e.slice(1)};F.prototype={validate:function(e,t){var i;return(i=this.validator).validate.apply(i,[e].concat(_toConsumableArray(this.requirementList),[t]))},_parseRequirements:function(e){var t=this;this.requirementList=this.validator.parseRequirements(this.requirements,function(i){return e[t.name+C(i)]})}};var E=function(t,i,n,r){this.__class__="Field",this.element=t,this.$element=e(t),"undefined"!=typeof r&&(this.parent=r),this.options=n,this.domOptions=i,this.constraints=[],this.constraintsByName={},this.validationResult=!0,this._bindConstraints()},A={pending:null,resolved:!0,rejected:!1};E.prototype={validate:function(t){arguments.length>=1&&!e.isPlainObject(t)&&(a.warnOnce("Calling validate on a parsley field without passing arguments as an object is deprecated."),t={options:t});var i=this.whenValidate(t);if(!i)return!0;switch(i.state()){case"pending":return null;case"resolved":return!0;case"rejected":return this.validationResult}},whenValidate:function(){var e,t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.force,r=i.group;if(this.refreshConstraints(),!r||this._isInGroup(r))return this.value=this.getValue(),this._trigger("validate"),(e=this.whenValid({force:n,value:this.value,_refreshed:!0}).always(function(){t._reflowUI()}).done(function(){t._trigger("success")}).fail(function(){t._trigger("error")}).always(function(){t._trigger("validated")})).pipe.apply(e,_toConsumableArray(this._pipeAccordingToValidationResult()))},hasConstraints:function(){return 0!==this.constraints.length},needsValidation:function(e){return"undefined"==typeof e&&(e=this.getValue()),!(!e.length&&!this._isRequired()&&"undefined"==typeof this.options.validateIfEmpty)},_isInGroup:function(t){return Array.isArray(this.options.group)?-1!==e.inArray(t,this.options.group):this.options.group===t},isValid:function(t){if(arguments.length>=1&&!e.isPlainObject(t)){a.warnOnce("Calling isValid on a parsley field without passing arguments as an object is deprecated.");var i=_slice.call(arguments),n=i[0],r=i[1];t={force:n,value:r}}var s=this.whenValid(t);return!s||A[s.state()]},whenValid:function(){var t=this,i=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=i.force,r=void 0!==n&&n,s=i.value,o=i.group,l=i._refreshed;if(l||this.refreshConstraints(),!o||this._isInGroup(o)){if(this.validationResult=!0,!this.hasConstraints())return e.when();if("undefined"!=typeof s&&null!==s||(s=this.getValue()),!this.needsValidation(s)&&!0!==r)return e.when();var u=this._getGroupedConstraints(),d=[];return e.each(u,function(i,n){var r=a.all(e.map(n,function(e){return t._validateConstraint(s,e)}));if(d.push(r),"rejected"===r.state())return!1}),a.all(d)}},_validateConstraint:function(t,i){var n=this,r=i.validate(t,this);return!1===r&&(r=e.Deferred().reject()),a.all([r]).fail(function(e){n.validationResult instanceof Array||(n.validationResult=[]),n.validationResult.push({assert:i,errorMessage:"string"==typeof e&&e})})},getValue:function(){var e;return e="function"==typeof this.options.value?this.options.value(this):"undefined"!=typeof this.options.value?this.options.value:this.$element.val(),"undefined"==typeof e||null===e?"":this._handleWhitespace(e)},reset:function(){return this._resetUI(),this._trigger("reset")},destroy:function(){this._destroyUI(),this.$element.removeData("Parsley"),this.$element.removeData("FieldMultiple"),this._trigger("destroy")},refreshConstraints:function(){return this.actualizeOptions()._bindConstraints()},addConstraint:function(e,t,i,n){if(window.Parsley._validatorRegistry.validators[e]){var r=new F(this,e,t,i,n);"undefined"!==this.constraintsByName[r.name]&&this.removeConstraint(r.name),this.constraints.push(r),this.constraintsByName[r.name]=r}return this},removeConstraint:function(e){for(var t=0;t<this.constraints.length;t++)if(e===this.constraints[t].name){this.constraints.splice(t,1);break}return delete this.constraintsByName[e],this},updateConstraint:function(e,t,i){return this.removeConstraint(e).addConstraint(e,t,i)},_bindConstraints:function(){for(var e=[],t={},i=0;i<this.constraints.length;i++)!1===this.constraints[i].isDomConstraint&&(e.push(this.constraints[i]),t[this.constraints[i].name]=this.constraints[i]);this.constraints=e,this.constraintsByName=t;for(var n in this.options)this.addConstraint(n,this.options[n],void 0,!0);return this._bindHtml5Constraints()},_bindHtml5Constraints:function(){null!==this.element.getAttribute("required")&&this.addConstraint("required",!0,void 0,!0),null!==this.element.getAttribute("pattern")&&this.addConstraint("pattern",this.element.getAttribute("pattern"),void 0,!0);var e=this.element.getAttribute("min"),t=this.element.getAttribute("max");null!==e&&null!==t?this.addConstraint("range",[e,t],void 0,!0):null!==e?this.addConstraint("min",e,void 0,!0):null!==t&&this.addConstraint("max",t,void 0,!0),null!==this.element.getAttribute("minlength")&&null!==this.element.getAttribute("maxlength")?this.addConstraint("length",[this.element.getAttribute("minlength"),this.element.getAttribute("maxlength")],void 0,!0):null!==this.element.getAttribute("minlength")?this.addConstraint("minlength",this.element.getAttribute("minlength"),void 0,!0):null!==this.element.getAttribute("maxlength")&&this.addConstraint("maxlength",this.element.getAttribute("maxlength"),void 0,!0);var i=this.element.type;return"number"===i?this.addConstraint("type",["number",{step:this.element.getAttribute("step")||"1",base:e||this.element.getAttribute("value")}],void 0,!0):/^(email|url|range|date)$/i.test(i)?this.addConstraint("type",i,void 0,!0):this},_isRequired:function(){return"undefined"!=typeof this.constraintsByName.required&&!1!==this.constraintsByName.required.requirements},_trigger:function(e){return this.trigger("field:"+e)},_handleWhitespace:function(e){return!0===this.options.trimValue&&a.warnOnce('data-parsley-trim-value="true" is deprecated, please use data-parsley-whitespace="trim"'),"squish"===this.options.whitespace&&(e=e.replace(/\s{2,}/g," ")),"trim"!==this.options.whitespace&&"squish"!==this.options.whitespace&&!0!==this.options.trimValue||(e=a.trimString(e)),e},_isDateInput:function(){var e=this.constraintsByName.type;return e&&"date"===e.requirements},_getGroupedConstraints:function(){if(!1===this.options.priorityEnabled)return[this.constraints];for(var e=[],t={},i=0;i<this.constraints.length;i++){var n=this.constraints[i].priority;t[n]||e.push(t[n]=[]),t[n].push(this.constraints[i])}return e.sort(function(e,t){return t[0].priority-e[0].priority}),e}};var x=E,$=function(){this.__class__="FieldMultiple"};$.prototype={addElement:function(e){return this.$elements.push(e),this},refreshConstraints:function(){var t;if(this.constraints=[],"SELECT"===this.element.nodeName)return this.actualizeOptions()._bindConstraints(),
this;for(var i=0;i<this.$elements.length;i++)if(e("html").has(this.$elements[i]).length){t=this.$elements[i].data("FieldMultiple").refreshConstraints().constraints;for(var n=0;n<t.length;n++)this.addConstraint(t[n].name,t[n].requirements,t[n].priority,t[n].isDomConstraint)}else this.$elements.splice(i,1);return this},getValue:function(){if("function"==typeof this.options.value)return this.options.value(this);if("undefined"!=typeof this.options.value)return this.options.value;if("INPUT"===this.element.nodeName){if("radio"===this.element.type)return this._findRelated().filter(":checked").val()||"";if("checkbox"===this.element.type){var t=[];return this._findRelated().filter(":checked").each(function(){t.push(e(this).val())}),t}}return"SELECT"===this.element.nodeName&&null===this.$element.val()?[]:this.$element.val()},_init:function(){return this.$elements=[this.$element],this}};var P=function(t,i,n){this.element=t,this.$element=e(t);var r=this.$element.data("Parsley");if(r)return"undefined"!=typeof n&&r.parent===window.Parsley&&(r.parent=n,r._resetOptions(r.options)),"object"==typeof i&&_extends(r.options,i),r;if(!this.$element.length)throw new Error("You must bind Parsley on an existing element.");if("undefined"!=typeof n&&"Form"!==n.__class__)throw new Error("Parent instance must be a Form instance");return this.parent=n||window.Parsley,this.init(i)};P.prototype={init:function(e){return this.__class__="Parsley",this.__version__="2.7.2",this.__id__=a.generateID(),this._resetOptions(e),"FORM"===this.element.nodeName||a.checkAttr(this.element,this.options.namespace,"validate")&&!this.$element.is(this.options.inputs)?this.bind("parsleyForm"):this.isMultiple()?this.handleMultiple():this.bind("parsleyField")},isMultiple:function(){return"radio"===this.element.type||"checkbox"===this.element.type||"SELECT"===this.element.nodeName&&null!==this.element.getAttribute("multiple")},handleMultiple:function(){var t,i,n=this;if(this.options.multiple=this.options.multiple||(t=this.element.getAttribute("name"))||this.element.getAttribute("id"),"SELECT"===this.element.nodeName&&null!==this.element.getAttribute("multiple"))return this.options.multiple=this.options.multiple||this.__id__,this.bind("parsleyFieldMultiple");if(!this.options.multiple)return a.warn("To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.",this.$element),this;this.options.multiple=this.options.multiple.replace(/(:|\.|\[|\]|\{|\}|\$)/g,""),t&&e('input[name="'+t+'"]').each(function(e,t){"radio"!==t.type&&"checkbox"!==t.type||t.setAttribute(n.options.namespace+"multiple",n.options.multiple)});for(var r=this._findRelated(),s=0;s<r.length;s++)if(i=e(r.get(s)).data("Parsley"),"undefined"!=typeof i){this.$element.data("FieldMultiple")||i.addElement(this.$element);break}return this.bind("parsleyField",!0),i||this.bind("parsleyFieldMultiple")},bind:function(t,i){var n;switch(t){case"parsleyForm":n=e.extend(new w(this.element,this.domOptions,this.options),new l,window.ParsleyExtend)._bindFields();break;case"parsleyField":n=e.extend(new x(this.element,this.domOptions,this.options,this.parent),new l,window.ParsleyExtend);break;case"parsleyFieldMultiple":n=e.extend(new x(this.element,this.domOptions,this.options,this.parent),new $,new l,window.ParsleyExtend)._init();break;default:throw new Error(t+"is not a supported Parsley type")}return this.options.multiple&&a.setAttr(this.element,this.options.namespace,"multiple",this.options.multiple),"undefined"!=typeof i?(this.$element.data("FieldMultiple",n),n):(this.$element.data("Parsley",n),n._actualizeTriggers(),n._trigger("init"),n)}};var V=e.fn.jquery.split(".");if(parseInt(V[0])<=1&&parseInt(V[1])<8)throw"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.";V.forEach||a.warn("Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim");var O=_extends(new l,{element:document,$element:e(document),actualizeOptions:null,_resetOptions:null,Factory:P,version:"2.7.2"});_extends(x.prototype,y.Field,l.prototype),_extends(w.prototype,y.Form,l.prototype),_extends(P.prototype,l.prototype),e.fn.parsley=e.fn.psly=function(t){if(this.length>1){var i=[];return this.each(function(){i.push(e(this).parsley(t))}),i}return e(this).length?new P(this[0],t):void a.warn("You must bind Parsley on an existing element.")},"undefined"==typeof window.ParsleyExtend&&(window.ParsleyExtend={}),O.options=_extends(a.objectCreate(o),window.ParsleyConfig),window.ParsleyConfig=O.options,window.Parsley=window.psly=O,O.Utils=a,window.ParsleyUtils={},e.each(a,function(e,t){"function"==typeof t&&(window.ParsleyUtils[e]=function(){return a.warnOnce("Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead."),a[e].apply(a,arguments)})});var M=window.Parsley._validatorRegistry=new p(window.ParsleyConfig.validators,window.ParsleyConfig.i18n);window.ParsleyValidator={},e.each("setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator".split(" "),function(e,t){window.Parsley[t]=function(){return M[t].apply(M,arguments)},window.ParsleyValidator[t]=function(){var e;return a.warnOnce("Accessing the method '"+t+"' through Validator is deprecated. Simply call 'window.Parsley."+t+"(...)'"),(e=window.Parsley)[t].apply(e,arguments)}}),window.Parsley.UI=y,window.ParsleyUI={removeError:function(e,t,i){var n=!0!==i;return a.warnOnce("Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e.removeError(t,{updateClass:n})},getErrorsMessages:function(e){return a.warnOnce("Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly."),e.getErrorsMessages()}},e.each("addError updateError".split(" "),function(e,t){window.ParsleyUI[t]=function(e,i,n,r,s){var o=!0!==s;return a.warnOnce("Accessing UI is deprecated. Call '"+t+"' on the instance directly. Please comment in issue 1073 as to your need to call this method."),e[t](i,{message:n,assert:r,updateClass:o})}}),!1!==window.ParsleyConfig.autoBind&&e(function(){e("[data-parsley-validate]").length&&e("[data-parsley-validate]").parsley()});var T=e({}),R=function(){a.warnOnce("Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley")},D="parsley:";e.listen=function(e,n){var r;if(R(),"object"==typeof arguments[1]&&"function"==typeof arguments[2]&&(r=arguments[1],n=arguments[2]),"function"!=typeof n)throw new Error("Wrong parameters");window.Parsley.on(i(e),t(n,r))},e.listenTo=function(e,n,r){if(R(),!(e instanceof x||e instanceof w))throw new Error("Must give Parsley instance");if("string"!=typeof n||"function"!=typeof r)throw new Error("Wrong parameters");e.on(i(n),t(r))},e.unsubscribe=function(e,t){if(R(),"string"!=typeof e||"function"!=typeof t)throw new Error("Wrong arguments");window.Parsley.off(i(e),t.parsleyAdaptedCallback)},e.unsubscribeTo=function(e,t){if(R(),!(e instanceof x||e instanceof w))throw new Error("Must give Parsley instance");e.off(i(t))},e.unsubscribeAll=function(t){R(),window.Parsley.off(i(t)),e("form,input,textarea,select").each(function(){var n=e(this).data("Parsley");n&&n.off(i(t))})},e.emit=function(e,t){var n;R();var r=t instanceof x||t instanceof w,s=Array.prototype.slice.call(arguments,r?2:1);s.unshift(i(e)),r||(t=window.Parsley),(n=t).trigger.apply(n,_toConsumableArray(s))};e.extend(!0,O,{asyncValidators:{"default":{fn:function(e){return e.status>=200&&e.status<300},url:!1},reverse:{fn:function(e){return e.status<200||e.status>=300},url:!1}},addAsyncValidator:function(e,t,i,n){return O.asyncValidators[e]={fn:t,url:i||!1,options:n||{}},this}}),O.addValidator("remote",{requirementType:{"":"string",validator:"string",reverse:"boolean",options:"object"},validateString:function(t,i,n,r){var s,a,o={},l=n.validator||(!0===n.reverse?"reverse":"default");if("undefined"==typeof O.asyncValidators[l])throw new Error("Calling an undefined async validator: `"+l+"`");i=O.asyncValidators[l].url||i,i.indexOf("{value}")>-1?i=i.replace("{value}",encodeURIComponent(t)):o[r.element.getAttribute("name")||r.element.getAttribute("id")]=t;var u=e.extend(!0,n.options||{},O.asyncValidators[l].options);s=e.extend(!0,{},{url:i,data:o,type:"GET"},u),r.trigger("field:ajaxoptions",r,s),a=e.param(s),"undefined"==typeof O._remoteCache&&(O._remoteCache={});var d=O._remoteCache[a]=O._remoteCache[a]||e.ajax(s),h=function(){var t=O.asyncValidators[l].fn.call(r,d,i,n);return t||(t=e.Deferred().reject()),e.when(t)};return d.then(h,h)},priority:-1}),O.on("form:submit",function(){O._remoteCache={}}),l.prototype.addAsyncValidator=function(){return a.warnOnce("Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`"),O.addAsyncValidator.apply(O,arguments)},O.addMessages("en",{defaultMessage:"This value seems to be invalid.",type:{email:"This value should be a valid email.",url:"This value should be a valid url.",number:"This value should be a valid number.",integer:"This value should be a valid integer.",digits:"This value should be digits.",alphanum:"This value should be alphanumeric."},notblank:"This value should not be blank.",required:"This value is required.",pattern:"This value seems to be invalid.",min:"This value should be greater than or equal to %s.",max:"This value should be lower than or equal to %s.",range:"This value should be between %s and %s.",minlength:"This value is too short. It should have %s characters or more.",maxlength:"This value is too long. It should have %s characters or fewer.",length:"This value length is invalid. It should be between %s and %s characters long.",mincheck:"You must select at least %s choices.",maxcheck:"You must select %s choices or fewer.",check:"You must select between %s and %s choices.",equalto:"This value should be the same."}),O.setLocale("en");var I=new n;I.install();var q=O;return q});
function PowermailForm(e){"use strict";this.initialize=function(){a(),t(),i(),r(),o(),n(),c(),l()};var a=function(){e.fn.powermailTabs&&e(".powermail_morestep").each(function(){e(this).powermailTabs()})},t=function(){e("form[data-powermail-ajax]").length&&p()},i=function(){if(e('*[data-powermail-location="prefill"]').length&&navigator.geolocation){e(this);navigator.geolocation.getCurrentPosition(function(a){var t=a.coords.latitude,i=a.coords.longitude,r=D()+"/index.php?eID=powermailEidGetLocation";jQuery.ajax({url:r,data:"lat="+t+"&lng="+i,cache:!1,success:function(a){a&&e('*[data-powermail-location="prefill"]').val(a)}})})}},r=function(){e.fn.datetimepicker&&e(".powermail_date").each(function(){var a=e(this);if("date"===a.prop("type")||"datetime-local"===a.prop("type")||"time"===a.prop("type")){if(!a.data("datepicker-force")){if(e(this).data("date-value")){var t=v(e(this).data("date-value"),e(this).data("datepicker-format"),a.prop("type"));null!==t&&e(this).val(t)}return}a.prop("type","text")}var i=!0,r=!0;"date"===a.data("datepicker-settings")?r=!1:"time"===a.data("datepicker-settings")&&(i=!1),a.datetimepicker({format:a.data("datepicker-format"),timepicker:r,datepicker:i,lang:"en",i18n:{en:{months:a.data("datepicker-months").split(","),dayOfWeek:a.data("datepicker-days").split(",")}}})})},o=function(){e(".powermail_all_type_password.powermail_all_value").html("********")},n=function(){e.fn.parsley&&e(".powermail_reset").on("click","",function(){e('form[data-parsley-validate="data-parsley-validate"]').parsley().reset()})},l=function(){window.Parsley&&(_(),x())},p=function(){var a,t=!1;e(document).on("submit","form[data-powermail-ajax]",function(i){var r=e(this);r.data("powermail-ajax-uri")&&(a=r.data("powermail-ajax-uri"));var o=r.data("powermail-form");t||(e.ajax({type:"POST",url:r.prop("action"),data:new FormData(r.get(0)),contentType:!1,processData:!1,beforeSend:function(){s(r)},complete:function(){d(r),c()},success:function(i){var n=e('*[data-powermail-form="'+o+'"]:first',i);n.length?(e('*[data-powermail-form="'+o+'"]:first').closest(".tx-powermail").html(n),e.fn.powermailTabs&&e(".powermail_morestep").powermailTabs(),e.fn.parsley&&e('form[data-parsley-validate="data-parsley-validate"]').parsley(),m()):(a?j(a):r.submit(),t=!0)}}),i.preventDefault())})},s=function(a){d(a),e(".powermail_submit",a).length?e(".powermail_submit",a).parent().append(g()):a.closest(".tx-powermail").append(g())},d=function(e){e.closest(".tx-powermail").find(".powermail_progressbar").remove()},c=function(){e(".powermail_fieldwrap_file").find(".deleteAllFiles").each(function(){f(e(this).closest(".powermail_fieldwrap_file").find('input[type="file"]'))}),e(".deleteAllFiles").click(function(){u(e(this).closest(".powermail_fieldwrap_file").find('input[type="hidden"]')),e(this).closest("ul").fadeOut(function(){e(this).remove()})})},f=function(e){e.prop("disabled","disabled").addClass("hide").prop("type","hidden")},u=function(e){e.prop("disabled",!1).removeClass("hide").prop("type","file")},m=function(){e("img.powermail_captchaimage").each(function(){var a=w(e(this).prop("src"));e(this).prop("src",a+"?hash="+h(5))})},w=function(e){var a=e.split("?");return a[0]},h=function(e){for(var a="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<e;i++)a+=t.charAt(Math.floor(Math.random()*t.length));return a},v=function(e,a,t){var i=Date.parseDate(e,a);if(null===i)return null;var r=new Date(i),o=r.getFullYear()+"-";o+=("0"+(r.getMonth()+1)).slice(-2)+"-",o+=("0"+r.getDate()).slice(-2);var n=("0"+r.getHours()).slice(-2)+":"+("0"+r.getMinutes()).slice(-2),l=o+"T"+n;return"date"===t?o:"datetime-local"===t?l:"time"===t?n:null},g=function(){return e("<div />").addClass("powermail_progressbar").html(e("<div />").addClass("powermail_progress").html(e("<div />").addClass("powermail_progess_inner")))},y=function(e){for(var a=e.get(0),t=0,i=0;i<a.files.length;i++){var r=a.files[i];r.size>t&&(t=r.size)}return parseInt(t)},_=function(){window.Parsley.addValidator("powermailfilesize",function(a,t){if(t.indexOf(",")!==-1){var i=t.split(","),r=parseInt(i[0]),o=e('*[name="tx_powermail_pi1[field]['+i[1]+'][]"]');if(o.length&&y(o)>r)return!1}return!0},32).addMessage("en","powermailfilesize","Error")},x=function(){window.Parsley.addValidator("powermailfileextensions",function(a,t){var i=e('*[name="tx_powermail_pi1[field]['+t+'][]"]');return!i.length||b(k(a),i.prop("accept"))},32).addMessage("en","powermailfileextensions","Error")},b=function(e,a){return a.indexOf("."+e)!==-1},k=function(e){return e.split(".").pop().toLowerCase()},j=function(e){e.indexOf("http")!==-1?window.location=e:window.location.pathname=e},D=function(){var a;return a=e("base").length>0?jQuery("base").prop("href"):"https:"!=window.location.protocol?"http://"+window.location.hostname:"https://"+window.location.hostname}}jQuery(document).ready(function(e){"use strict";var a=new window.PowermailForm(e);a.initialize()});
!function(e){function o(o){"use strict";var i=e(o),r=["powermail_input","powermail_textarea","powermail_select","powermail_radio","powermail_checkbox"];this.ajaxListener=function(){t(),e(_()).on("change",function(){t()})};var n=function(o){if(void 0!==o.todo){for(var i in o.todo){var r=e(".powermail_form_"+i);for(var n in o.todo[i]){r.find(".powermail_fieldset_"+n);"hide"===o.todo[i][n]["#action"]&&f(m(n,r)),"un_hide"===o.todo[i][n]["#action"]&&p(m(n,r));for(var t in o.todo[i][n])"hide"===o.todo[i][n][t]["#action"]&&c(t,r),"un_hide"===o.todo[i][n][t]["#action"]&&u(t,r)}}h()}},t=function(){var o=e(i.get(0)),r=o.find(":disabled").prop("disabled",!1),t=new FormData(i.get(0));r.prop("disabled",!0),e.ajax({type:"POST",url:l(),data:t,contentType:!1,processData:!1,success:function(e){100===e.loops&&q("100 loops reached by parsing conditions and rules. Maybe there are conflicting conditions."),n(e)}})},a=function(e){(e.prop("required")||e.data("parsley-required"))&&(e.prop("required",!1),e.removeAttr("data-parsley-required"),e.data("powermailcond-required","required"))},d=function(e){"required"===e.data("powermailcond-required")&&(y()?e.prop("required","required"):v()&&e.prop("required","required")),e.removeData("powermailcond-required")},u=function(e,o){var i=o.find(".powermail_fieldwrap_"+e);i.show();var r=s(e,o);r.prop("disabled",!1),d(r)},c=function(e,o){var i=o.find(".powermail_fieldwrap_"+e);i.hide();var r=s(e,o);r.prop("disabled",!0),a(r)},p=function(e){e.show()},f=function(e){e.hide()},l=function(){var o=e("*[data-condition-uri]").data("condition-uri");return void 0===o&&q("Tag with data-condition-uri not found. Maybe TypoScript was not included."),o},s=function(e,o){return o.find('[name^="tx_powermail_pi1[field]['+e+']"]').not('[type="hidden"]')},m=function(e,o){return o.find(".powermail_fieldset_"+e)},w=function(e,o,i){o="undefined"!=typeof o?o:"",i="undefined"!=typeof i?i:",";for(var r="",n=0;n<e.length;n++)n>0&&(r+=i),r+=o+e[n];return r},_=function(){return w(r,".")},v=function(){return"data-parsley-validate"===i.data("parsley-validate")},y=function(){return"html5"===i.data("validate")},h=function(){v()&&(i.parsley().destroy(),i.parsley())},q=function(e){"object"==typeof console&&("string"==typeof e&&(e="powermail_cond: "+e),console.log(e))}}e(document).ready(function(){e("form.powermail_form").each(function(){new o(this).ajaxListener()})})}(jQuery);
!function($){$(".dpnglossary.details .description h3").on("click",function(){$(this).parents(".description").hasClass("open")?($(".dpnglossary.details .description.open .text").slideUp("slow"),$(".dpnglossary.details .description.open").removeClass("open")):($(".dpnglossary.details .description.open .text").slideUp("slow"),$(".dpnglossary.details .description.open").removeClass("open"),$(this).parents(".description").addClass("open"),$(this).parents(".description").find(".text").slideDown("slow"))})}(jQuery);
/*!
 * JavaScript Cookie v2.1.0
 * https://github.com/js-cookie/js-cookie
 *
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
 * Released under the MIT license
 */
(function (factory) {
	if (typeof define === 'function' && define.amd) {
		define(factory);
	} else if (typeof exports === 'object') {
		module.exports = factory();
	} else {
		var _OldCookies = window.Cookies;
		var api = window.Cookies = factory();
		api.noConflict = function () {
			window.Cookies = _OldCookies;
			return api;
		};
	}
}(function () {
	function extend () {
		var i = 0;
		var result = {};
		for (; i < arguments.length; i++) {
			var attributes = arguments[ i ];
			for (var key in attributes) {
				result[key] = attributes[key];
			}
		}
		return result;
	}

	function init (converter) {
		function api (key, value, attributes) {
			var result;

			// Write

			if (arguments.length > 1) {
				attributes = extend({
					path: '/'
				}, api.defaults, attributes);

				if (typeof attributes.expires === 'number') {
					var expires = new Date();
					expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
					attributes.expires = expires;
				}

				try {
					result = JSON.stringify(value);
					if (/^[\{\[]/.test(result)) {
						value = result;
					}
				} catch (e) {}

				if (!converter.write) {
					value = encodeURIComponent(String(value))
						.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
				} else {
					value = converter.write(value, key);
				}

				key = encodeURIComponent(String(key));
				key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
				key = key.replace(/[\(\)]/g, escape);

				return (document.cookie = [
					key, '=', value,
					attributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE
					attributes.path    && '; path=' + attributes.path,
					attributes.domain  && '; domain=' + attributes.domain,
					attributes.secure ? '; secure' : ''
				].join(''));
			}

			// Read

			if (!key) {
				result = {};
			}

			// To prevent the for loop in the first place assign an empty array
			// in case there are no cookies at all. Also prevents odd result when
			// calling "get()"
			var cookies = document.cookie ? document.cookie.split('; ') : [];
			var rdecode = /(%[0-9A-Z]{2})+/g;
			var i = 0;

			for (; i < cookies.length; i++) {
				var parts = cookies[i].split('=');
				var name = parts[0].replace(rdecode, decodeURIComponent);
				var cookie = parts.slice(1).join('=');

				if (cookie.charAt(0) === '"') {
					cookie = cookie.slice(1, -1);
				}

				try {
					cookie = converter.read ?
						converter.read(cookie, name) : converter(cookie, name) ||
						cookie.replace(rdecode, decodeURIComponent);

					if (this.json) {
						try {
							cookie = JSON.parse(cookie);
						} catch (e) {}
					}

					if (key === name) {
						result = cookie;
						break;
					}

					if (!key) {
						result[name] = cookie;
					}
				} catch (e) {}
			}

			return result;
		}

		api.get = api.set = api;
		api.getJSON = function () {
			return api.apply({
				json: true
			}, [].slice.call(arguments));
		};
		api.defaults = {};

		api.remove = function (key, attributes) {
			api(key, '', extend(attributes, {
				expires: -1
			}));
		};

		api.withConverter = init;

		return api;
	}

	return init(function () {});
}));

!function(a){var b=!0;a.flexslider=function(c,d){var e=a(c);e.vars=a.extend({},a.flexslider.defaults,d);var k,f=e.vars.namespace,g=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,h=("ontouchstart"in window||g||window.DocumentTouch&&document instanceof DocumentTouch)&&e.vars.touch,i="click touchend MSPointerUp keyup",j="",l="vertical"===e.vars.direction,m=e.vars.reverse,n=e.vars.itemWidth>0,o="fade"===e.vars.animation,p=""!==e.vars.asNavFor,q={};a.data(c,"flexslider",e),q={init:function(){e.animating=!1,e.currentSlide=parseInt(e.vars.startAt?e.vars.startAt:0,10),isNaN(e.currentSlide)&&(e.currentSlide=0),e.animatingTo=e.currentSlide,e.atEnd=0===e.currentSlide||e.currentSlide===e.last,e.containerSelector=e.vars.selector.substr(0,e.vars.selector.search(" ")),e.slides=a(e.vars.selector,e),e.container=a(e.containerSelector,e),e.count=e.slides.length,e.syncExists=a(e.vars.sync).length>0,"slide"===e.vars.animation&&(e.vars.animation="swing"),e.prop=l?"top":"marginLeft",e.args={},e.manualPause=!1,e.stopped=!1,e.started=!1,e.startTimeout=null,e.transitions=!e.vars.video&&!o&&e.vars.useCSS&&function(){var a=document.createElement("div"),b=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var c in b)if(void 0!==a.style[b[c]])return e.pfx=b[c].replace("Perspective","").toLowerCase(),e.prop="-"+e.pfx+"-transform",!0;return!1}(),e.ensureAnimationEnd="",""!==e.vars.controlsContainer&&(e.controlsContainer=a(e.vars.controlsContainer).length>0&&a(e.vars.controlsContainer)),""!==e.vars.manualControls&&(e.manualControls=a(e.vars.manualControls).length>0&&a(e.vars.manualControls)),""!==e.vars.customDirectionNav&&(e.customDirectionNav=2===a(e.vars.customDirectionNav).length&&a(e.vars.customDirectionNav)),e.vars.randomize&&(e.slides.sort(function(){return Math.round(Math.random())-.5}),e.container.empty().append(e.slides)),e.doMath(),e.setup("init"),e.vars.controlNav&&q.controlNav.setup(),e.vars.directionNav&&q.directionNav.setup(),e.vars.keyboard&&(1===a(e.containerSelector).length||e.vars.multipleKeyboard)&&a(document).bind("keyup",function(a){var b=a.keyCode;if(!e.animating&&(39===b||37===b)){var c=39===b?e.getTarget("next"):37===b&&e.getTarget("prev");e.flexAnimate(c,e.vars.pauseOnAction)}}),e.vars.mousewheel&&e.bind("mousewheel",function(a,b,c,d){a.preventDefault();var f=b<0?e.getTarget("next"):e.getTarget("prev");e.flexAnimate(f,e.vars.pauseOnAction)}),e.vars.pausePlay&&q.pausePlay.setup(),e.vars.slideshow&&e.vars.pauseInvisible&&q.pauseInvisible.init(),e.vars.slideshow&&(e.vars.pauseOnHover&&e.hover(function(){e.manualPlay||e.manualPause||e.pause()},function(){e.manualPause||e.manualPlay||e.stopped||e.play()}),e.vars.pauseInvisible&&q.pauseInvisible.isHidden()||(e.vars.initDelay>0?e.startTimeout=setTimeout(e.play,e.vars.initDelay):e.play())),p&&q.asNav.setup(),h&&e.vars.touch&&q.touch(),(!o||o&&e.vars.smoothHeight)&&a(window).bind("resize orientationchange focus",q.resize),e.find("img").attr("draggable","false"),setTimeout(function(){e.vars.start(e)},200)},asNav:{setup:function(){e.asNav=!0,e.animatingTo=Math.floor(e.currentSlide/e.move),e.currentItem=e.currentSlide,e.slides.removeClass(f+"active-slide").eq(e.currentItem).addClass(f+"active-slide"),g?(c._slider=e,e.slides.each(function(){var b=this;b._gesture=new MSGesture,b._gesture.target=b,b.addEventListener("MSPointerDown",function(a){a.preventDefault(),a.currentTarget._gesture&&a.currentTarget._gesture.addPointer(a.pointerId)},!1),b.addEventListener("MSGestureTap",function(b){b.preventDefault();var c=a(this),d=c.index();a(e.vars.asNavFor).data("flexslider").animating||c.hasClass("active")||(e.direction=e.currentItem<d?"next":"prev",e.flexAnimate(d,e.vars.pauseOnAction,!1,!0,!0))})})):e.slides.on(i,function(b){b.preventDefault();var c=a(this),d=c.index(),g=c.offset().left-a(e).scrollLeft();g<=0&&c.hasClass(f+"active-slide")?e.flexAnimate(e.getTarget("prev"),!0):a(e.vars.asNavFor).data("flexslider").animating||c.hasClass(f+"active-slide")||(e.direction=e.currentItem<d?"next":"prev",e.flexAnimate(d,e.vars.pauseOnAction,!1,!0,!0))})}},controlNav:{setup:function(){e.manualControls?q.controlNav.setupManual():q.controlNav.setupPaging()},setupPaging:function(){var d,g,b="thumbnails"===e.vars.controlNav?"control-thumbs":"control-paging",c=1;if(e.controlNavScaffold=a('<ol class="'+f+"control-nav "+f+b+'"></ol>'),e.pagingCount>1)for(var h=0;h<e.pagingCount;h++){if(g=e.slides.eq(h),void 0===g.attr("data-thumb-alt")&&g.attr("data-thumb-alt",""),altText=""!==g.attr("data-thumb-alt")?altText=' alt="'+g.attr("data-thumb-alt")+'"':"",d="thumbnails"===e.vars.controlNav?'<img src="'+g.attr("data-thumb")+'"'+altText+"/>":'<a href="#">'+c+"</a>","thumbnails"===e.vars.controlNav&&!0===e.vars.thumbCaptions){var k=g.attr("data-thumbcaption");""!==k&&void 0!==k&&(d+='<span class="'+f+'caption">'+k+"</span>")}e.controlNavScaffold.append("<li>"+d+"</li>"),c++}e.controlsContainer?a(e.controlsContainer).append(e.controlNavScaffold):e.append(e.controlNavScaffold),q.controlNav.set(),q.controlNav.active(),e.controlNavScaffold.delegate("a, img",i,function(b){if(b.preventDefault(),""===j||j===b.type){var c=a(this),d=e.controlNav.index(c);c.hasClass(f+"active")||(e.direction=d>e.currentSlide?"next":"prev",e.flexAnimate(d,e.vars.pauseOnAction))}""===j&&(j=b.type),q.setToClearWatchedEvent()})},setupManual:function(){e.controlNav=e.manualControls,q.controlNav.active(),e.controlNav.bind(i,function(b){if(b.preventDefault(),""===j||j===b.type){var c=a(this),d=e.controlNav.index(c);c.hasClass(f+"active")||(d>e.currentSlide?e.direction="next":e.direction="prev",e.flexAnimate(d,e.vars.pauseOnAction))}""===j&&(j=b.type),q.setToClearWatchedEvent()})},set:function(){var b="thumbnails"===e.vars.controlNav?"img":"a";e.controlNav=a("."+f+"control-nav li "+b,e.controlsContainer?e.controlsContainer:e)},active:function(){e.controlNav.removeClass(f+"active").eq(e.animatingTo).addClass(f+"active")},update:function(b,c){e.pagingCount>1&&"add"===b?e.controlNavScaffold.append(a('<li><a href="#">'+e.count+"</a></li>")):1===e.pagingCount?e.controlNavScaffold.find("li").remove():e.controlNav.eq(c).closest("li").remove(),q.controlNav.set(),e.pagingCount>1&&e.pagingCount!==e.controlNav.length?e.update(c,b):q.controlNav.active()}},directionNav:{setup:function(){var b=a('<ul class="'+f+'direction-nav"><li class="'+f+'nav-prev"><a class="'+f+'prev" href="#">'+e.vars.prevText+'</a></li><li class="'+f+'nav-next"><a class="'+f+'next" href="#">'+e.vars.nextText+"</a></li></ul>");e.customDirectionNav?e.directionNav=e.customDirectionNav:e.controlsContainer?(a(e.controlsContainer).append(b),e.directionNav=a("."+f+"direction-nav li a",e.controlsContainer)):(e.append(b),e.directionNav=a("."+f+"direction-nav li a",e)),q.directionNav.update(),e.directionNav.bind(i,function(b){b.preventDefault();var c;""!==j&&j!==b.type||(c=a(this).hasClass(f+"next")?e.getTarget("next"):e.getTarget("prev"),e.flexAnimate(c,e.vars.pauseOnAction)),""===j&&(j=b.type),q.setToClearWatchedEvent()})},update:function(){var a=f+"disabled";1===e.pagingCount?e.directionNav.addClass(a).attr("tabindex","-1"):e.vars.animationLoop?e.directionNav.removeClass(a).removeAttr("tabindex"):0===e.animatingTo?e.directionNav.removeClass(a).filter("."+f+"prev").addClass(a).attr("tabindex","-1"):e.animatingTo===e.last?e.directionNav.removeClass(a).filter("."+f+"next").addClass(a).attr("tabindex","-1"):e.directionNav.removeClass(a).removeAttr("tabindex")}},pausePlay:{setup:function(){var b=a('<div class="'+f+'pauseplay"><a href="#"></a></div>');e.controlsContainer?(e.controlsContainer.append(b),e.pausePlay=a("."+f+"pauseplay a",e.controlsContainer)):(e.append(b),e.pausePlay=a("."+f+"pauseplay a",e)),q.pausePlay.update(e.vars.slideshow?f+"pause":f+"play"),e.pausePlay.bind(i,function(b){b.preventDefault(),""!==j&&j!==b.type||(a(this).hasClass(f+"pause")?(e.manualPause=!0,e.manualPlay=!1,e.pause()):(e.manualPause=!1,e.manualPlay=!0,e.play())),""===j&&(j=b.type),q.setToClearWatchedEvent()})},update:function(a){"play"===a?e.pausePlay.removeClass(f+"pause").addClass(f+"play").html(e.vars.playText):e.pausePlay.removeClass(f+"play").addClass(f+"pause").html(e.vars.pauseText)}},touch:function(){function u(a){a.stopPropagation(),e.animating?a.preventDefault():(e.pause(),c._gesture.addPointer(a.pointerId),t=0,f=l?e.h:e.w,i=Number(new Date),d=n&&m&&e.animatingTo===e.last?0:n&&m?e.limit-(e.itemW+e.vars.itemMargin)*e.move*e.animatingTo:n&&e.currentSlide===e.last?e.limit:n?(e.itemW+e.vars.itemMargin)*e.move*e.currentSlide:m?(e.last-e.currentSlide+e.cloneOffset)*f:(e.currentSlide+e.cloneOffset)*f)}function v(a){a.stopPropagation();var b=a.target._slider;if(b){var e=-a.translationX,g=-a.translationY;return t+=l?g:e,h=t,q=l?Math.abs(t)<Math.abs(-e):Math.abs(t)<Math.abs(-g),a.detail===a.MSGESTURE_FLAG_INERTIA?void setImmediate(function(){c._gesture.stop()}):void((!q||Number(new Date)-i>500)&&(a.preventDefault(),!o&&b.transitions&&(b.vars.animationLoop||(h=t/(0===b.currentSlide&&t<0||b.currentSlide===b.last&&t>0?Math.abs(t)/f+2:1)),b.setProps(d+h,"setTouch"))))}}function w(c){c.stopPropagation();var e=c.target._slider;if(e){if(e.animatingTo===e.currentSlide&&!q&&null!==h){var g=m?-h:h,j=g>0?e.getTarget("next"):e.getTarget("prev");e.canAdvance(j)&&(Number(new Date)-i<550&&Math.abs(g)>50||Math.abs(g)>f/2)?e.flexAnimate(j,e.vars.pauseOnAction):o||e.flexAnimate(e.currentSlide,e.vars.pauseOnAction,!0)}a=null,b=null,h=null,d=null,t=0}}var a,b,d,f,h,i,j,k,p,q=!1,r=0,s=0,t=0;g?(c.style.msTouchAction="none",c._gesture=new MSGesture,c._gesture.target=c,c.addEventListener("MSPointerDown",u,!1),c._slider=e,c.addEventListener("MSGestureChange",v,!1),c.addEventListener("MSGestureEnd",w,!1)):(j=function(g){e.animating?g.preventDefault():(window.navigator.msPointerEnabled||1===g.touches.length)&&(e.pause(),f=l?e.h:e.w,i=Number(new Date),r=g.touches[0].pageX,s=g.touches[0].pageY,d=n&&m&&e.animatingTo===e.last?0:n&&m?e.limit-(e.itemW+e.vars.itemMargin)*e.move*e.animatingTo:n&&e.currentSlide===e.last?e.limit:n?(e.itemW+e.vars.itemMargin)*e.move*e.currentSlide:m?(e.last-e.currentSlide+e.cloneOffset)*f:(e.currentSlide+e.cloneOffset)*f,a=l?s:r,b=l?r:s,c.addEventListener("touchmove",k,!1),c.addEventListener("touchend",p,!1))},k=function(c){r=c.touches[0].pageX,s=c.touches[0].pageY,h=l?a-s:a-r,q=l?Math.abs(h)<Math.abs(r-b):Math.abs(h)<Math.abs(s-b);var g=500;(!q||Number(new Date)-i>g)&&(c.preventDefault(),!o&&e.transitions&&(e.vars.animationLoop||(h/=0===e.currentSlide&&h<0||e.currentSlide===e.last&&h>0?Math.abs(h)/f+2:1),e.setProps(d+h,"setTouch")))},p=function(g){if(c.removeEventListener("touchmove",k,!1),e.animatingTo===e.currentSlide&&!q&&null!==h){var j=m?-h:h,l=j>0?e.getTarget("next"):e.getTarget("prev");e.canAdvance(l)&&(Number(new Date)-i<550&&Math.abs(j)>50||Math.abs(j)>f/2)?e.flexAnimate(l,e.vars.pauseOnAction):o||e.flexAnimate(e.currentSlide,e.vars.pauseOnAction,!0)}c.removeEventListener("touchend",p,!1),a=null,b=null,h=null,d=null},c.addEventListener("touchstart",j,!1))},resize:function(){!e.animating&&e.is(":visible")&&(n||e.doMath(),o?q.smoothHeight():n?(e.slides.width(e.computedW),e.update(e.pagingCount),e.setProps()):l?(e.viewport.height(e.h),e.setProps(e.h,"setTotal")):(e.vars.smoothHeight&&q.smoothHeight(),e.newSlides.width(e.computedW),e.setProps(e.computedW,"setTotal")))},smoothHeight:function(a){if(!l||o){var b=o?e:e.viewport;a?b.animate({height:e.slides.eq(e.animatingTo).height()},a):b.height(e.slides.eq(e.animatingTo).height())}},sync:function(b){var c=a(e.vars.sync).data("flexslider"),d=e.animatingTo;switch(b){case"animate":c.flexAnimate(d,e.vars.pauseOnAction,!1,!0);break;case"play":c.playing||c.asNav||c.play();break;case"pause":c.pause()}},uniqueID:function(b){return b.filter("[id]").add(b.find("[id]")).each(function(){var b=a(this);b.attr("id",b.attr("id")+"_clone")}),b},pauseInvisible:{visProp:null,init:function(){var a=q.pauseInvisible.getHiddenProp();if(a){var b=a.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(b,function(){q.pauseInvisible.isHidden()?e.startTimeout?clearTimeout(e.startTimeout):e.pause():e.started?e.play():e.vars.initDelay>0?setTimeout(e.play,e.vars.initDelay):e.play()})}},isHidden:function(){var a=q.pauseInvisible.getHiddenProp();return!!a&&document[a]},getHiddenProp:function(){var a=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var b=0;b<a.length;b++)if(a[b]+"Hidden"in document)return a[b]+"Hidden";return null}},setToClearWatchedEvent:function(){clearTimeout(k),k=setTimeout(function(){j=""},3e3)}},e.flexAnimate=function(b,c,d,g,i){if(e.vars.animationLoop||b===e.currentSlide||(e.direction=b>e.currentSlide?"next":"prev"),p&&1===e.pagingCount&&(e.direction=e.currentItem<b?"next":"prev"),!e.animating&&(e.canAdvance(b,i)||d)&&e.is(":visible")){if(p&&g){var j=a(e.vars.asNavFor).data("flexslider");if(e.atEnd=0===b||b===e.count-1,j.flexAnimate(b,!0,!1,!0,i),e.direction=e.currentItem<b?"next":"prev",j.direction=e.direction,Math.ceil((b+1)/e.visible)-1===e.currentSlide||0===b)return e.currentItem=b,e.slides.removeClass(f+"active-slide").eq(b).addClass(f+"active-slide"),!1;e.currentItem=b,e.slides.removeClass(f+"active-slide").eq(b).addClass(f+"active-slide"),b=Math.floor(b/e.visible)}if(e.animating=!0,e.animatingTo=b,c&&e.pause(),e.vars.before(e),e.syncExists&&!i&&q.sync("animate"),e.vars.controlNav&&q.controlNav.active(),n||e.slides.removeClass(f+"active-slide").eq(b).addClass(f+"active-slide"),e.atEnd=0===b||b===e.last,e.vars.directionNav&&q.directionNav.update(),b===e.last&&(e.vars.end(e),e.vars.animationLoop||e.pause()),o)h?(e.slides.eq(e.currentSlide).css({opacity:0,zIndex:1}),e.slides.eq(b).css({opacity:1,zIndex:2}),e.wrapup(k)):(e.slides.eq(e.currentSlide).css({zIndex:1}).animate({opacity:0},e.vars.animationSpeed,e.vars.easing),e.slides.eq(b).css({zIndex:2}).animate({opacity:1},e.vars.animationSpeed,e.vars.easing,e.wrapup));else{var r,s,t,k=l?e.slides.filter(":first").height():e.computedW;n?(r=e.vars.itemMargin,t=(e.itemW+r)*e.move*e.animatingTo,s=t>e.limit&&1!==e.visible?e.limit:t):s=0===e.currentSlide&&b===e.count-1&&e.vars.animationLoop&&"next"!==e.direction?m?(e.count+e.cloneOffset)*k:0:e.currentSlide===e.last&&0===b&&e.vars.animationLoop&&"prev"!==e.direction?m?0:(e.count+1)*k:m?(e.count-1-b+e.cloneOffset)*k:(b+e.cloneOffset)*k,e.setProps(s,"",e.vars.animationSpeed),e.transitions?(e.vars.animationLoop&&e.atEnd||(e.animating=!1,e.currentSlide=e.animatingTo),e.container.unbind("webkitTransitionEnd transitionend"),e.container.bind("webkitTransitionEnd transitionend",function(){clearTimeout(e.ensureAnimationEnd),e.wrapup(k)}),clearTimeout(e.ensureAnimationEnd),e.ensureAnimationEnd=setTimeout(function(){e.wrapup(k)},e.vars.animationSpeed+100)):e.container.animate(e.args,e.vars.animationSpeed,e.vars.easing,function(){e.wrapup(k)})}e.vars.smoothHeight&&q.smoothHeight(e.vars.animationSpeed)}},e.wrapup=function(a){o||n||(0===e.currentSlide&&e.animatingTo===e.last&&e.vars.animationLoop?e.setProps(a,"jumpEnd"):e.currentSlide===e.last&&0===e.animatingTo&&e.vars.animationLoop&&e.setProps(a,"jumpStart")),e.animating=!1,e.currentSlide=e.animatingTo,e.vars.after(e)},e.animateSlides=function(){!e.animating&&b&&e.flexAnimate(e.getTarget("next"))},e.pause=function(){clearInterval(e.animatedSlides),e.animatedSlides=null,e.playing=!1,e.vars.pausePlay&&q.pausePlay.update("play"),e.syncExists&&q.sync("pause")},e.play=function(){e.playing&&clearInterval(e.animatedSlides),e.animatedSlides=e.animatedSlides||setInterval(e.animateSlides,e.vars.slideshowSpeed),e.started=e.playing=!0,e.vars.pausePlay&&q.pausePlay.update("pause"),e.syncExists&&q.sync("play")},e.stop=function(){e.pause(),e.stopped=!0},e.canAdvance=function(a,b){var c=p?e.pagingCount-1:e.last;return!!b||(!(!p||e.currentItem!==e.count-1||0!==a||"prev"!==e.direction)||(!p||0!==e.currentItem||a!==e.pagingCount-1||"next"===e.direction)&&(!(a===e.currentSlide&&!p)&&(!!e.vars.animationLoop||(!e.atEnd||0!==e.currentSlide||a!==c||"next"===e.direction)&&(!e.atEnd||e.currentSlide!==c||0!==a||"next"!==e.direction))))},e.getTarget=function(a){return e.direction=a,"next"===a?e.currentSlide===e.last?0:e.currentSlide+1:0===e.currentSlide?e.last:e.currentSlide-1},e.setProps=function(a,b,c){var d=function(){var c=a?a:(e.itemW+e.vars.itemMargin)*e.move*e.animatingTo,d=function(){if(n)return"setTouch"===b?a:m&&e.animatingTo===e.last?0:m?e.limit-(e.itemW+e.vars.itemMargin)*e.move*e.animatingTo:e.animatingTo===e.last?e.limit:c;switch(b){case"setTotal":return m?(e.count-1-e.currentSlide+e.cloneOffset)*a:(e.currentSlide+e.cloneOffset)*a;case"setTouch":return m?a:a;case"jumpEnd":return m?a:e.count*a;case"jumpStart":return m?e.count*a:a;default:return a}}();return d*-1+"px"}();e.transitions&&(d=l?"translate3d(0,"+d+",0)":"translate3d("+d+",0,0)",c=void 0!==c?c/1e3+"s":"0s",e.container.css("-"+e.pfx+"-transition-duration",c),e.container.css("transition-duration",c)),e.args[e.prop]=d,(e.transitions||void 0===c)&&e.container.css(e.args),e.container.css("transform",d)},e.setup=function(b){if(o)e.slides.css({width:"100%",float:"left",marginRight:"-100%",position:"relative"}),"init"===b&&(h?e.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+e.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(e.currentSlide).css({opacity:1,zIndex:2}):0==e.vars.fadeFirstSlide?e.slides.css({opacity:0,display:"block",zIndex:1}).eq(e.currentSlide).css({zIndex:2}).css({opacity:1}):e.slides.css({opacity:0,display:"block",zIndex:1}).eq(e.currentSlide).css({zIndex:2}).animate({opacity:1},e.vars.animationSpeed,e.vars.easing)),e.vars.smoothHeight&&q.smoothHeight();else{var c,d;"init"===b&&(e.viewport=a('<div class="'+f+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(e).append(e.container),e.cloneCount=0,e.cloneOffset=0,m&&(d=a.makeArray(e.slides).reverse(),e.slides=a(d),e.container.empty().append(e.slides))),e.vars.animationLoop&&!n&&(e.cloneCount=2,e.cloneOffset=1,"init"!==b&&e.container.find(".clone").remove(),e.container.append(q.uniqueID(e.slides.first().clone().addClass("clone")).attr("aria-hidden","true")).prepend(q.uniqueID(e.slides.last().clone().addClass("clone")).attr("aria-hidden","true"))),e.newSlides=a(e.vars.selector,e),c=m?e.count-1-e.currentSlide+e.cloneOffset:e.currentSlide+e.cloneOffset,l&&!n?(e.container.height(200*(e.count+e.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){e.newSlides.css({display:"block"}),e.doMath(),e.viewport.height(e.h),e.setProps(c*e.h,"init")},"init"===b?100:0)):(e.container.width(200*(e.count+e.cloneCount)+"%"),e.setProps(c*e.computedW,"init"),setTimeout(function(){e.doMath(),e.newSlides.css({width:e.computedW,marginRight:e.computedM,float:"left",display:"block"}),e.vars.smoothHeight&&q.smoothHeight()},"init"===b?100:0))}n||e.slides.removeClass(f+"active-slide").eq(e.currentSlide).addClass(f+"active-slide"),e.vars.init(e)},e.doMath=function(){var a=e.slides.first(),b=e.vars.itemMargin,c=e.vars.minItems,d=e.vars.maxItems;e.w=void 0===e.viewport?e.width():e.viewport.width(),e.h=a.height(),e.boxPadding=a.outerWidth()-a.width(),n?(e.itemT=e.vars.itemWidth+b,e.itemM=b,e.minW=c?c*e.itemT:e.w,e.maxW=d?d*e.itemT-b:e.w,e.itemW=e.minW>e.w?(e.w-b*(c-1))/c:e.maxW<e.w?(e.w-b*(d-1))/d:e.vars.itemWidth>e.w?e.w:e.vars.itemWidth,e.visible=Math.floor(e.w/e.itemW),e.move=e.vars.move>0&&e.vars.move<e.visible?e.vars.move:e.visible,e.pagingCount=Math.ceil((e.count-e.visible)/e.move+1),e.last=e.pagingCount-1,e.limit=1===e.pagingCount?0:e.vars.itemWidth>e.w?e.itemW*(e.count-1)+b*(e.count-1):(e.itemW+b)*e.count-e.w-b):(e.itemW=e.w,e.itemM=b,e.pagingCount=e.count,e.last=e.count-1),e.computedW=e.itemW-e.boxPadding,e.computedM=e.itemM},e.update=function(a,b){e.doMath(),n||(a<e.currentSlide?e.currentSlide+=1:a<=e.currentSlide&&0!==a&&(e.currentSlide-=1),e.animatingTo=e.currentSlide),e.vars.controlNav&&!e.manualControls&&("add"===b&&!n||e.pagingCount>e.controlNav.length?q.controlNav.update("add"):("remove"===b&&!n||e.pagingCount<e.controlNav.length)&&(n&&e.currentSlide>e.last&&(e.currentSlide-=1,e.animatingTo-=1),q.controlNav.update("remove",e.last))),e.vars.directionNav&&q.directionNav.update()},e.addSlide=function(b,c){var d=a(b);e.count+=1,e.last=e.count-1,l&&m?void 0!==c?e.slides.eq(e.count-c).after(d):e.container.prepend(d):void 0!==c?e.slides.eq(c).before(d):e.container.append(d),e.update(c,"add"),e.slides=a(e.vars.selector+":not(.clone)",e),e.setup(),e.vars.added(e)},e.removeSlide=function(b){var c=isNaN(b)?e.slides.index(a(b)):b;e.count-=1,e.last=e.count-1,isNaN(b)?a(b,e.slides).remove():l&&m?e.slides.eq(e.last).remove():e.slides.eq(b).remove(),e.doMath(),e.update(c,"remove"),e.slides=a(e.vars.selector+":not(.clone)",e),e.setup(),e.vars.removed(e)},q.init()},a(window).blur(function(a){b=!1}).focus(function(a){b=!0}),a.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,fadeFirstSlide:!0,thumbCaptions:!1,pauseOnAction:!0,pauseOnHover:!1,pauseInvisible:!0,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:".flexslider-ortenau-nav-inner",manualControls:"",customDirectionNav:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:1,maxItems:0,move:0,allowOneSlide:!0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){},init:function(){}},a.fn.flexslider=function(b){if(void 0===b&&(b={}),"object"==typeof b)return this.each(function(){var c=a(this),d=b.selector?b.selector:".slides > li",e=c.find(d);1===e.length&&b.allowOneSlide===!0||0===e.length?(e.fadeIn(400),b.start&&b.start(c)):void 0===c.data("flexslider")&&new a.flexslider(this,b)});var c=a(this).data("flexslider");switch(b){case"play":c.play();break;case"pause":c.pause();break;case"stop":c.stop();break;case"next":c.flexAnimate(c.getTarget("next"),!0);break;case"prev":case"previous":c.flexAnimate(c.getTarget("prev"),!0);break;default:"number"==typeof b&&c.flexAnimate(b,!0)}}}(jQuery);
/*! Magnific Popup - v1.1.0 - 2016-02-20
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2016 Dmitry Semenov; */
;(function (factory) { 
if (typeof define === 'function' && define.amd) { 
 // AMD. Register as an anonymous module. 
 define(['jquery'], factory); 
 } else if (typeof exports === 'object') { 
 // Node/CommonJS 
 factory(require('jquery')); 
 } else { 
 // Browser globals 
 factory(window.jQuery || window.Zepto); 
 } 
 }(function($) { 

/*>>core*/
/**
 * 
 * Magnific Popup Core JS file
 * 
 */


/**
 * Private static constants
 */
var CLOSE_EVENT = 'Close',
	BEFORE_CLOSE_EVENT = 'BeforeClose',
	AFTER_CLOSE_EVENT = 'AfterClose',
	BEFORE_APPEND_EVENT = 'BeforeAppend',
	MARKUP_PARSE_EVENT = 'MarkupParse',
	OPEN_EVENT = 'Open',
	CHANGE_EVENT = 'Change',
	NS = 'mfp',
	EVENT_NS = '.' + NS,
	READY_CLASS = 'mfp-ready',
	REMOVING_CLASS = 'mfp-removing',
	PREVENT_CLOSE_CLASS = 'mfp-prevent-close';


/**
 * Private vars 
 */
/*jshint -W079 */
var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
	MagnificPopup = function(){},
	_isJQ = !!(window.jQuery),
	_prevStatus,
	_window = $(window),
	_document,
	_prevContentType,
	_wrapClasses,
	_currPopupType;


/**
 * Private functions
 */
var _mfpOn = function(name, f) {
		mfp.ev.on(NS + name + EVENT_NS, f);
	},
	_getEl = function(className, appendTo, html, raw) {
		var el = document.createElement('div');
		el.className = 'mfp-'+className;
		if(html) {
			el.innerHTML = html;
		}
		if(!raw) {
			el = $(el);
			if(appendTo) {
				el.appendTo(appendTo);
			}
		} else if(appendTo) {
			appendTo.appendChild(el);
		}
		return el;
	},
	_mfpTrigger = function(e, data) {
		mfp.ev.triggerHandler(NS + e, data);

		if(mfp.st.callbacks) {
			// converts "mfpEventName" to "eventName" callback and triggers it if it's present
			e = e.charAt(0).toLowerCase() + e.slice(1);
			if(mfp.st.callbacks[e]) {
				mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
			}
		}
	},
	_getCloseBtn = function(type) {
		if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
			mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
			_currPopupType = type;
		}
		return mfp.currTemplate.closeBtn;
	},
	// Initialize Magnific Popup only when called at least once
	_checkInstance = function() {
		if(!$.magnificPopup.instance) {
			/*jshint -W020 */
			mfp = new MagnificPopup();
			mfp.init();
			$.magnificPopup.instance = mfp;
		}
	},
	// CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
	supportsTransitions = function() {
		var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
			v = ['ms','O','Moz','Webkit']; // 'v' for vendor

		if( s['transition'] !== undefined ) {
			return true; 
		}
			
		while( v.length ) {
			if( v.pop() + 'Transition' in s ) {
				return true;
			}
		}
				
		return false;
	};



/**
 * Public functions
 */
MagnificPopup.prototype = {

	constructor: MagnificPopup,

	/**
	 * Initializes Magnific Popup plugin. 
	 * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
	 */
	init: function() {
		var appVersion = navigator.appVersion;
		mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;
		mfp.isAndroid = (/android/gi).test(appVersion);
		mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
		mfp.supportsTransition = supportsTransitions();

		// We disable fixed positioned lightbox on devices that don't handle it nicely.
		// If you know a better way of detecting this - let me know.
		mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
		_document = $(document);

		mfp.popupsCache = {};
	},

	/**
	 * Opens popup
	 * @param  data [description]
	 */
	open: function(data) {

		var i;

		if(data.isObj === false) { 
			// convert jQuery collection to array to avoid conflicts later
			mfp.items = data.items.toArray();

			mfp.index = 0;
			var items = data.items,
				item;
			for(i = 0; i < items.length; i++) {
				item = items[i];
				if(item.parsed) {
					item = item.el[0];
				}
				if(item === data.el[0]) {
					mfp.index = i;
					break;
				}
			}
		} else {
			mfp.items = $.isArray(data.items) ? data.items : [data.items];
			mfp.index = data.index || 0;
		}

		// if popup is already opened - we just update the content
		if(mfp.isOpen) {
			mfp.updateItemHTML();
			return;
		}
		
		mfp.types = []; 
		_wrapClasses = '';
		if(data.mainEl && data.mainEl.length) {
			mfp.ev = data.mainEl.eq(0);
		} else {
			mfp.ev = _document;
		}

		if(data.key) {
			if(!mfp.popupsCache[data.key]) {
				mfp.popupsCache[data.key] = {};
			}
			mfp.currTemplate = mfp.popupsCache[data.key];
		} else {
			mfp.currTemplate = {};
		}



		mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data ); 
		mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;

		if(mfp.st.modal) {
			mfp.st.closeOnContentClick = false;
			mfp.st.closeOnBgClick = false;
			mfp.st.showCloseBtn = false;
			mfp.st.enableEscapeKey = false;
		}
		

		// Building markup
		// main containers are created only once
		if(!mfp.bgOverlay) {

			// Dark overlay
			mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
				mfp.close();
			});

			mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
				if(mfp._checkIfClose(e.target)) {
					mfp.close();
				}
			});

			mfp.container = _getEl('container', mfp.wrap);
		}

		mfp.contentContainer = _getEl('content');
		if(mfp.st.preloader) {
			mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
		}


		// Initializing modules
		var modules = $.magnificPopup.modules;
		for(i = 0; i < modules.length; i++) {
			var n = modules[i];
			n = n.charAt(0).toUpperCase() + n.slice(1);
			mfp['init'+n].call(mfp);
		}
		_mfpTrigger('BeforeOpen');


		if(mfp.st.showCloseBtn) {
			// Close button
			if(!mfp.st.closeBtnInside) {
				mfp.wrap.append( _getCloseBtn() );
			} else {
				_mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
					values.close_replaceWith = _getCloseBtn(item.type);
				});
				_wrapClasses += ' mfp-close-btn-in';
			}
		}

		if(mfp.st.alignTop) {
			_wrapClasses += ' mfp-align-top';
		}

	

		if(mfp.fixedContentPos) {
			mfp.wrap.css({
				overflow: mfp.st.overflowY,
				overflowX: 'hidden',
				overflowY: mfp.st.overflowY
			});
		} else {
			mfp.wrap.css({ 
				top: _window.scrollTop(),
				position: 'absolute'
			});
		}
		if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
			mfp.bgOverlay.css({
				height: _document.height(),
				position: 'absolute'
			});
		}

		

		if(mfp.st.enableEscapeKey) {
			// Close on ESC key
			_document.on('keyup' + EVENT_NS, function(e) {
				if(e.keyCode === 27) {
					mfp.close();
				}
			});
		}

		_window.on('resize' + EVENT_NS, function() {
			mfp.updateSize();
		});


		if(!mfp.st.closeOnContentClick) {
			_wrapClasses += ' mfp-auto-cursor';
		}
		
		if(_wrapClasses)
			mfp.wrap.addClass(_wrapClasses);


		// this triggers recalculation of layout, so we get it once to not to trigger twice
		var windowHeight = mfp.wH = _window.height();

		
		var windowStyles = {};

		if( mfp.fixedContentPos ) {
            if(mfp._hasScrollBar(windowHeight)){
                var s = mfp._getScrollbarSize();
                if(s) {
                    windowStyles.marginRight = s;
                }
            }
        }

		if(mfp.fixedContentPos) {
			if(!mfp.isIE7) {
				windowStyles.overflow = 'hidden';
			} else {
				// ie7 double-scroll bug
				$('body, html').css('overflow', 'hidden');
			}
		}

		
		
		var classesToadd = mfp.st.mainClass;
		if(mfp.isIE7) {
			classesToadd += ' mfp-ie7';
		}
		if(classesToadd) {
			mfp._addClassToMFP( classesToadd );
		}

		// add content
		mfp.updateItemHTML();

		_mfpTrigger('BuildControls');

		// remove scrollbar, add margin e.t.c
		$('html').css(windowStyles);
		
		// add everything to DOM
		mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );

		// Save last focused element
		mfp._lastFocusedEl = document.activeElement;
		
		// Wait for next cycle to allow CSS transition
		setTimeout(function() {
			
			if(mfp.content) {
				mfp._addClassToMFP(READY_CLASS);
				mfp._setFocus();
			} else {
				// if content is not defined (not loaded e.t.c) we add class only for BG
				mfp.bgOverlay.addClass(READY_CLASS);
			}
			
			// Trap the focus in popup
			_document.on('focusin' + EVENT_NS, mfp._onFocusIn);

		}, 16);

		mfp.isOpen = true;
		mfp.updateSize(windowHeight);
		_mfpTrigger(OPEN_EVENT);

		return data;
	},

	/**
	 * Closes the popup
	 */
	close: function() {
		if(!mfp.isOpen) return;
		_mfpTrigger(BEFORE_CLOSE_EVENT);

		mfp.isOpen = false;
		// for CSS3 animation
		if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition )  {
			mfp._addClassToMFP(REMOVING_CLASS);
			setTimeout(function() {
				mfp._close();
			}, mfp.st.removalDelay);
		} else {
			mfp._close();
		}
	},

	/**
	 * Helper for close() function
	 */
	_close: function() {
		_mfpTrigger(CLOSE_EVENT);

		var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';

		mfp.bgOverlay.detach();
		mfp.wrap.detach();
		mfp.container.empty();

		if(mfp.st.mainClass) {
			classesToRemove += mfp.st.mainClass + ' ';
		}

		mfp._removeClassFromMFP(classesToRemove);

		if(mfp.fixedContentPos) {
			var windowStyles = {marginRight: ''};
			if(mfp.isIE7) {
				$('body, html').css('overflow', '');
			} else {
				windowStyles.overflow = '';
			}
			$('html').css(windowStyles);
		}
		
		_document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
		mfp.ev.off(EVENT_NS);

		// clean up DOM elements that aren't removed
		mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
		mfp.bgOverlay.attr('class', 'mfp-bg');
		mfp.container.attr('class', 'mfp-container');

		// remove close button from target element
		if(mfp.st.showCloseBtn &&
		(!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
			if(mfp.currTemplate.closeBtn)
				mfp.currTemplate.closeBtn.detach();
		}


		if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
			$(mfp._lastFocusedEl).focus(); // put tab focus back
		}
		mfp.currItem = null;	
		mfp.content = null;
		mfp.currTemplate = null;
		mfp.prevHeight = 0;

		_mfpTrigger(AFTER_CLOSE_EVENT);
	},
	
	updateSize: function(winHeight) {

		if(mfp.isIOS) {
			// fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
			var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
			var height = window.innerHeight * zoomLevel;
			mfp.wrap.css('height', height);
			mfp.wH = height;
		} else {
			mfp.wH = winHeight || _window.height();
		}
		// Fixes #84: popup incorrectly positioned with position:relative on body
		if(!mfp.fixedContentPos) {
			mfp.wrap.css('height', mfp.wH);
		}

		_mfpTrigger('Resize');

	},

	/**
	 * Set content of popup based on current index
	 */
	updateItemHTML: function() {
		var item = mfp.items[mfp.index];

		// Detach and perform modifications
		mfp.contentContainer.detach();

		if(mfp.content)
			mfp.content.detach();

		if(!item.parsed) {
			item = mfp.parseEl( mfp.index );
		}

		var type = item.type;

		_mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
		// BeforeChange event works like so:
		// _mfpOn('BeforeChange', function(e, prevType, newType) { });

		mfp.currItem = item;

		if(!mfp.currTemplate[type]) {
			var markup = mfp.st[type] ? mfp.st[type].markup : false;

			// allows to modify markup
			_mfpTrigger('FirstMarkupParse', markup);

			if(markup) {
				mfp.currTemplate[type] = $(markup);
			} else {
				// if there is no markup found we just define that template is parsed
				mfp.currTemplate[type] = true;
			}
		}

		if(_prevContentType && _prevContentType !== item.type) {
			mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
		}

		var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
		mfp.appendContent(newContent, type);

		item.preloaded = true;

		_mfpTrigger(CHANGE_EVENT, item);
		_prevContentType = item.type;

		// Append container back after its content changed
		mfp.container.prepend(mfp.contentContainer);

		_mfpTrigger('AfterChange');
	},


	/**
	 * Set HTML content of popup
	 */
	appendContent: function(newContent, type) {
		mfp.content = newContent;

		if(newContent) {
			if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
				mfp.currTemplate[type] === true) {
				// if there is no markup, we just append close button element inside
				if(!mfp.content.find('.mfp-close').length) {
					mfp.content.append(_getCloseBtn());
				}
			} else {
				mfp.content = newContent;
			}
		} else {
			mfp.content = '';
		}

		_mfpTrigger(BEFORE_APPEND_EVENT);
		mfp.container.addClass('mfp-'+type+'-holder');

		mfp.contentContainer.append(mfp.content);
	},


	/**
	 * Creates Magnific Popup data object based on given data
	 * @param  {int} index Index of item to parse
	 */
	parseEl: function(index) {
		var item = mfp.items[index],
			type;

		if(item.tagName) {
			item = { el: $(item) };
		} else {
			type = item.type;
			item = { data: item, src: item.src };
		}

		if(item.el) {
			var types = mfp.types;

			// check for 'mfp-TYPE' class
			for(var i = 0; i < types.length; i++) {
				if( item.el.hasClass('mfp-'+types[i]) ) {
					type = types[i];
					break;
				}
			}

			item.src = item.el.attr('data-mfp-src');
			if(!item.src) {
				item.src = item.el.attr('href');
			}
		}

		item.type = type || mfp.st.type || 'inline';
		item.index = index;
		item.parsed = true;
		mfp.items[index] = item;
		_mfpTrigger('ElementParse', item);

		return mfp.items[index];
	},


	/**
	 * Initializes single popup or a group of popups
	 */
	addGroup: function(el, options) {
		var eHandler = function(e) {
			e.mfpEl = this;
			mfp._openClick(e, el, options);
		};

		if(!options) {
			options = {};
		}

		var eName = 'click.magnificPopup';
		options.mainEl = el;

		if(options.items) {
			options.isObj = true;
			el.off(eName).on(eName, eHandler);
		} else {
			options.isObj = false;
			if(options.delegate) {
				el.off(eName).on(eName, options.delegate , eHandler);
			} else {
				options.items = el;
				el.off(eName).on(eName, eHandler);
			}
		}
	},
	_openClick: function(e, el, options) {
		var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;


		if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
			return;
		}

		var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;

		if(disableOn) {
			if($.isFunction(disableOn)) {
				if( !disableOn.call(mfp) ) {
					return true;
				}
			} else { // else it's number
				if( _window.width() < disableOn ) {
					return true;
				}
			}
		}

		if(e.type) {
			e.preventDefault();

			// This will prevent popup from closing if element is inside and popup is already opened
			if(mfp.isOpen) {
				e.stopPropagation();
			}
		}

		options.el = $(e.mfpEl);
		if(options.delegate) {
			options.items = el.find(options.delegate);
		}
		mfp.open(options);
	},


	/**
	 * Updates text on preloader
	 */
	updateStatus: function(status, text) {

		if(mfp.preloader) {
			if(_prevStatus !== status) {
				mfp.container.removeClass('mfp-s-'+_prevStatus);
			}

			if(!text && status === 'loading') {
				text = mfp.st.tLoading;
			}

			var data = {
				status: status,
				text: text
			};
			// allows to modify status
			_mfpTrigger('UpdateStatus', data);

			status = data.status;
			text = data.text;

			mfp.preloader.html(text);

			mfp.preloader.find('a').on('click', function(e) {
				e.stopImmediatePropagation();
			});

			mfp.container.addClass('mfp-s-'+status);
			_prevStatus = status;
		}
	},


	/*
		"Private" helpers that aren't private at all
	 */
	// Check to close popup or not
	// "target" is an element that was clicked
	_checkIfClose: function(target) {

		if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
			return;
		}

		var closeOnContent = mfp.st.closeOnContentClick;
		var closeOnBg = mfp.st.closeOnBgClick;

		if(closeOnContent && closeOnBg) {
			return true;
		} else {

			// We close the popup if click is on close button or on preloader. Or if there is no content.
			if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {
				return true;
			}

			// if click is outside the content
			if(  (target !== mfp.content[0] && !$.contains(mfp.content[0], target))  ) {
				if(closeOnBg) {
					// last check, if the clicked element is in DOM, (in case it's removed onclick)
					if( $.contains(document, target) ) {
						return true;
					}
				}
			} else if(closeOnContent) {
				return true;
			}

		}
		return false;
	},
	_addClassToMFP: function(cName) {
		mfp.bgOverlay.addClass(cName);
		mfp.wrap.addClass(cName);
	},
	_removeClassFromMFP: function(cName) {
		this.bgOverlay.removeClass(cName);
		mfp.wrap.removeClass(cName);
	},
	_hasScrollBar: function(winHeight) {
		return (  (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
	},
	_setFocus: function() {
		(mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
	},
	_onFocusIn: function(e) {
		if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
			mfp._setFocus();
			return false;
		}
	},
	_parseMarkup: function(template, values, item) {
		var arr;
		if(item.data) {
			values = $.extend(item.data, values);
		}
		_mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );

		$.each(values, function(key, value) {
			if(value === undefined || value === false) {
				return true;
			}
			arr = key.split('_');
			if(arr.length > 1) {
				var el = template.find(EVENT_NS + '-'+arr[0]);

				if(el.length > 0) {
					var attr = arr[1];
					if(attr === 'replaceWith') {
						if(el[0] !== value[0]) {
							el.replaceWith(value);
						}
					} else if(attr === 'img') {
						if(el.is('img')) {
							el.attr('src', value);
						} else {
							el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
						}
					} else {
						el.attr(arr[1], value);
					}
				}

			} else {
				template.find(EVENT_NS + '-'+key).html(value);
			}
		});
	},

	_getScrollbarSize: function() {
		// thx David
		if(mfp.scrollbarSize === undefined) {
			var scrollDiv = document.createElement("div");
			scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
			document.body.appendChild(scrollDiv);
			mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
			document.body.removeChild(scrollDiv);
		}
		return mfp.scrollbarSize;
	}

}; /* MagnificPopup core prototype end */




/**
 * Public static functions
 */
$.magnificPopup = {
	instance: null,
	proto: MagnificPopup.prototype,
	modules: [],

	open: function(options, index) {
		_checkInstance();

		if(!options) {
			options = {};
		} else {
			options = $.extend(true, {}, options);
		}

		options.isObj = true;
		options.index = index || 0;
		return this.instance.open(options);
	},

	close: function() {
		return $.magnificPopup.instance && $.magnificPopup.instance.close();
	},

	registerModule: function(name, module) {
		if(module.options) {
			$.magnificPopup.defaults[name] = module.options;
		}
		$.extend(this.proto, module.proto);
		this.modules.push(name);
	},

	defaults: {

		// Info about options is in docs:
		// http://dimsemenov.com/plugins/magnific-popup/documentation.html#options

		disableOn: 0,

		key: null,

		midClick: false,

		mainClass: '',

		preloader: true,

		focus: '', // CSS selector of input to focus after popup is opened

		closeOnContentClick: false,

		closeOnBgClick: true,

		closeBtnInside: true,

		showCloseBtn: true,

		enableEscapeKey: true,

		modal: false,

		alignTop: false,

		removalDelay: 0,

		prependTo: null,

		fixedContentPos: 'auto',

		fixedBgPos: 'auto',

		overflowY: 'auto',

		closeMarkup: '<button title="%title%" type="button" class="mfp-close">&#215;</button>',

		tClose: 'Close (Esc)',

		tLoading: 'Loading...',

		autoFocusLast: true

	}
};



$.fn.magnificPopup = function(options) {
	_checkInstance();

	var jqEl = $(this);

	// We call some API method of first param is a string
	if (typeof options === "string" ) {

		if(options === 'open') {
			var items,
				itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,
				index = parseInt(arguments[1], 10) || 0;

			if(itemOpts.items) {
				items = itemOpts.items[index];
			} else {
				items = jqEl;
				if(itemOpts.delegate) {
					items = items.find(itemOpts.delegate);
				}
				items = items.eq( index );
			}
			mfp._openClick({mfpEl:items}, jqEl, itemOpts);
		} else {
			if(mfp.isOpen)
				mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
		}

	} else {
		// clone options obj
		options = $.extend(true, {}, options);

		/*
		 * As Zepto doesn't support .data() method for objects
		 * and it works only in normal browsers
		 * we assign "options" object directly to the DOM element. FTW!
		 */
		if(_isJQ) {
			jqEl.data('magnificPopup', options);
		} else {
			jqEl[0].magnificPopup = options;
		}

		mfp.addGroup(jqEl, options);

	}
	return jqEl;
};

/*>>core*/

/*>>inline*/

var INLINE_NS = 'inline',
	_hiddenClass,
	_inlinePlaceholder,
	_lastInlineElement,
	_putInlineElementsBack = function() {
		if(_lastInlineElement) {
			_inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();
			_lastInlineElement = null;
		}
	};

$.magnificPopup.registerModule(INLINE_NS, {
	options: {
		hiddenClass: 'hide', // will be appended with `mfp-` prefix
		markup: '',
		tNotFound: 'Content not found'
	},
	proto: {

		initInline: function() {
			mfp.types.push(INLINE_NS);

			_mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
				_putInlineElementsBack();
			});
		},

		getInline: function(item, template) {

			_putInlineElementsBack();

			if(item.src) {
				var inlineSt = mfp.st.inline,
					el = $(item.src);

				if(el.length) {

					// If target element has parent - we replace it with placeholder and put it back after popup is closed
					var parent = el[0].parentNode;
					if(parent && parent.tagName) {
						if(!_inlinePlaceholder) {
							_hiddenClass = inlineSt.hiddenClass;
							_inlinePlaceholder = _getEl(_hiddenClass);
							_hiddenClass = 'mfp-'+_hiddenClass;
						}
						// replace target inline element with placeholder
						_lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
					}

					mfp.updateStatus('ready');
				} else {
					mfp.updateStatus('error', inlineSt.tNotFound);
					el = $('<div>');
				}

				item.inlineElement = el;
				return el;
			}

			mfp.updateStatus('ready');
			mfp._parseMarkup(template, {}, item);
			return template;
		}
	}
});

/*>>inline*/

/*>>ajax*/
var AJAX_NS = 'ajax',
	_ajaxCur,
	_removeAjaxCursor = function() {
		if(_ajaxCur) {
			$(document.body).removeClass(_ajaxCur);
		}
	},
	_destroyAjaxRequest = function() {
		_removeAjaxCursor();
		if(mfp.req) {
			mfp.req.abort();
		}
	};

$.magnificPopup.registerModule(AJAX_NS, {

	options: {
		settings: null,
		cursor: 'mfp-ajax-cur',
		tError: '<a href="%url%">The content</a> could not be loaded.'
	},

	proto: {
		initAjax: function() {
			mfp.types.push(AJAX_NS);
			_ajaxCur = mfp.st.ajax.cursor;

			_mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
			_mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
		},
		getAjax: function(item) {

			if(_ajaxCur) {
				$(document.body).addClass(_ajaxCur);
			}

			mfp.updateStatus('loading');

			var opts = $.extend({
				url: item.src,
				success: function(data, textStatus, jqXHR) {
					var temp = {
						data:data,
						xhr:jqXHR
					};

					_mfpTrigger('ParseAjax', temp);

					mfp.appendContent( $(temp.data), AJAX_NS );

					item.finished = true;

					_removeAjaxCursor();

					mfp._setFocus();

					setTimeout(function() {
						mfp.wrap.addClass(READY_CLASS);
					}, 16);

					mfp.updateStatus('ready');

					_mfpTrigger('AjaxContentAdded');
				},
				error: function() {
					_removeAjaxCursor();
					item.finished = item.loadError = true;
					mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
				}
			}, mfp.st.ajax.settings);

			mfp.req = $.ajax(opts);

			return '';
		}
	}
});

/*>>ajax*/

/*>>image*/
var _imgInterval,
	_getTitle = function(item) {
		if(item.data && item.data.title !== undefined)
			return item.data.title;

		var src = mfp.st.image.titleSrc;

		if(src) {
			if($.isFunction(src)) {
				return src.call(mfp, item);
			} else if(item.el) {
				return item.el.attr(src) || '';
			}
		}
		return '';
	};

$.magnificPopup.registerModule('image', {

	options: {
		markup: '<div class="mfp-figure">'+
					'<div class="mfp-close"></div>'+
					'<figure>'+
						'<div class="mfp-img"></div>'+
						'<figcaption>'+
							'<div class="mfp-bottom-bar">'+
								'<div class="mfp-title"></div>'+
								'<div class="mfp-counter"></div>'+
							'</div>'+
						'</figcaption>'+
					'</figure>'+
				'</div>',
		cursor: 'mfp-zoom-out-cur',
		titleSrc: 'title',
		verticalFit: true,
		tError: '<a href="%url%">The image</a> could not be loaded.'
	},

	proto: {
		initImage: function() {
			var imgSt = mfp.st.image,
				ns = '.image';

			mfp.types.push('image');

			_mfpOn(OPEN_EVENT+ns, function() {
				if(mfp.currItem.type === 'image' && imgSt.cursor) {
					$(document.body).addClass(imgSt.cursor);
				}
			});

			_mfpOn(CLOSE_EVENT+ns, function() {
				if(imgSt.cursor) {
					$(document.body).removeClass(imgSt.cursor);
				}
				_window.off('resize' + EVENT_NS);
			});

			_mfpOn('Resize'+ns, mfp.resizeImage);
			if(mfp.isLowIE) {
				_mfpOn('AfterChange', mfp.resizeImage);
			}
		},
		resizeImage: function() {
			var item = mfp.currItem;
			if(!item || !item.img) return;

			if(mfp.st.image.verticalFit) {
				var decr = 0;
				// fix box-sizing in ie7/8
				if(mfp.isLowIE) {
					decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
				}
				item.img.css('max-height', mfp.wH-decr);
			}
		},
		_onImageHasSize: function(item) {
			if(item.img) {

				item.hasSize = true;

				if(_imgInterval) {
					clearInterval(_imgInterval);
				}

				item.isCheckingImgSize = false;

				_mfpTrigger('ImageHasSize', item);

				if(item.imgHidden) {
					if(mfp.content)
						mfp.content.removeClass('mfp-loading');

					item.imgHidden = false;
				}

			}
		},

		/**
		 * Function that loops until the image has size to display elements that rely on it asap
		 */
		findImageSize: function(item) {

			var counter = 0,
				img = item.img[0],
				mfpSetInterval = function(delay) {

					if(_imgInterval) {
						clearInterval(_imgInterval);
					}
					// decelerating interval that checks for size of an image
					_imgInterval = setInterval(function() {
						if(img.naturalWidth > 0) {
							mfp._onImageHasSize(item);
							return;
						}

						if(counter > 200) {
							clearInterval(_imgInterval);
						}

						counter++;
						if(counter === 3) {
							mfpSetInterval(10);
						} else if(counter === 40) {
							mfpSetInterval(50);
						} else if(counter === 100) {
							mfpSetInterval(500);
						}
					}, delay);
				};

			mfpSetInterval(1);
		},

		getImage: function(item, template) {

			var guard = 0,

				// image load complete handler
				onLoadComplete = function() {
					if(item) {
						if (item.img[0].complete) {
							item.img.off('.mfploader');

							if(item === mfp.currItem){
								mfp._onImageHasSize(item);

								mfp.updateStatus('ready');
							}

							item.hasSize = true;
							item.loaded = true;

							_mfpTrigger('ImageLoadComplete');

						}
						else {
							// if image complete check fails 200 times (20 sec), we assume that there was an error.
							guard++;
							if(guard < 200) {
								setTimeout(onLoadComplete,100);
							} else {
								onLoadError();
							}
						}
					}
				},

				// image error handler
				onLoadError = function() {
					if(item) {
						item.img.off('.mfploader');
						if(item === mfp.currItem){
							mfp._onImageHasSize(item);
							mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
						}

						item.hasSize = true;
						item.loaded = true;
						item.loadError = true;
					}
				},
				imgSt = mfp.st.image;


			var el = template.find('.mfp-img');
			if(el.length) {
				var img = document.createElement('img');
				img.className = 'mfp-img';
				if(item.el && item.el.find('img').length) {
					img.alt = item.el.find('img').attr('alt');
				}
				item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
				img.src = item.src;

				// without clone() "error" event is not firing when IMG is replaced by new IMG
				// TODO: find a way to avoid such cloning
				if(el.is('img')) {
					item.img = item.img.clone();
				}

				img = item.img[0];
				if(img.naturalWidth > 0) {
					item.hasSize = true;
				} else if(!img.width) {
					item.hasSize = false;
				}
			}

			mfp._parseMarkup(template, {
				title: _getTitle(item),
				img_replaceWith: item.img
			}, item);

			mfp.resizeImage();

			if(item.hasSize) {
				if(_imgInterval) clearInterval(_imgInterval);

				if(item.loadError) {
					template.addClass('mfp-loading');
					mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
				} else {
					template.removeClass('mfp-loading');
					mfp.updateStatus('ready');
				}
				return template;
			}

			mfp.updateStatus('loading');
			item.loading = true;

			if(!item.hasSize) {
				item.imgHidden = true;
				template.addClass('mfp-loading');
				mfp.findImageSize(item);
			}

			return template;
		}
	}
});

/*>>image*/

/*>>zoom*/
var hasMozTransform,
	getHasMozTransform = function() {
		if(hasMozTransform === undefined) {
			hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
		}
		return hasMozTransform;
	};

$.magnificPopup.registerModule('zoom', {

	options: {
		enabled: false,
		easing: 'ease-in-out',
		duration: 300,
		opener: function(element) {
			return element.is('img') ? element : element.find('img');
		}
	},

	proto: {

		initZoom: function() {
			var zoomSt = mfp.st.zoom,
				ns = '.zoom',
				image;

			if(!zoomSt.enabled || !mfp.supportsTransition) {
				return;
			}

			var duration = zoomSt.duration,
				getElToAnimate = function(image) {
					var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
						transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
						cssObj = {
							position: 'fixed',
							zIndex: 9999,
							left: 0,
							top: 0,
							'-webkit-backface-visibility': 'hidden'
						},
						t = 'transition';

					cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;

					newImg.css(cssObj);
					return newImg;
				},
				showMainContent = function() {
					mfp.content.css('visibility', 'visible');
				},
				openTimeout,
				animatedImg;

			_mfpOn('BuildControls'+ns, function() {
				if(mfp._allowZoom()) {

					clearTimeout(openTimeout);
					mfp.content.css('visibility', 'hidden');

					// Basically, all code below does is clones existing image, puts in on top of the current one and animated it

					image = mfp._getItemToZoom();

					if(!image) {
						showMainContent();
						return;
					}

					animatedImg = getElToAnimate(image);

					animatedImg.css( mfp._getOffset() );

					mfp.wrap.append(animatedImg);

					openTimeout = setTimeout(function() {
						animatedImg.css( mfp._getOffset( true ) );
						openTimeout = setTimeout(function() {

							showMainContent();

							setTimeout(function() {
								animatedImg.remove();
								image = animatedImg = null;
								_mfpTrigger('ZoomAnimationEnded');
							}, 16); // avoid blink when switching images

						}, duration); // this timeout equals animation duration

					}, 16); // by adding this timeout we avoid short glitch at the beginning of animation


					// Lots of timeouts...
				}
			});
			_mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
				if(mfp._allowZoom()) {

					clearTimeout(openTimeout);

					mfp.st.removalDelay = duration;

					if(!image) {
						image = mfp._getItemToZoom();
						if(!image) {
							return;
						}
						animatedImg = getElToAnimate(image);
					}

					animatedImg.css( mfp._getOffset(true) );
					mfp.wrap.append(animatedImg);
					mfp.content.css('visibility', 'hidden');

					setTimeout(function() {
						animatedImg.css( mfp._getOffset() );
					}, 16);
				}

			});

			_mfpOn(CLOSE_EVENT+ns, function() {
				if(mfp._allowZoom()) {
					showMainContent();
					if(animatedImg) {
						animatedImg.remove();
					}
					image = null;
				}
			});
		},

		_allowZoom: function() {
			return mfp.currItem.type === 'image';
		},

		_getItemToZoom: function() {
			if(mfp.currItem.hasSize) {
				return mfp.currItem.img;
			} else {
				return false;
			}
		},

		// Get element postion relative to viewport
		_getOffset: function(isLarge) {
			var el;
			if(isLarge) {
				el = mfp.currItem.img;
			} else {
				el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
			}

			var offset = el.offset();
			var paddingTop = parseInt(el.css('padding-top'),10);
			var paddingBottom = parseInt(el.css('padding-bottom'),10);
			offset.top -= ( $(window).scrollTop() - paddingTop );


			/*

			Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.

			 */
			var obj = {
				width: el.width(),
				// fix Zepto height+padding issue
				height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
			};

			// I hate to do this, but there is no another option
			if( getHasMozTransform() ) {
				obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
			} else {
				obj.left = offset.left;
				obj.top = offset.top;
			}
			return obj;
		}

	}
});



/*>>zoom*/

/*>>iframe*/

var IFRAME_NS = 'iframe',
	_emptyPage = '//about:blank',

	_fixIframeBugs = function(isShowing) {
		if(mfp.currTemplate[IFRAME_NS]) {
			var el = mfp.currTemplate[IFRAME_NS].find('iframe');
			if(el.length) {
				// reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
				if(!isShowing) {
					el[0].src = _emptyPage;
				}

				// IE8 black screen bug fix
				if(mfp.isIE8) {
					el.css('display', isShowing ? 'block' : 'none');
				}
			}
		}
	};

$.magnificPopup.registerModule(IFRAME_NS, {

	options: {
		markup: '<div class="mfp-iframe-scaler">'+
					'<div class="mfp-close"></div>'+
					'<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
				'</div>',

		srcAction: 'iframe_src',

		// we don't care and support only one default type of URL by default
		patterns: {
			youtube: {
				index: 'youtube.com',
				id: 'v=',
				src: '//www.youtube.com/embed/%id%?autoplay=1'
			},
			vimeo: {
				index: 'vimeo.com/',
				id: '/',
				src: '//player.vimeo.com/video/%id%?autoplay=1'
			},
			gmaps: {
				index: '//maps.google.',
				src: '%id%&output=embed'
			}
		}
	},

	proto: {
		initIframe: function() {
			mfp.types.push(IFRAME_NS);

			_mfpOn('BeforeChange', function(e, prevType, newType) {
				if(prevType !== newType) {
					if(prevType === IFRAME_NS) {
						_fixIframeBugs(); // iframe if removed
					} else if(newType === IFRAME_NS) {
						_fixIframeBugs(true); // iframe is showing
					}
				}// else {
					// iframe source is switched, don't do anything
				//}
			});

			_mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
				_fixIframeBugs();
			});
		},

		getIframe: function(item, template) {
			var embedSrc = item.src;
			var iframeSt = mfp.st.iframe;

			$.each(iframeSt.patterns, function() {
				if(embedSrc.indexOf( this.index ) > -1) {
					if(this.id) {
						if(typeof this.id === 'string') {
							embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
						} else {
							embedSrc = this.id.call( this, embedSrc );
						}
					}
					embedSrc = this.src.replace('%id%', embedSrc );
					return false; // break;
				}
			});

			var dataObj = {};
			if(iframeSt.srcAction) {
				dataObj[iframeSt.srcAction] = embedSrc;
			}
			mfp._parseMarkup(template, dataObj, item);

			mfp.updateStatus('ready');

			return template;
		}
	}
});



/*>>iframe*/

/*>>gallery*/
/**
 * Get looped index depending on number of slides
 */
var _getLoopedId = function(index) {
		var numSlides = mfp.items.length;
		if(index > numSlides - 1) {
			return index - numSlides;
		} else  if(index < 0) {
			return numSlides + index;
		}
		return index;
	},
	_replaceCurrTotal = function(text, curr, total) {
		return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
	};

$.magnificPopup.registerModule('gallery', {

	options: {
		enabled: false,
		arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
		preload: [0,2],
		navigateByImgClick: true,
		arrows: true,

		tPrev: 'Previous (Left arrow key)',
		tNext: 'Next (Right arrow key)',
		tCounter: '%curr% of %total%'
	},

	proto: {
		initGallery: function() {

			var gSt = mfp.st.gallery,
				ns = '.mfp-gallery';

			mfp.direction = true; // true - next, false - prev

			if(!gSt || !gSt.enabled ) return false;

			_wrapClasses += ' mfp-gallery';

			_mfpOn(OPEN_EVENT+ns, function() {

				if(gSt.navigateByImgClick) {
					mfp.wrap.on('click'+ns, '.mfp-img', function() {
						if(mfp.items.length > 1) {
							mfp.next();
							return false;
						}
					});
				}

				_document.on('keydown'+ns, function(e) {
					if (e.keyCode === 37) {
						mfp.prev();
					} else if (e.keyCode === 39) {
						mfp.next();
					}
				});
			});

			_mfpOn('UpdateStatus'+ns, function(e, data) {
				if(data.text) {
					data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
				}
			});

			_mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
				var l = mfp.items.length;
				values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
			});

			_mfpOn('BuildControls' + ns, function() {
				/*if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {*/
					var markup = gSt.arrowMarkup,
						arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
						arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);

					arrowLeft.click(function() {
						mfp.prev();
					});
					arrowRight.click(function() {
						mfp.next();
					});

					mfp.container.append(arrowLeft.add(arrowRight));
				/*}*/
			});

			_mfpOn(CHANGE_EVENT+ns, function() {
				if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);

				mfp._preloadTimeout = setTimeout(function() {
					mfp.preloadNearbyImages();
					mfp._preloadTimeout = null;
				}, 16);
			});


			_mfpOn(CLOSE_EVENT+ns, function() {
				_document.off(ns);
				mfp.wrap.off('click'+ns);
				mfp.arrowRight = mfp.arrowLeft = null;
			});

		},
		next: function() {
			mfp.direction = true;
			mfp.index = _getLoopedId(mfp.index + 1);
			mfp.updateItemHTML();
		},
		prev: function() {
			mfp.direction = false;
			mfp.index = _getLoopedId(mfp.index - 1);
			mfp.updateItemHTML();
		},
		goTo: function(newIndex) {
			mfp.direction = (newIndex >= mfp.index);
			mfp.index = newIndex;
			mfp.updateItemHTML();
		},
		preloadNearbyImages: function() {
			var p = mfp.st.gallery.preload,
				preloadBefore = Math.min(p[0], mfp.items.length),
				preloadAfter = Math.min(p[1], mfp.items.length),
				i;

			for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
				mfp._preloadItem(mfp.index+i);
			}
			for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
				mfp._preloadItem(mfp.index-i);
			}
		},
		_preloadItem: function(index) {
			index = _getLoopedId(index);

			if(mfp.items[index].preloaded) {
				return;
			}

			var item = mfp.items[index];
			if(!item.parsed) {
				item = mfp.parseEl( index );
			}

			_mfpTrigger('LazyLoad', item);

			if(item.type === 'image') {
				item.img = $('<img class="mfp-img" />').on('load.mfploader', function() {
					item.hasSize = true;
				}).on('error.mfploader', function() {
					item.hasSize = true;
					item.loadError = true;
					_mfpTrigger('LazyLoadError', item);
				}).attr('src', item.src);
			}


			item.preloaded = true;
		}
	}
});

/*>>gallery*/

/*>>retina*/

var RETINA_NS = 'retina';

$.magnificPopup.registerModule(RETINA_NS, {
	options: {
		replaceSrc: function(item) {
			return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
		},
		ratio: 1 // Function or number.  Set to 1 to disable.
	},
	proto: {
		initRetina: function() {
			if(window.devicePixelRatio > 1) {

				var st = mfp.st.retina,
					ratio = st.ratio;

				ratio = !isNaN(ratio) ? ratio : ratio();

				if(ratio > 1) {
					_mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
						item.img.css({
							'max-width': item.img[0].naturalWidth / ratio,
							'width': '100%'
						});
					});
					_mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
						item.src = st.replaceSrc(item, ratio);
					});
				}
			}

		}
	}
});

/*>>retina*/
 _checkInstance(); }));
/*! jQuery :isImageFile filter - v0.0.6 - 2016-07-12
*
* Copyright (c) 2013-2016 Jonathan Heilmann; */
!function(e){e.extend(e.expr[":"],{isImageFile:function(r){var a=e(r);if(a.hasClass("excludeFromMagnificpopup"))return!1;var n=a.attr("href");if(null==n)return!1;n=n.toLowerCase();var t=n.substr(n.lastIndexOf(".")+1);switch(t){case"jpeg":case"jpg":case"png":case"gif":return!0;default:return!1}}})}(window.jQuery||window.Zepto);
jQuery(document).ready(function(){

	// Change back to the old behavior of auto-complete
	// http://jqueryui.com/docs/Upgrade_Guide_184#Autocomplete
	jQuery.ui.autocomplete.prototype._renderItem = function( ul, item ) {
			return jQuery( "<li></li>" )
				.data( "item.autocomplete", item )
				.append( "<a>" + item.label + "</a>" )
				.appendTo( ul );
	};

	var req = false;

	jQuery('.tx-solr-q').autocomplete({
		source: function(request, response) {
			if (req) {
				req.abort();
				response();
			}

			req = jQuery.ajax({
				url: tx_solr_suggestUrl,
				dataType: 'json',
				data: {
					termLowercase: request.term.toLowerCase(),
					termOriginal: request.term,
					L: jQuery('div.tx-solr input[name="L"]').val()
				},
				success: function(data) {
					req = false;

					var rs     = [],
						output = [];

					jQuery.each(data, function(term, termIndex) {
						var unformatted_label = term;
						output.push({
							label : unformatted_label.replace(new RegExp('(?![^&;]+;)(?!<[^<>]*)(' +
										jQuery.ui.autocomplete.escapeRegex(request.term) +
										')(?![^<>]*>)(?![^&;]+;)', 'gi'), '<strong>$1</strong>'),
							value : term
						});
					});

					response(output);
				}
			});
		},
		select: function(event, ui) {
			this.value = ui.item.value;
			jQuery(event.target).closest('form').submit();
		},
		delay: 0,
		minLength: 3
	});
});

/***************************************************************
*  Copyright notice
*
*  (c) 2007-2013 Stanislas Rolland <typo3(arobas)sjbr.ca>
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*  A copy is found in the textfile GPL.txt and important notices to the license
*  from the author is found in LICENSE.txt distributed with these scripts.
*
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/*
 * Javascript functions for TYPO3 extension freeCap CAPTCHA (sr_freecap)
 *
 */
(function () {
	SrFreecap = {

		/*
		 * Loads a new freeCap image
		 *
		 * @param string id: identifier used to uniiquely identify the image
		 * @param string noImageMessage: message to be displayed if the image element cannot be found
		 * @return void
		 */
		newImage: function (id, noImageMessage) {
			if (document.getElementById) {
					// extract image name from image source (i.e. cut off ?randomness)
				var theImage = document.getElementById('tx_srfreecap_captcha_image_' + id);
				var parts = theImage.src.split('&set');
				theImage.src = parts[0] + '&set=' + Math.round(Math.random()*100000);
			} else {
				alert(noImageMessage ? noImageMessage : 'Sorry, we cannot autoreload a new image. Submit the form and a new image will be loaded.');
			}
		},
		
		/*
		 * Plays the audio captcha
		 *
		 * @param string id: identifier used to uniquely identify the wav file
		 * @param string wavUrl: url of the wave file generating script
		 * @param string noPlayMessage: message to be displayed if the audio file cannot be rendered
		 * @return void
		 *
		 * Note: In order for this to work with IE8, [SYS][cookieDomain] must be set using the TYPO3 Install Tool
		 */
		playCaptcha: function (id, wavUrl, noPlayMessage) {
			if (document.getElementById) {
				var theAudio = document.getElementById('tx_srfreecap_captcha_playAudio_' + id);
				var url = wavUrl + '&set=' + Math.round(Math.random()*100000);
				while (theAudio.firstChild) {
					theAudio.removeChild(theAudio.firstChild);
				}
				var audioElement = document.createElement('audio');
				if (audioElement.canPlayType) {
					// HTML 5 audio
					if (audioElement.canPlayType('audio/mpeg') === 'maybe' || audioElement.canPlayType('audio/mpeg') === 'probably') {
						url = url.replace('formatName=wav', 'formatName=mp3');
					}
					audioElement.setAttribute('src', url);
					audioElement.setAttribute('id', 'tx_srfreecap_captcha_playAudio_audio' + id);
					theAudio.appendChild(audioElement);
					audioElement.load();
					audioElement.play();
				} else {
					url = url.replace('formatName=wav', 'formatName=mp3');
					// In IE, use the default player for audio/mpeg, probably Windows Media Player
					var objectElement = document.createElement('object');
					objectElement.setAttribute('id', 'tx_srfreecap_captcha_playAudio_object' + id);
					objectElement.setAttribute('type', 'audio/mpeg');
                                        if (document.all && !document.addEventListener) {
                                        	if (!document.querySelector) {
							// IE7 only
							objectElement.setAttribute('filename', url);
                                                } else {
                                                	// IE8 only
                                                	objectElement.setAttribute('data', url);
                                                }
                                        }
					theAudio.appendChild(objectElement);
					objectElement.style.height = 0;
					objectElement.style.width = 0;
					var parameters = {
						autoplay: 'true',
						autostart: 'true',
						controller: 'false',
						showcontrols: 'false'
					};
					for (var parameter in parameters) {
						if (parameters.hasOwnProperty(parameter)) {
							var paramElement = document.createElement('param');
							paramElement.setAttribute('name', parameter);
							paramElement.setAttribute('value', parameters[parameter]);
							paramElement = objectElement.appendChild(paramElement);
						}
					}
					objectElement.setAttribute('altHtml', '<a style="display:inline-block; margin-left: 5px; width: 200px;" href="' + url + '">' + (noPlayMessage ? noPlayMessage : 'Sorry, we cannot play the word of the image.') + '</a>');
				}
			} else {
				alert(noPlayMessage ? noPlayMessage : 'Sorry, we cannot play the word of the image.');
			}
		}
	}
})();

// JavaScript Document

var avatar = {
    labels: [],
    fachbereiche: [],
    maxTop: 485,
    initialTop: 485,
    listHeight: 280,
    init: function () {

    	var target = document.getElementById('avatar-body');
		var div = "";
		var box = document.getElementById('avatar-select-box');
		var boxHeaders = document.getElementsByClassName('avatar-select-box-header');
		var dx = (target.clientWidth - box.clientWidth) / 2;
		
		// INITIAL VALUES //
		this.maxTop = target.offsetTop + target.offsetHeight - 310;
		this.initialTop = target.offsetTop + target.offsetHeight - boxHeaders[0].offsetHeight;
		this.listHeight = $(".avatar-select-box-list").height();

		$("#avatar-select-box").css("left", dx + "px");
		
		dx = (target.clientWidth - 320) / 2;
		
		// LABEL (KOERPERREGIONEN) EINFÜGEN //
		for (var i = 0; i < this.labels.length; i++)
		{
			var item = this.labels[i];
			var labelText = item[0];
			var labelLeft = item[1] + dx;
			var labelTop = item[2];
			var labelType = item[3];
			
			// LABEL LINKS (PFEIL RECHTS) //
			if (labelType == "links")
			{
				div += '<div class="avatar-left-label" style="left:' + labelLeft + 'px; top:' + labelTop + 'px;" id="avatar-label' + i + '"><a href="javascript:avatar.moveTo(' + "'avatar-label" + i + "'" + ');">' + labelText + '</a></div>';
			}
			// LABEL RECHTS (PFEIL LINKS) //
			else if (labelType == "rechts")
			{
				div += '<div class="avatar-right-label" style="left:' + labelLeft + 'px; top:' + labelTop + 'px;" id="avatar-label' + i + '"><a href="javascript:avatar.moveTo(' + "'avatar-label" + i + "'" + ');">' + labelText + '</a></div>';
			}
			// OHNE PFEIL //
			else
			{
				div += '<div class="avatar-label" style="left:' + labelLeft + 'px; top:' + labelTop + 'px;" id="avatar-label' + i + '"><a href="javascript:avatar.moveTo(' + "'avatar-label" + i + "'" + ');">' + labelText + '</a></div>';
			}
		}
		target.innerHTML = div;

		// CLOSE LIST //
		this.hide();
    },
    show: function (top) {
    	// SHOW LIST AND CLOSE BUTTON //
    	$(".avatar-select-box-list").css("display", "block");
		$(".avatar-select-box-header img.closebutton").css("display", "block");
		$(".avatar-select-box-header img.openbutton").css("display", "none");
		// DEFAULT POINTER //
		$(".avatar-select-box-header p").css("cursor", "default");
		// UNBIND CLICK EVENT //
		$(".avatar-select-box-header p").unbind("click");
		// ANIMATION: TOP AND HEIGHT //
		$("#avatar-select-box").animate({top:top});
    	$(".avatar-select-box-list").animate({height:this.listHeight});
    },
    hide: function () {

    	if ($(".avatar-select-box-list").css("display") != "none")
    	{
    		// HIDE LIST AND CLOSE BUTTON //
    		$(".avatar-select-box-list").css("display", "none");
    		$(".avatar-select-box-header img.closebutton").css("display", "none");
    		$(".avatar-select-box-header img.openbutton").css("display", "block");
    		$(".avatar-select-box-list").css("height", "0px");
    		// SET TOP TOP INITAL VALUE //
    		$("#avatar-select-box").css("top", this.initialTop + "px");
    		// SHOW POINTER //
    		$(".avatar-select-box-header p").css("cursor", "pointer");
    		// BIND CLICK EVENT //
    		$(".avatar-select-box-header p").bind("click", function(e) {
    			avatar.show(avatar.maxTop);
    		});
    		$(".avatar-select-box-header img.openbutton").bind("click", function(e) {
    			avatar.show(avatar.maxTop);
    		});
    		// RESET ACCORDION - COLLAPSE ALL //
    		$(".panel-default").css("display", "block");
    		$(".panel-collapse").collapse('hide');
    		// REMOVE ALL TEXT DECORATIONS IN LABELS //
    		$(".avatar-right-label a").css('text-decoration','none');
			$(".avatar-left-label a").css('text-decoration','none');
			$(".avatar-label a").css('text-decoration','none');
    	}
    },
    onResize: function() {
    	var aBody = document.getElementById('avatar-body');
		var box = document.getElementById('avatar-select-box');
		var dx = (aBody.clientWidth - box.clientWidth) / 2;

		$("#avatar-select-box").css("left", dx + "px");
		
		dx = (aBody.clientWidth - 320) / 2;
		
    	for (var i = 0; i < this.labels.length; i++)
		{
			var item = this.labels[i];
			var labelLeft = item[1] + dx;

			$("#avatar-label" + i).css("left", labelLeft + "px");
		}
    },
    moveTo: function (labelId) {
    	var label = document.getElementById(labelId);
		var box = document.getElementById('avatar-select-box');
		var bodyDiv = document.getElementById('avatar-body');
		var top = label.style.top;
		var selKoerperRegion = label.firstChild.innerHTML;
		var accordion = document.getElementById('avatar-accordion');
		var panelDefaults = accordion.getElementsByClassName('panel-default');

		// REMOVE ALL TEXT DECORATIONS IN LABELS //
		$(".avatar-right-label a").css('text-decoration','none');
		$(".avatar-left-label a").css('text-decoration','none');
		$(".avatar-label a").css('text-decoration','none');

		var n = 0;
		
		// FACHBEREICHE NACH AUSGEWAEHLTER KOERPERREGION DURCHSUCHEN //
		for (var i = 0; i < this.fachbereiche.length; i++)
		{
			var fachbereich = this.fachbereiche[i][0];
			var standorte = this.fachbereiche[i][1];
			var koerperRegionen = this.fachbereiche[i][2];
			var isRelated = false;
			
			for (var j = 0; j < koerperRegionen.length; j++)
			{
				koerperRegion = koerperRegionen[j];
				if (koerperRegion == selKoerperRegion)
				{
					isRelated = true;
					n++;
					break;
				}
			}
			
			var listItemId = "#collapse" + i;
			var panelHeading = panelDefaults[i].childNodes[1].childNodes[1].childNodes[1];
			var listItem;
			
			// KOERPERREGION IN FACHBEREICH GEFUNDEN //
			if (isRelated)
			{
				$(panelDefaults[i]).css("display", "block");

				// AUSKLAPPEN //
				$(listItemId).each(function(){
					if ($(this).hasClass('in') === false) {
						$(this).collapse('show');
					}
				});
				
				// FARBIG MARKIEREN //
				//panelHeading.style.color = "#d0003f";
				
				for (var j = 0; j < standorte.length; j++)
				{
					standort = standorte[j];
					listItemId = "collapse" + i + "-" + j;
					listItem = document.getElementById(listItemId);
					//$(listItem.firstChild).css('color','#d0003f');
				}
				
			}
			// KEINE KOERPERREGION GEFUNDEN //
			else
			{
				$(panelDefaults[i]).css("display", "none");

				// ZUKLAPPEN //
				$(listItemId).each(function(){
					if ($(this).hasClass('in')) {
						$(this).collapse('hide');
					}
				});
				
				// TEXTFARBE ZURUECKSETZEN //
				//panelHeading.style.color = "#06395e";
				
				for (var j = 0; j < standorte.length; j++)
				{
					standort = standorte[j];
					listItemId = "collapse" + i + "-" + j;
					listItem = document.getElementById(listItemId);
					//$(listItem.firstChild).css('color','#d0003f');
				}
			}
		}

		if (n == 0) 
		{
			$("#avatar-no-item").css("display", "block");
		}
		else
		{
			$("#avatar-no-item").css("display", "none");
		}
		
		// ANIMATION - UNTER DAS AUSGEWAEHLTE LABEL BEWEGEN //
		top = top.substring(0, top.length - 2);
		top = 1*top + label.clientHeight + bodyDiv.offsetTop + 4;
		//if (top > this.maxTop) top = this.maxTop;
		
		// SHOW LIST //
		this.show(top);

		// SET TEXT DECORATION FOR SELECTED LABEL //
		$(label.firstChild).css('text-decoration','underline');
    }
}

/*!
 * Bootstrap v3.3.4 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.4",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.4",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.4",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.4",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.4",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27|32)/.test(b.which)&&!/input|textarea/i.test(b.target.tagName)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g&&27!=b.which||g&&27==b.which)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(b.target);38==b.which&&j>0&&j--,40==b.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.4",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in").attr("aria-hidden",!1),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a('<div class="modal-backdrop '+e+'" />').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.3.4",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport),this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-m<p.top?"bottom":"right"==h&&k.right+l>p.width?"left":"left"==h&&k.left-l<p.left?"right":h,f.removeClass(n).addClass(h)}var q=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(q,h);var r=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",r).emulateTransitionEnd(c.TRANSITION_DURATION):r()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.4",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.4",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.4",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){
var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.4",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a(document.body).height();"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
// Slidebars 0.10.3 (http://plugins.adchsm.me/slidebars/) written by Adam Smith (http://www.adchsm.me/) released under MIT License (http://plugins.adchsm.me/slidebars/license.txt)
!function(t){t.slidebars=function(s){function e(){!c.disableOver||"number"==typeof c.disableOver&&c.disableOver>=k?(w=!0,t("html").addClass("sb-init"),c.hideControlClasses&&T.removeClass("sb-hide"),i()):"number"==typeof c.disableOver&&c.disableOver<k&&(w=!1,t("html").removeClass("sb-init"),c.hideControlClasses&&T.addClass("sb-hide"),g.css("minHeight",""),(p||y)&&o())}function i(){g.css("minHeight","");var s=parseInt(g.css("height"),10),e=parseInt(t("html").css("height"),10);e>s&&g.css("minHeight",t("html").css("height")),m&&m.hasClass("sb-width-custom")&&m.css("width",m.attr("data-sb-width")),C&&C.hasClass("sb-width-custom")&&C.css("width",C.attr("data-sb-width")),m&&(m.hasClass("sb-style-push")||m.hasClass("sb-style-overlay"))&&m.css("marginLeft","-"+m.css("width")),C&&(C.hasClass("sb-style-push")||C.hasClass("sb-style-overlay"))&&C.css("marginRight","-"+C.css("width")),c.scrollLock&&t("html").addClass("sb-scroll-lock")}function n(t,s,e){function n(){a.removeAttr("style"),i()}var a;if(a=t.hasClass("sb-style-push")?g.add(t).add(O):t.hasClass("sb-style-overlay")?t:g.add(O),"translate"===x)"0px"===s?n():a.css("transform","translate( "+s+" )");else if("side"===x)"0px"===s?n():("-"===s[0]&&(s=s.substr(1)),a.css(e,"0px"),setTimeout(function(){a.css(e,s)},1));else if("jQuery"===x){"-"===s[0]&&(s=s.substr(1));var o={};o[e]=s,a.stop().animate(o,400)}}function a(s){function e(){w&&"left"===s&&m?(t("html").addClass("sb-active sb-active-left"),m.addClass("sb-active"),n(m,m.css("width"),"left"),setTimeout(function(){p=!0},400)):w&&"right"===s&&C&&(t("html").addClass("sb-active sb-active-right"),C.addClass("sb-active"),n(C,"-"+C.css("width"),"right"),setTimeout(function(){y=!0},400))}"left"===s&&m&&y||"right"===s&&C&&p?(o(),setTimeout(e,400)):e()}function o(s,e){(p||y)&&(p&&(n(m,"0px","left"),p=!1),y&&(n(C,"0px","right"),y=!1),setTimeout(function(){t("html").removeClass("sb-active sb-active-left sb-active-right"),m&&m.removeClass("sb-active"),C&&C.removeClass("sb-active"),"undefined"!=typeof s&&(void 0===typeof e&&(e="_self"),window.open(s,e))},400))}function l(t){"left"===t&&m&&(p?o():a("left")),"right"===t&&C&&(y?o():a("right"))}function r(t,s){t.stopPropagation(),t.preventDefault(),"touchend"===t.type&&s.off("click")}var c=t.extend({siteClose:!0,scrollLock:!1,disableOver:!1,hideControlClasses:!1},s),h=document.createElement("div").style,d=!1,f=!1;(""===h.MozTransition||""===h.WebkitTransition||""===h.OTransition||""===h.transition)&&(d=!0),(""===h.MozTransform||""===h.WebkitTransform||""===h.OTransform||""===h.transform)&&(f=!0);var u=navigator.userAgent,b=!1,v=!1;/Android/.test(u)?b=u.substr(u.indexOf("Android")+8,3):/(iPhone|iPod|iPad)/.test(u)&&(v=u.substr(u.indexOf("OS ")+3,3).replace("_",".")),(b&&3>b||v&&5>v)&&t("html").addClass("sb-static");var g=t("#sb-site, .sb-site-container");if(t(".sb-left").length)var m=t(".sb-left"),p=!1;if(t(".sb-right").length)var C=t(".sb-right"),y=!1;var w=!1,k=t(window).width(),T=t(".sb-toggle-left, .sb-toggle-right, .sb-open-left, .sb-open-right, .sb-close"),O=t(".sb-slide");e(),t(window).resize(function(){var s=t(window).width();k!==s&&(k=s,e(),p&&a("left"),y&&a("right"))});var x;d&&f?(x="translate",b&&4.4>b&&(x="side")):x="jQuery",this.slidebars={open:a,close:o,toggle:l,init:function(){return w},active:function(t){return"left"===t&&m?p:"right"===t&&C?y:void 0},destroy:function(t){"left"===t&&m&&(p&&o(),setTimeout(function(){m.remove(),m=!1},400)),"right"===t&&C&&(y&&o(),setTimeout(function(){C.remove(),C=!1},400))}},t(".sb-toggle-left").on("touchend click",function(s){r(s,t(this)),l("left")}),t(".sb-toggle-right").on("touchend click",function(s){r(s,t(this)),l("right")}),t(".sb-open-left").on("touchend click",function(s){r(s,t(this)),a("left")}),t(".sb-open-right").on("touchend click",function(s){r(s,t(this)),a("right")}),t(".sb-close").on("touchend click",function(s){if(t(this).is("a")||t(this).children().is("a")){if("click"===s.type){s.stopPropagation(),s.preventDefault();var e=t(this).is("a")?t(this):t(this).find("a"),i=e.attr("href"),n=e.attr("target")?e.attr("target"):"_self";o(i,n)}}else r(s,t(this)),o()}),g.on("touchend click",function(s){c.siteClose&&(p||y)&&(r(s,t(this)),o())})}}(jQuery);
/*!
 * classie v1.0.1
 * class helper functions
 * from bonzo https://github.com/ded/bonzo
 * MIT license
 * 
 * classie.has( elem, 'my-class' ) -> true/false
 * classie.add( elem, 'my-new-class' )
 * classie.remove( elem, 'my-unwanted-class' )
 * classie.toggle( elem, 'my-class' )
 */

/*jshint browser: true, strict: true, undef: true, unused: true */
/*global define: false, module: false */

( function( window ) {

'use strict';

// class helper functions from bonzo https://github.com/ded/bonzo

function classReg( className ) {
  return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
}

// classList support for class management
// altho to be fair, the api sucks because it won't accept multiple classes at once
var hasClass, addClass, removeClass;

if ( 'classList' in document.documentElement ) {
  hasClass = function( elem, c ) {
    return elem.classList.contains( c );
  };
  addClass = function( elem, c ) {
    elem.classList.add( c );
  };
  removeClass = function( elem, c ) {
    elem.classList.remove( c );
  };
}
else {
  hasClass = function( elem, c ) {
    return classReg( c ).test( elem.className );
  };
  addClass = function( elem, c ) {
    if ( !hasClass( elem, c ) ) {
      elem.className = elem.className + ' ' + c;
    }
  };
  removeClass = function( elem, c ) {
    elem.className = elem.className.replace( classReg( c ), ' ' );
  };
}

function toggleClass( elem, c ) {
  var fn = hasClass( elem, c ) ? removeClass : addClass;
  fn( elem, c );
}

var classie = {
  // full names
  hasClass: hasClass,
  addClass: addClass,
  removeClass: removeClass,
  toggleClass: toggleClass,
  // short names
  has: hasClass,
  add: addClass,
  remove: removeClass,
  toggle: toggleClass
};

// transport
if ( typeof define === 'function' && define.amd ) {
  // AMD
  define( classie );
} else if ( typeof exports === 'object' ) {
  // CommonJS
  module.exports = classie;
} else {
  // browser global
  window.classie = classie;
}

})( window );
/*
*	Browser Detection by http://www.javascripter.net/faq/browsern.htm
*	Modified by fga@adva_communication
*
*
*/

var nVer = navigator.appVersion;
var nAgt = navigator.userAgent;
var browserName  = navigator.appName;
var fullVersion  = ''+parseFloat(navigator.appVersion); 
var majorVersion = parseInt(navigator.appVersion,10);
var nameOffset,verOffset,ix;

// In Opera, the true version is after "Opera" or after "Version"
if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
 browserName = "Opera";
 fullVersion = nAgt.substring(verOffset+6);
 if ((verOffset=nAgt.indexOf("Version"))!=-1) 
   fullVersion = nAgt.substring(verOffset+8);
}
// In MSIE, the true version is after "MSIE" in userAgent
else if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
 browserName = "Microsoft Internet Explorer";
 fullVersion = nAgt.substring(verOffset+5);
}
// In Chrome, the true version is after "Chrome" 
else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
 browserName = "Chrome";
 fullVersion = nAgt.substring(verOffset+7);
}
// In Safari, the true version is after "Safari" or after "Version" 
else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
 browserName = "Safari";
 fullVersion = nAgt.substring(verOffset+7);
 if ((verOffset=nAgt.indexOf("Version"))!=-1) 
   fullVersion = nAgt.substring(verOffset+8);
}
// In Firefox, the true version is after "Firefox" 
else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
 browserName = "Firefox";
 fullVersion = nAgt.substring(verOffset+8);
}
// In most other browsers, "name/version" is at the end of userAgent 
else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < 
          (verOffset=nAgt.lastIndexOf('/')) ) 
{
 browserName = nAgt.substring(nameOffset,verOffset);
 fullVersion = nAgt.substring(verOffset+1);
 if (browserName.toLowerCase()==browserName.toUpperCase()) {
  browserName = navigator.appName;
 }
}
// trim the fullVersion string at semicolon/space if present
if ((ix=fullVersion.indexOf(";"))!=-1)
   fullVersion=fullVersion.substring(0,ix);
if ((ix=fullVersion.indexOf(" "))!=-1)
   fullVersion=fullVersion.substring(0,ix);

majorVersion = parseInt(''+fullVersion,10);
if (isNaN(majorVersion)) {
 fullVersion  = ''+parseFloat(navigator.appVersion); 
 majorVersion = parseInt(navigator.appVersion,10);
}

// add classname to html class via jQuery
$("html").addClass(browserName);
$("html").addClass(browserName+majorVersion);
/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */

/* OKplus - Was geht?! - Kategorieselektion */
$(function(){
  // bind change event to select
  $('#selectoptions').on('change', function () {
	var url = $(this).val(); // get selected value
	if (url) { // require a URL
	  window.location = url; // redirect
	}
	return false;
  });
});




/* Expand footer */
$(function () {
	
	var item = $('<span>Mehr anzeigen</span>');
	$('body.standort-ofge footer .ambulanzen nav ul').append(item);
	
	$('body.standort-ofge footer .ambulanzen nav ul span').click(function (){
	   $( "body.standort-ofge footer .ambulanzen nav ul span" ).addClass( "hide-me" );
	   $( "body.standort-ofge footer .ambulanzen nav ul li" ).addClass( "show-all" );
	   $('html, body').animate({scrollTop: $(document).height() }, 2500);
	});
	
});








/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */

$(function () {

	function handler1() {
	    $('html').addClass('high-contrast');
		Cookies.set('theme_state', 'high-contrast');
	    $(this).one("click", handler2);
	}
	
	function handler2() {
		$('html').removeClass('high-contrast');
		Cookies.remove('theme_state', 'high-contrast');
	    $(this).one("click", handler1);
	}
	
	
	
	
	/* Detect Cookie Dark Style */
	$(function () {
		
		if (Cookies.get('theme_state') == 'high-contrast'){
	        $('html').addClass('high-contrast');
	        $(".contrast-toggle").one("click", handler2);
	    }else{
		    $(".contrast-toggle").one("click", handler1);
	    }
	});
	
	
	
	


});



/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */




/* Wenn Hash in URL, öffne entsprechendes Tab */
$(function () {
	$(document).ready(function() {
		
	    if(window.location.hash.indexOf('tab') == 1) {

			var url = window.location.href;
			var activeTab = url.substring(url.indexOf("#") + 1);

			$(".tab-pane").removeClass("active in");
			$("#" + activeTab).addClass("active in");
			$('a[href="#'+ activeTab +'"]').tab('show')
			
		    return false;
			
		} else {
		  // Passt so
		}	
	});
});






/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */







/* Open Accordion from URL */
$(function () {
	$(document).ready(function() {
		if(window.location.hash) {

			$('.collapse').removeClass('in');
			$('.panel-heading a').addClass('collapsed');
			
		    var anchor = window.location.hash.replace("#panel-", "#collapse-");
		    $(anchor).collapse('show');	
		    
		    $('html, body').animate({
		        scrollTop: $(anchor).offset().top - 250
		    }, 2000);
		    
		    return false;
		    
	    } else {
		  // Keine Aktion, wenn kein Hash Wert
		}	
	});
});










/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */







/* Slidebar Navi */
$(function () {
    $(document).ready(function() {
      $.slidebars({
		disableOver: 767, // integer or false
		hideControlClasses: true, // true or false
		scrollLock: true // true or false
      });
    });
});











/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */












/* sidebar sharelink filled from header 
$(function () {
	var reco_link = document.getElementById("sharePageID").href;
	$("#seite-empfehlen-sidebar").html("<a href='"+reco_link+"' title='Seite weiterempfehlen'>Teilen</a>");
});
*/









/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */












/* maxlength in textarea */
$(function() {
    $("textarea[maxlength]").bind('input propertychange', function() {
        var maxLength = $(this).attr('maxlength');
        //I'm guessing JavaScript is treating a newline as one character rather than two so when I try to insert a "max length" string into the database I get an error.
        //Detect how many newlines are in the textarea, then be sure to count them twice as part of the length of the input.
        var newlines = ($(this).val().match(/\n/g) || []).length
        if ($(this).val().length + newlines > maxLength) {
            $(this).val($(this).val().substring(0, maxLength - newlines));
        }
    })
});









/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */












/* Toggle Between Functions, like in jQuery 1.7.2 */
$(function () {
    $.fn.clickToggle = function(func1, func2) {
        var funcs = [func1, func2];
        this.data('toggleclicked', 0);
        this.click(function() {
            var data = $(this).data();
            var tc = data.toggleclicked;
            $.proxy(funcs[tc], this)();
            data.toggleclicked = (tc + 1) % 2;
        });
        return this;
    };
});












/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */












/* calendar td_tooltips */
$(function () {
	$( "a.td-tooltip-trigger" ).hover(function() {
		  	var tooltip = $(this).prop("rel");
		  	var pos = $(this).position();  
		  	var height = $(this).height();
		  	var width = $(this).width();
		  	
		  	jQuery("#" + tooltip).css({  
				left: pos.left + 100 + 'px',
				top: pos.top + height + -100 + 'px' 
			});
				
			jQuery("#" + tooltip).show();
	  	}, 
	  	function() {
		  	
		  	var tooltip = $(this).prop("rel");
		  	jQuery("#" + tooltip).hide(); 
		  	
	  	}
	);
});












/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */


$(document).ready(function() {
	$('.okplus .news-layout-6 .flexsliderStop #flexslider a.flex-pause').click();
});

/* Flexslider wird gecalled */

$('.uid-5720 .flexslider').flexslider({                
		animation: "fade", slideshowSpeed: 3000, animationSpeed: 4000, initDelay: 0, controlNav: false, directionNav: false
});  

$('.uid-3670 .flexslider').flexslider({                
		animation: "fade", slideshowSpeed: 3000, animationSpeed: 4000, initDelay: 0, controlNav: false, directionNav: false
});

$('.okplus .news-layout-6 .flexsliderFirst .flexslider').flexslider({                
	    direction: "horizontal", slideshowSpeed: 3000,
        animation: "slide", animationSpeed: 800, animationLoop: false, useCSS: false,
        controlNav: true, directionNav: false, pausePlay: true, pauseOnHover: false,
        initDelay: 0, randomize: false, reverse: false,
        controlsContainer: $(".flexslider-ortenau-nav-inner2"),        
});  

$('.okplus .flexslider').flexslider({                
	    direction: "horizontal", slideshowSpeed: 5000,
        animation: "slide", animationSpeed: 800, animationLoop: false, useCSS: false,
        controlNav: true, directionNav: false, pausePlay: true, pauseOnHover: false,
        initDelay: 0, randomize: false, reverse: false,
        controlsContainer: $(".flexslider-ortenau-nav-inner2"),        
});  

$('#flexslider').flexslider({                
	    direction: "horizontal", slideshowSpeed: 8000,
        animation: "slide", animationSpeed: 600, animationLoop: true, useCSS: false,
        controlNav: true, directionNav: false, pausePlay: true, pauseOnHover: false,
        initDelay: 0, randomize: false, reverse: false,
        controlsContainer: $(".flexslider-ortenau-nav-inner"),        
});         

$('#flexslider-quotes').flexslider({
	    direction: "horizontal", slideshowSpeed: 8000,
        animation: "slide", animationSpeed: 600, animationLoop: true, useCSS: false,
        controlNav: false, directionNav: true, pausePlay: false, pauseOnHover: false,
        initDelay: 0, randomize: false, reverse: false,
        controlsContainer: $(".flexslider-ortenau-nav-inner-quotes"),        
});

$('#flexslider2').flexslider({
	    direction: "horizontal", slideshowSpeed: 8000,
        animation: "slide", animationSpeed: 600, animationLoop: true, useCSS: false,
        controlNav: true, directionNav: false, pausePlay: false, pauseOnHover: false,
        initDelay: 0, randomize: false, reverse: false,
		controlsContainer: $(".flexslider-ortenau-nav-inner-slider2"),        
});







/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */












/* Header wird kleiner gemacht */
$(function () {
    window.addEventListener('scroll', function(e){

		var distanceY = window.pageYOffset || document.documentElement.scrollTop,
    	        shrinkOn = 350,
        	    header = document.querySelector("header");

		/* for video on kika website */        	    
		if ($('.uid-3302').length) {
	        var distanceY = window.pageYOffset || document.documentElement.scrollTop,
    	        shrinkOn = 70,
        	    header = document.querySelector("header");
        }

		/* for video on karriere website */        	    
		if ($('.uid-3476').length) {
	        var distanceY = window.pageYOffset || document.documentElement.scrollTop,
    	        shrinkOn = 50,
        	    header = document.querySelector("header");
        }
        
        if (distanceY > shrinkOn) {
            classie.add(header,"smaller");
        } else {
            if (classie.has(header,"smaller")) {
                classie.remove(header,"smaller");
            }
        }
    });
});










/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */












/* Alphabet Navi */
$(function () {
	
    var _alphabets = $('.dynamic-list-alphabet > a');
    var _reset = $('.dynamic-list-alphabet > a.reset_button');
    var _contentRows = $('#dynamic-list-ortenau #dynamic-list-ortenau-inner .dynamic-list-default');

    _alphabets.click(function () {
	    
        var _letter = $(this), _text = $(this).text(), _count = 0;
        _alphabets.removeClass("active");
        _letter.addClass("active");

        _contentRows.hide();
        _contentRows.each(function (i) {
            var _cellText = $(this).children('.dynamic-list-desc').eq(0).text();
            if (RegExp('^' + _text).test(_cellText)) {
                _count += 1;
                $(this).fadeIn(400);
            }
        });
    });
    
    
    /* Bei click auf einen anchor-tag mit der klasse "reset_button" wird wieder alles angezeigt */
    _reset.click(function () {
	    
        var _letter = $(this), _text = $(this).text(), _count = 0;
        _alphabets.removeClass("active");
        _letter.addClass("active");

        _contentRows.show().fadeIn(400);
    });
});












/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */












/* iFrame Placeholder Youtube Videos */
$('img.youtube').click(function(){
    var video = '<iframe class="embed-responsive-item" src="'+ $(this).attr('data-video') +'" frameborder="0" allowfullscreen"></iframe>';
    $(this).replaceWith(video);
});

/* To Top Scrollr */
$('.jumpto').click(function() {
	window.scrollTo(0, 0);
});


/* Searchbar Toggle */
$('.searchbar-toggle').click(function() {
    $('#search').toggleClass('active');
    return false;
});

/* Headline Toggle */
if($( "body" ).hasClass("karriere-ortenau" )){
	if (window.matchMedia("(max-width: 767px)").matches) {
		$('#leftnaviHeadline').click(function() {
		    $('ul#leftnavi').toggleClass('active');
		    return false;
		});
	}
	$(window).resize(function() {
		if (window.matchMedia("(max-width: 767px)").matches) {
			$('#leftnaviHeadline').click(function() {
			    $('ul#leftnavi').toggleClass('active');
			    return false;
			});
		}
	});
	
}else{
	$('#leftnaviHeadline').click(function() {
	    $('ul#leftnavi').toggleClass('active');
	    return false;
	});
}


/* Calendar Toggle */
$(".dayitem .itemcat").click(function() {
    $(this).siblings(".item").toggle();
});












/* - - - - - - - - - NEW FUNCTION - - - - - - - - - - */

$(function () {
	
	var currFFZoom = 1;
    var currIEZoom = 100;

    $('.fontsize-toggle-large').on('click',function(){
        if ($("html").hasClass("Chrome") || $("html").hasClass("Explorer8")){
            var step = 2;
            currIEZoom += step;
            $('header').css('zoom', ' ' + currIEZoom + '%');
            $('main').css('zoom', ' ' + currIEZoom + '%');
            $('footer').css('zoom', ' ' + currIEZoom + '%');
        } else {
            var step = 0.02;
            currFFZoom += step; 
            $('header').css('transform','scale(' + currFFZoom + ')');
            $('header').css('transform-origin','top center');
            $('#main_column').css('transform','scale(' + currFFZoom + ')');
            $('#main_column').css('transform-origin','top center');
        }
        $('#flexslider').resize();
    });
    
    $('.fontsize-toggle-medium').on('click',function(){
        if ($("html").hasClass("Chrome") || $("html").hasClass("Explorer8")){
            var step = 0;
            currIEZoom = 100;
            $('header').css('zoom', ' ' + currIEZoom + '%');
            $('main').css('zoom', ' ' + currIEZoom + '%');
            $('footer').css('zoom', ' ' + currIEZoom + '%');
        } else {
	        var step = 0;
            currFFZoom = 1; 
            $('header').css('transform','scale(1)');
            $('header').css('transform-origin','top center');
            $('#main_column').css('transform','scale(' + currFFZoom + ')');
            $('#main_column').css('transform-origin','top center');
        }
        $('#flexslider').resize();
    });

    $('.fontsize-toggle-small').on('click',function(){
        if ($("html").hasClass("Chrome") || $("html").hasClass("Explorer8")){
            var step = 2;
            currIEZoom -= step;
            $('header').css('zoom', ' ' + currIEZoom + '%');
            $('main').css('zoom', ' ' + currIEZoom + '%');
            $('footer').css('zoom', ' ' + currIEZoom + '%');
        } else {
            var step = 0.02;
            currFFZoom -= step; 
            $('header').css('transform','scale(' + currFFZoom + ')');
			$('header').css('transform-origin','top center');                
            $('#main_column').css('transform','scale(' + currFFZoom + ')');
            $('#main_column').css('transform-origin','top center');
        }
        $('#flexslider').resize();
    });

});


/* Sidebar Funktion */

function openNav() {
    document.getElementById("contactSidebar").style.width = "300px";
}

function closeNav() {
    document.getElementById("contactSidebar").style.width = "40px";
}

/* Search Jquery Funktion (MKH) */

      $(function () { 
	    var listAccordion = $('.panel-group .panel.panel-default');
	    $('#btnCheck').click(function () { 
		    $( ".markerWort" ).contents().unwrap();
			var arrayA = 0;
			var txt = $('#txtword').val();
		    if (txt.length>1){    
				listAccordion.each(function( index ) {
				    var str = $(this).find('table.contenttable tbody').text();  
			        if (str.indexOf(txt) > -1) {  
				       //	$(this).html($(this).html().split(txt).join("<span class='markerWort'>"+txt+"</span>"));
				       	var currentTable = $(this).find('table.contenttable tbody');
					        currentTable.find('tr').each(function (key, val) {
					            $(this).find('td').each(function (key, val) {
						            if($(this).find('a').length >0){
							         	$(this).find('a').each(function (key, val) {
							                console.log($( this ).html());
							                $(this).html($(this).html().split(txt).join("<span class='markerWort'>"+txt+"</span>")); 	
							            });   
						            }else{
							           $(this).html($(this).html().split(txt).join("<span class='markerWort'>"+txt+"</span>"));
						            }
					            });
					        });
						$(this).slideDown( "slow" );
			            $('.search_jquery_form-error').fadeOut( "slow" );
			        }else if($(this).find('.accordion-toggle h4').text().indexOf(txt) > -1 ){
				        $(this).html($(this).html().split(txt).join("<span class='markerWort'>"+txt+"</span>")); 	
				        $(this).slideDown( "slow" ); 
				        $('.search_jquery_form-error').fadeOut( "slow" );
				    }else {  
				        $(this).slideUp( "slow" );
				        arrayA++; 
			        }
			       
				});
				console.log('arrayA: ' + arrayA);
				if(arrayA == listAccordion.length){
					$('.search_jquery_form-error').fadeIn( "slow" );
				}
			}
		});
		$('#btnReset').click(function () {  
			  $( ".markerWort" ).contents().unwrap();
			 $("#txtword").val('');
			 $('.search_jquery_form-error').slideUp( "slow" );
			$('.panel-group .panel.panel-default').slideDown( "slow" );
		});
		
	})  

$('#powermail_field_link').attr('readonly', 'readonly');




$('.uid-3661 #c25086 #collapse-0').addClass('in');

if($( "body" ).hasClass("karriere-ortenau" )){
	
	/* Add Parent Title to Sub Menu */
	if($('.karriere-ortenau #breadcrumb-wrap .breadcrumb li:nth-child(3)').length == 0){
		$('.currentParentTitle').html('');
		$('.karriere-ortenau #breadcrumb-wrap .breadcrumb li:nth-child(3)').clone().prependTo($('.currentParentTitle'));
	}else{
		if($('.karriere-ortenau #breadcrumb-wrap .breadcrumb li:nth-child(3)').text().trim() != 'Berufe und Karriere'){
			$('.currentParentTitle').html('');
			$('.karriere-ortenau #breadcrumb-wrap .breadcrumb li:nth-child(3)').clone().prependTo($('.currentParentTitle')).addClass('currentParentTitleLink');
		}
	}
}else{
	$('.tx-kp-vacancies .leading-block').remove();
}


$( ".modal__box" ).prepend($('.video-js-box').html());

$('.playVideo').click(function (){
	  $('.modal__box .video-js').get(0).play();
});
$('.modal__box .closeModal').click(function (){
	  $('.modal__box .video-js').get(0).pause();
});

/* Scroll to Top */
$(window).scroll(function() {

    if ($(this).scrollTop() >= 50) {        // If page is scrolled more than 50px
        $('#return-to-top').fadeIn(200);    // Fade in the arrow
    }
    
    else {
        $('#return-to-top').fadeOut(200);   // Else fade out the arrow
    }
});

$('#return-to-top').click(function() {      // When arrow is clicked

    $('body,html').animate({
        scrollTop : 0                       // Scroll to top of body
    }, 500);

});



/* Karriere Page (Downlpoad Test) --> Add By Mkh */ 
$(document).ready(function(){
	$('.karriere-ortenau.uid-3545 .tx-kp-vacancies .app_content-feldhtml input[type="file"]').attr('data-content', 'Datei auswählen');
    $('.karriere-ortenau.uid-3545 .tx-kp-vacancies .app_content-feldhtml input[type="file"]').change(function(e){
        var fileName = e.target.files[0].name;
        if(fileName.length > 25){
             fileName = fileName.substring(0,25) + '...';
        }
        $(this).addClass('fileIstHier');
        $(this).attr('data-content', 'Die Datei "' + fileName +   '" wurde ausgewählt. Bitte hochladen!');
    });
    
    
    
    $('.karriere-ortenau.uid-3544 .powermail_fieldwrap_type_file .powermail_field input[type="file"]').attr('data-content', 'Datei auswählen');
    $('.karriere-ortenau.uid-3544 .powermail_fieldwrap_type_file .powermail_field input[type="file"]').change(function(e){
        var fileName = e.target.files[0].name;
        if(fileName.length > 25){
             fileName = fileName.substring(0,25) + '...';
        }
        $(this).addClass('fileIstHier');
        $(this).attr('data-content', 'Die Datei "' + fileName +   '" wurde ausgewählt. Bitte hochladen!');
    });
	
	
	    
});







//# fsc: Linkziele abfangen und, wenn die Links vom Auftritt weg zeigen, einen alert 
//# mit Information zum Verlassen der SEITFE einblenden, damit der Benutzer den 
//# Seitenwechsel (das Verlassen der Seite) falls ungewünscht abbrechen kann. 

//# Es gibt vier Möglichkeiten: 

//# - der Link zeigt auf die eigene Domain: kein Abfangen, keine zusätzlichen Aktionen 
//#   - Im Normalfall kein vorangestelltes 'http(s)'

//# - der Link zeigt auf eine andere Domain des Verbunds: Hinweis, dass das geschehen wird, mit Option, abzubrechen  
//#   - prüfen ob einer der Domain-Namen im Array für Domainnamen enthalten ist, reagieren im 'ja'-Fall  

//# - der Link zeigt auf eine externe Domain: Hinweis, dass das geschehen wird, mit Option, abzubrechen  
//#   - prüfen ob einer der Domain-Namen im Array für Domainnamen enthalten ist, reagieren im 'nein'-Fall  

//# - der Link zeigt aud die eigene Domain, wurde aber im Backend absolut (mit 'https') eingegeben 

/*
	var internalDomainsArray = [
		'achern-oberkirch', 
		'acob', 
		//'kehl', 
		'lahr-ettenheim', 
		'laet', 
		//'offenburg-gengenbach', 
		'offenburg-kehl', 
		'ofke', 
		'wolfach',  
		'wolf', 
		
		//'kinderklinik', 
		//'kika',
		//'onkologisches-zentrum', 
		//'ozo',
		//'endoprothetik-zentrum', 
		//'endo',
		//'rehazentrum', 
		//'reha',
		//'karriere', 
		//'notfall', 
		//'bildungszentren', 
		//'biz',

		//'agenda-2030-ortenau-klinikum', 
		//'pflege-betreuung-ortenau', 
		//'mvz-ortenau', 
		//'mvz-offenburg', 
		//'ortenau-gesundheitswelt'
	];
*/


$(document).ready(function() {

	var internalDomainsArray = [
		'adva-beta', 
		'ortenau-klinikum',
		'acob.', 
		'achern-oberkirch.', 
		'laet.', 
		'lahr-ettenheim.', 
		'ofke.', 
		'offenburg-kehl.', 
		'wolf.',
		'wolfach.',  
		'karriere.',
		'notfall.',
		'agenda2030',
		'biz.',
		'bildungszentren.',		
		'reha.',
		'rehazentrum.',
		'kika.',		
		'kinderklinik.',
		'ozo.',		
		'onkologisches-zentrum.',
		'endo.',		
		'endoprothetik-zentrum.',
		'ogw.',
		'ortenau-gesundheitswelt',
		'okplus',
	];
	
	var internalDomainsArrayLength = internalDomainsArray.length;
	var currentHref = location.href;
	
	


	$('a').each(function() {
		
		var processedLinkHref = '';
		var processedLinkHasHref = 0;
		var processedLinkHrefHasProtocol = 0;
		var isInArray = 0;
		

		//# 'hasAttribute' is vanilla js, there is no 'hasAttr' native jQuery method 
		if($(this)[0].hasAttribute('href')) {
		
			processedLinkHref = $(this).attr('href');
			processedLinkHasHref = 1;
			//console.log('processedLinkHasHref: ' + processedLinkHasHref + ' (' + processedLinkHref + ')');	
	

			//# If the link includes a protocol 

			processedLinkHrefHasProtocol = (processedLinkHref.substring(0,4) === 'http') ? 1 : 0;

			if(processedLinkHrefHasProtocol === 1) {

				
				for(var i=0; i<internalDomainsArrayLength; i++) {

					//# If the link contains a local subdomain it is an 'internal' link
					if(processedLinkHref.indexOf(internalDomainsArray[i]) > -1) {

						isInArray = 1;
					}
				}
			}
		}				


		if(processedLinkHasHref === 1) {
			
			//console.log('-> processedLinkHasHref');
			//console.log('processedLinkHref: ' + processedLinkHref);
			
			if(processedLinkHrefHasProtocol === 1) {

				//console.log('-> processedLinkHrefHasProtocol');
				
				if(isInArray === 0) {

					//console.log('-> not in array');
					$(this).addClass('link-is-out-site-external');
					$(this).attr({'target': '_blank'});
					$(this).attr({'rel': 'noopener noreferrer'});
				}
			
				else {

					if ($(this).attr({'target': '_blank'})){
						//console.log('-> in array');
						
						$(this).addClass('link-is-out-site');
						
					} else {
					
						$(this).addClass('link-is-out-site');
						$(this).attr({'target': '_self'});
					
					
					}
				}
			}			
		}
						
		//console.log('- - - - - - - - - - ');	
	});


	var currentDomain = location.host;
	
	
	/*
	$('a.link-is-out-site-external').on('click', function(e) {
		
	    var answer = confirm("Sie verlassen den Auftritt" + currentDomain + " und wechseln zu einer anderen Website. \n");

    	if (!answer)
    		e.preventDefault();
	});


	$('a.link-is-out-site').on('click', function(e) {

	    var answer = confirm("Sie verlassen den Auftritt" + currentDomain + " \nund wechseln zu einer anderen Website des Ortenau Klinikums. ");

    	if (!answer)
    		e.preventDefault();
	});
	*/
	
	/* Modal Popup cancelled cause of usability aspects @mla */
	// Popup für link-is-out-site-Elemente - START -->
	/*
	$('.link-is-out-site').click(function(e) {
	//$(document).on('click', '.link-is-out-site', function (e) {
		e.preventDefault();
		var externalLink = this.getAttribute("href");
		
		// Resize window for IE <= 11
		var version = detectIE();
		if (version == false || version > 11) {
			$('.popup-modal-leave').attr("href", externalLink);
			
		} else {
			$('.popup-modal-leave').attr("href", "javascript:openWindow('" + externalLink + "');");
		}
		
	});
	*/
	
	/*$('.link-is-out-site').attr("data-mfp-src","#leave-dialog");
	$('.link-is-out-site').magnificPopup({
		type: 'inline',
		modal: true
	});*/
	
	/* Nach Klick auf das popup-modal-stay-Element wird Popup geschlossen */
	/*$('.popup-modal-stay').on('click', function (e) {
		e.preventDefault();
		$.magnificPopup.close();
	});*/
	/* Nach Klick auf das popup-modal-leave-Element wird Popup geschlossen und auf die andere Seite weitergeleitet */
	/*$('.popup-modal-leave').on('click', function (e) {
		$.magnificPopup.close();
	});*/
	// Popup für link-is-out-site-Elemente - ENDE -->
	
	
	// Popup für link-is-out-site-external-Elemente - START -->
	/*$('.link-is-out-site-external').click(function(e) {
	//$(document).on('click', '.link-is-out-site-external', function (e) {
		e.preventDefault();
		var externalLink = this.getAttribute("href");
		
		// Resize window for IE <= 11
		var version = detectIE();
		if (version == false || version > 11) {
			$('.popup-modal-leave-ext').attr("href", externalLink);
			
		} else {
			$('.popup-modal-leave-ext').attr("href", "javascript:openWindow('" + externalLink + "');");
		}
	});*/

	/*$('.link-is-out-site-external').attr("data-mfp-src","#leave-dialog-ext");
	$('.link-is-out-site-external').magnificPopup({
		type: 'inline',
		modal: true
	});*/
	
	/* Nach Klick auf das popup-modal-stay-Element wird Popup geschlossen */
	/*$('.popup-modal-stay-ext').on('click', function (e) {
		e.preventDefault();
		$.magnificPopup.close();
	});*/
	/* Nach Klick auf das popup-modal-leave-Element wird Popup geschlossen und auf die andere Seite weitergeleitet */
	/*$('.popup-modal-leave-ext').on('click', function (e) {
		$.magnificPopup.close();
	});*/
	// Popup für link-is-out-site-external-Elemente - ENDE -->
	
});



/**
 * detect IE
 * returns IE-Version oder false, wenn kein Internet Explorer verwendet wird
 */
function detectIE() {
  var ua = window.navigator.userAgent;

  // Aufbau der userAgent-Strings:

  // IE 10
  // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';
  
  // IE 11
  // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';
  
  // Edge 12 (Spartan)
  // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';
  
  // Edge 13
  // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';

  var msie = ua.indexOf('MSIE ');
  if (msie > 0) {
    // IE 10 or older => return version number
    return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
  }

  var trident = ua.indexOf('Trident/');
  if (trident > 0) {
    // IE 11 => return version number
    var rv = ua.indexOf('rv:');
    return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
  }

  var edge = ua.indexOf('Edge/');
  if (edge > 0) {
    // Edge (IE 12+) => return version number
    return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
  }

  // other browser
  return false;
}


/**
 * for IE <= 9
 * Neue Seite wird an die Größe des Monitors angepasst
 */
function openWindow(externalLink) {
	var w = screen.width;
	var h = screen.height;
	window.open(externalLink, "_blank", "left=0,top=0,width=" + w + ",height=" + h + "resizable scrollbars menubar=yes");
}


/* Carriere Page After Seach --> MKH */
$(document).ready(function() {
	if($('.joboffers-search').length > 0){
		if($( ".joboffers-search form select.selectSearchKarriere option:selected" ).val() > 0 || $(".joboffers-search form input.inputSearchKarriere").val() !=''){
			$('.accordion-container .akk-standard .panel-default').each(function (key, val) {
	            if($(this).find('.no_carriere').length > 0){
	            }else{
		            $(this).addClass('openAccordion');
		            $(this).find('.panel-collapse').addClass('in');
		            $(this).find('.panel-collapse').css('height','auto');
		            $(this).find('.panel-heading .akk-pic-indent').removeClass('collapsed');
	            }
	        });
		}
	}
});

$('.collapse').on('shown.bs.collapse', function(e) {
  var $card = $(this).closest('.panel');
  $('html,body').animate({
    scrollTop: $card.offset().top-150
  }, 800);
});

!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()}(0,function(){var o="details",i="summary";(function(){var e=document.createElement(o);if(!("open"in e))return!1;e.innerHTML="<"+i+">a</"+i+">b",document.body.appendChild(e);var t=e.offsetHeight;e.open=!0;var n=t!=e.offsetHeight;return document.body.removeChild(e),n})()||(document.documentElement.className+=" no-details",window.addEventListener("click",function(e){if("summary"===e.target.nodeName.toLowerCase()){var t=e.target.parentNode;if(!t)return;t.getAttribute("open")?(t.open=!1,t.removeAttribute("open")):(t.open=!0,t.setAttribute("open","open"))}}),function(e,t){if(document.getElementById(e))return;var n=document.createElement("style");n.id=e,n.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(n)}("details-polyfill-style","html.no-details "+o+":not([open]) > :not("+i+") { display: none; }\nhtml.no-details "+o+" > "+i+':before { content: "▶ mehr"; display: inline-block; font-size: 1em; width: 1.5em; white-space: nowrap; }\nhtml.no-details '+o+"[open] > "+i+':before { content: "▼ weniger"; }'))});

$(document).ready(function() {

	$('.image-popup-vertical-fit').magnificPopup({
		type: 'image',
		closeOnContentClick: true,
		mainClass: 'mfp-img-mobile',
		image: {
			verticalFit: true
		}
		
	});

	$('.image-popup-fit-width').magnificPopup({
		type: 'image',
		closeOnContentClick: true,
		image: {
			verticalFit: false
		}
	});

	$('.image-popup-no-margins').magnificPopup({
		type: 'image',
		closeOnContentClick: true,
		closeBtnInside: false,
		fixedContentPos: true,
		mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side
		image: {
			verticalFit: true
		},
		zoom: {
			enabled: true,
			duration: 300 // don't foget to change the duration also in CSS
		}
	});
	
	$('.simple-ajax-popup-align-top').magnificPopup({
		type: 'ajax',
		alignTop: true,
		overflowY: 'scroll' // as we know that popup content is tall we set scroll overflow by default to avoid jump
	});

	$('.simple-ajax-popup').magnificPopup({
		type: 'ajax'
	});

	
	// Feedbackform for DSGVO reasons by mla
	$('.powermail_checkbox_510').addClass('unchecked toggle');
	$('.powermail_checkbox_516').addClass('unchecked toggle');
	
	$('.powermail_checkbox_510').click(function(){
    	$('.powermail_checkbox_510.toggle').toggleClass('unchecked checked');
  	});

	$('.powermail_checkbox_516').click(function(){
    	$('.powermail_checkbox_516.toggle').toggleClass('unchecked checked');
  	});
	
	$('.powermail_fieldset_54 input.powermail_submit').click(function() {

		if ($('input.unchecked').length) {

			$.magnificPopup.open({
			items: {src: '#dsgvo-modal'},
			type: 'inline'}, 0)

			return false;

		} else {
			
		};

	});
	
});


$(document).ready(function(){

	$('.news-layout-6').each(function() {
  		var maxHeight = 475;
    	$('.col-md-4', this).each(function() {
        	if($(this).height() > maxHeight) {
				$(this).addClass("cropped");
				$(this).append( $("<a class='read-more bigLink'>Weiterlesen</a>") );
        	}
	        
		});

	});

	$(".col-md-4 .read-more").click(function(){
		$('.col-md-4').addClass("open");
		$(".col-md-4").animate({
    		height: "auto"
	  	}, 1500 ); // how long the animation should be

	});

});
/*!
 * jQuery Ticker Plugin v1.2.1
 * https://github.com/BenjaminRH/jquery-ticker
 *
 * Copyright 2014 Benjamin Harris
 * Released under the MIT license
 */
(function($) {

    // The ticker plugin
    $.fn.ticker = function(options) {
        // Extend our defaults with user-specified options
        var opts = $.extend({}, $.fn.ticker.defaults, options);

        // Handle each of the given containers
        return this.each(function () {
            // Setup the ticker elements
            var tickerContainer = $(this);                     // Outer-most ticker container
            var headlineContainer;                             // Inner headline container
            var headlineElements = tickerContainer.find('li'); // Original headline elements
            var headlines = [];                                // List of all the headlines
            var headlineTagMap = {};                           // Maps the indexes of the HTML tags in the headlines to the headline index
            var outerTimeoutId;                                // Stores the outer ticker timeout id for pauses
            var innerTimeoutId;                                // Stores the inner ticker timeout id for pauses
            var currentHeadline = 0;                           // The index of the current headline in the list of headlines
            var currentHeadlinePosition = 0;                   // The index of the current character in the current headline
            var firstOuterTick = true;                         // Whether this is the first time doing the outer tick
            var firstInnerTick = true;                         // Whether this is the first time doing the inner tick in this rendition of the outer one

            var allowedTags = ['a', 'b', 'strong', 'span', 'i', 'em', 'u'];

            if (opts.finishOnHover || opts.pauseOnHover) {
                // Setup monitoring hover state
                tickerContainer.removeClass('hover');
                tickerContainer.hover(function() {
                    $(this).toggleClass('hover');
                });
            }

            // Save all the headline text
            var h, l;
            headlineElements.each(function (index, element) {
                h = stripTags($(this).html(), allowedTags); // Strip all but the allowed tags
                l = locateTags(h); // Get the locations of the allowed tags
                h = stripTags(h); // Remove all of the HTML tags from the headline
                headlines.push(h); // Add the headline to the headlines list
                headlineTagMap[headlines.length - 1] = l; // Associate the tag map with the headline
            });

            // Randomize?
            if (opts.random) shuffleArray(headlines);

            // Now delete all the elements and add the headline container
            tickerContainer.find('ul').after('<div></div>').remove();
            headlineContainer = tickerContainer.find('div');

            // Function to actually do the outer ticker, and handle pausing
            function outerTick() {
                firstInnerTick = true;

                if (firstOuterTick) {
                    firstOuterTick = false;
                    innerTick();
                    return;
                }

                outerTimeoutId = setTimeout(function () {
                    if (opts.pauseOnHover && tickerContainer.hasClass('hover')) {
                        // User is hovering over the ticker and pause on hover is enabled
                        clearTimeout(innerTimeoutId);
                        outerTick();
                        return;
                    }

                    innerTick();
                }, opts.itemSpeed);
            }

            // Function to handle the ticking for individual headlines
            function innerTick() {
                if (firstInnerTick) {
                    firstInnerTick = false;
                    tick();
                    return;
                }

                if (currentHeadlinePosition > headlines[currentHeadline].length) {
                    advance();
                    return;
                }

                if (opts.finishOnHover && opts.pauseOnHover && tickerContainer.hasClass('hover') && currentHeadlinePosition <= headlines[currentHeadline].length) {
                    // Let's quickly complete the headline
                    // This is outside the timeout because we want to do this instantly without the pause

                    // Update the text
                    headlineContainer.html(getCurrentTick());
                    // Advance our position
                    currentHeadlinePosition += 1;

                    innerTick();
                    return;
                }
                else {
                    // Handle as normal
                    innerTimeoutId = setTimeout(function () {
                        if (opts.pauseOnHover && tickerContainer.hasClass('hover')) {
                            // User is hovering over the ticker and pause on hover is enabled
                            clearTimeout(innerTimeoutId);
                            innerTick();
                            return;
                        }

                        tick();
                        advance();
                    }, opts.cursorSpeed);
                }
            }

            function advance() {
                // Advance headline and reset character position, if it's at the end of the current headline
                if (currentHeadlinePosition > headlines[currentHeadline].length) { // > here and not == because the ticker cursor takes an extra loop
                    currentHeadline += 1;
                    currentHeadlinePosition = 0;

                    // Reset the headline and character positions if we've cycled through all the headlines
                    if (currentHeadline == headlines.length) currentHeadline = 0;

                    // STOP! We've advanced a headline. Now we just need to pause.
                    clearTimeout(innerTimeoutId);
                    clearTimeout(outerTimeoutId);
                    outerTick();
                }
            }

            // Do the individual ticks
            function tick() {
                // Now let's update the ticker with the current tick string
                if (currentHeadlinePosition === 0 && opts.fade) {
                    clearTimeout(innerTimeoutId);

                    // Animate the transition if it's enabled
                    headlineContainer.fadeOut(opts.fadeOutSpeed, function () {
                        // Now it's faded out, let's update the text
                        headlineContainer.html(getCurrentTick());
                        // And fade in
                        headlineContainer.fadeIn(opts.fadeInSpeed, function () {
                            // Advance our position
                            currentHeadlinePosition += 1;
                            // And now we're in, let's start the thing off again without the delay
                            innerTick();
                        });
                    });
                }
                else {
                    // Update the text
                    headlineContainer.html(getCurrentTick());
                    // Advance our position
                    currentHeadlinePosition += 1;
                    clearTimeout(innerTimeoutId);
                    innerTick();
                }
            }

            // Get the current tick string
            function getCurrentTick() {
                var cursor, i, j, location;
                switch (currentHeadlinePosition % 2) {
                    case 1:
                        cursor = opts.cursorOne;
                        break;
                    case 0:
                        cursor = opts.cursorTwo;
                        break;
                }

                // Don't display the cursor this was the last character of the headline
                if (currentHeadlinePosition >= headlines[currentHeadline].length) cursor = '';

                // Generate the headline
                var headline = '';
                var openedTags = [];
                for (i = 0; i < currentHeadlinePosition; i++) {
                    location = null;
                    // Check to see if there's meant to be a tag at this index
                    for (j = 0; j < headlineTagMap[currentHeadline].length; j++) {
                        // Find a tag mapped to this location, if one exists
                        if (headlineTagMap[currentHeadline][j] && headlineTagMap[currentHeadline][j].start === i) {
                            location = headlineTagMap[currentHeadline][j]; // It does exist!
                            break;
                        }
                    }

                    if (location) {
                        // Add the tag to the headline
                        headline += location.tag;

                        // Now deal with the tag for proper HTML
                        if (! location.selfClosing) {
                            if (location.tag.charAt(1) === '/') {
                                openedTags.pop();
                            }
                            else {
                                openedTags.push(location.name);
                            }
                        }
                    }

                    // Add the character to the headline
                    headline += headlines[currentHeadline][i];
                }

                // Now close the tags, if we need to (because it hasn't finished with all the text in the tag)
                for (i = 0; i < openedTags.length; i++) {
                    headline += '</' + openedTags[i] + '>';
                }

                return headline + cursor;
            }

            // Start it
            outerTick();
        });
    };

    /**
     * Randomize array element order in-place.
     * Using Fisher-Yates shuffle algorithm.
     */
    function shuffleArray(array) {
        for (var i = array.length - 1; i > 0; i--) {
            var j = Math.floor(Math.random() * (i + 1));
            var temp = array[i];
            array[i] = array[j];
            array[j] = temp;
        }
        return array;
    }

    /**
     * Strip all HTML tags from a string.
     * An array of safe tags can be passed, which will not be
     * stripped from the string with the rest of the tags.
     */
    function stripTags(text, safeTags) {
        safeTags = safeTags || [];
        var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/img;
        var comments = /<!--.*?-->/img;
        return text.replace(comments, '').replace(tags, function (a, b) {
            return safeTags.indexOf(b.toLowerCase()) !== -1 ? a : '';
        });
    }

    /**
     * Locates all of the requested tags in a string.
     */
    function locateTags(text, tagList) {
        tagList = tagList || [];
        var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/im;
        var selfClosing = /\/\s{0,}>$/m;
        var locations = [];
        var match, location;

        while ((match = tags.exec(text)) !== null) {
            if (tagList.length === 0 || tagList.indexOf(match[1]) !== -1) {
                location = {
                    tag: match[0],
                    name: match[1],
                    selfClosing: selfClosing.test(match[0]),
                    start: match.index,
                    end: match.index + match[0].length - 1
                };
                locations.push(location);

                // Now remove this tag from the string
                // so that each location will represent it in a string without any of the tags
                text = text.slice(0, location.start) + text.slice(location.end + 1);

                // Reset the regex
                tags.lastIndex = 0;
            }
        }

        return locations;
    }

    // Plugin default settings
    $.fn.ticker.defaults = {
        random:        false, // Whether to display ticker items in a random order
        itemSpeed:     3000,  // The pause on each ticker item before being replaced
        cursorSpeed:   50,    // Speed at which the characters are typed
        pauseOnHover:  true,  // Whether to pause when the mouse hovers over the ticker
        finishOnHover: false,  // Whether or not to complete the ticker item instantly when moused over
        cursorOne:     '_',   // The symbol for the first part of the cursor
        cursorTwo:     '-',   // The symbol for the second part of the cursor
        fade:          true,  // Whether to fade between ticker items or not
        fadeInSpeed:   600,   // Speed of the fade-in animation
        fadeOutSpeed:  300    // Speed of the fade-out animation
    };

})(jQuery);


;(function($) {
	$('.csc-textpic-imagewrap,.ce-textpic,.news-img-wrap,.img-wrap,.image-wrap,body').each(function() {
		$(this).magnificPopup({
			delegate: 'a:isImageFile',
			tClose: 'Schließen (Esc)',
			type: 'image',
			tLoading: 'Lade Bild #%curr%...',
			mainClass: 'mfp-img-mobile',
			gallery: {
				enabled: 1,
				preload: [1,2],
				navigateByImgClick: 1,
				arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
				tPrev: 'Vorheriges (Linke Pfeiltaste)',
				tNext: 'Nächstes (Rechte Pfeiltaste)',
				tCounter: '%curr% von %total%'
			},
			image: {
				cursor: 'mfp-zoom-out-cur',
				titleSrc: 'title',
				verticalGap: 88,
				verticalFit: 1,
				tError: '<a href="%url%">Das Bild</a> konnte nicht geladen werden.'
			},
			removalDelay: 0
		});
	});
})(window.jQuery || window.Zepto);
;(function($) {
	$('p').each(function() {
		$(this).magnificPopup({
			delegate: 'a.mfp-for-rte',
			tClose: 'Schließen (Esc)',
			type: 'image',
			tLoading: 'Lade Bild #%curr%...',
			mainClass: 'mfp-img-mobile',
			gallery: {
				enabled: 1,
				preload: [1,2],
				navigateByImgClick: 1,
				arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
				tPrev: 'Vorheriges (Linke Pfeiltaste)',
				tNext: 'Nächstes (Rechte Pfeiltaste)',
				tCounter: '%curr% von %total%'
			},
			image: {
				cursor: 'mfp-zoom-out-cur',
				titleSrc: 'title',
				verticalGap: 88,
				verticalFit: 1,
				tError: '<a href="%url%">Das Bild</a> konnte nicht geladen werden.'
			},
			removalDelay: 0
		});
	});
})(window.jQuery || window.Zepto);