PageSourceSearch

https://www.baur-gruppe.com/wLayout/wGlobal/layout/scripts/merged/72bd3faea8710e90ed82b85e82039a46.js

js baur-gruppe.com collected 2026-09-30 15:14:21 UTC 344,940 bytes, 5,171 lines download raw bytes

vendor: 4,514 bytes, lines 1-3
1/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
2/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
3!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n
vendor: 6,587 bytes, line 3
3.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="<select t=''><option selected=''></option></select>",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}
vendor: 10,444 bytes, line 3
3),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=jb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=kb(b);function nb(){}nb.prototype=d.filters=d.pseudos,d.setFilters=new nb;function ob(a,b){var c,e,f,g,h,i,j,k=x[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=Q.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?db.error(a):x(a,i).slice(0)}function pb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[
vendor: 10,705 bytes, line 3
31].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}
vendor: 4,335 bytes, lines 3-4
3:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f
4}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},W=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML="  <link/><table></table><a href='/a'>a</a>",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");
vendor: 22,119 bytes, line 4
4for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=$.test(e)?this.mouseHooks:Z.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||z),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||z,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==db()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===db()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=z.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===L&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&(a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault())?bb:cb):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:cb,isPropagationStopped:cb,isImmediatePropagationStopped:cb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=bb,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=bb,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submitBubbles||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?b.form:void 0;c&&!n._data(c,"submitBubbles")&&(n.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),n._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.changeBubbles||(n.event.special.change={setup:function(){return Y.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),n.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),n.event.simulate("change",this,a,!0)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;Y.test(b.nodeName)&&!n._data(b,"changeBubbles")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a,!0)}),n._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!Y.test(this.nodeName)}}),l.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=cb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return n().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=cb),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});function eb(a){var b=fb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var fb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gb=/ jQuery\d+="(?:null|\d+)"/g,hb=new RegExp("<(?:"+fb+")[\\s/>]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/<tbody/i,mb=/<|&#?\w+;/,nb=/<(?:script|style|link)/i,ob=/checked\s*(?:[^=]|=\s*.checked.)/i,pb=/^$|\/(?:java|ecma)script/i,qb=/^true\/(.*)/,rb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,sb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1></$2>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?"<table>"!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Db[0].contentWindow||Db[0].contentDocument).document,b.write(),b.close(),c=Fb(a,b),Db.detach()),Eb[a]=c),c}!function(){var a,b,c=z.createElement("div"),d="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";c.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],a.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(a.style.opacity),l.cssFloat=!!a.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===c.style.backgroundClip,a=c=null,l.shrinkWrapBlocks=function(){var a,c,e,f;if(null==b){if(a=z.getElementsByTagName("body")[0],!a)return;f="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",c=z.createElement("div"),e=z.createElement("div"),a.appendChild(c).appendChild(e),b=!1,typeof e.style.zoom!==L&&(e.style.cssText=d+";width:1px;padding:1px;zoom:1",e.innerHTML="<div></div>",e.firstChild.style.width="5px",b=3!==e.offsetWidth),a.removeChild(c),a=c=e=null}return b}}();var Hb=/^margin/,Ib=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Jb,Kb,Lb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Jb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),Ib.test(g)&&Hb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):z.documentElement.currentStyle&&(Jb=function(a){return a.currentStyle},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ib.test(g)&&!Lb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Mb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h=z.createElement("div"),i="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",j="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";h.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",b=h.getElementsByTagName("a")[0],b.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(b.style.opacity),l.cssFloat=!!b.style.cssFloat,h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,b=h=null,n.extend(l,{reliableHiddenOffsets:function(){if(null!=c)return c;var a,b,d,e=z.createElement("div"),f=z.getElementsByTagName("body")[0];if(f)return e.setAttribute("className","t"),e.innerHTML="  <link/><table></table><a href='/a'>a</a>
vendor: 9,513 bytes, lines 4-5
4<input type='checkbox'/>",a=z.createElement("div"),a.style.cssText=i,f.appendChild(a).appendChild(e),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",b=e.getElementsByTagName("td"),b[0].style.cssText="padding:0;margin:0;border:0;display:none",d=0===b[0].offsetHeight,b[0].style.display="",b[1].style.display="none",c=d&&0===b[0].offsetHeight,f.removeChild(a),e=f=null,c},boxSizing:function(){return null==d&&k(),d},boxSizingReliable:function(){return null==e&&k(),e},pixelPosition:function(){return null==f&&k(),f},reliableMarginRight:function(){var b,c,d,e;if(null==g&&a.getComputedStyle){if(b=z.getElementsByTagName("body")[0],!b)return;c=z.createElement("div"),d=z.createElement("div"),c.style.cssText=i,b.appendChild(c).appendChild(d),e=d.appendChild(z.createElement("div")),e.style.cssText=d.style.cssText=j,e.style.marginRight=e.style.width="0",d.style.width="1px",g=!parseFloat((a.getComputedStyle(e,null)||{}).marginRight),b.removeChild(c)}return g}});function k(){var b,c,h=z.getElementsByTagName("body")[0];h&&(b=z.createElement("div"),c=z.createElement("div"),b.style.cssText=i,h.appendChild(b).appendChild(c),c.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;display:block;padding:1px;border:1px;width:4px;margin-top:1%;top:1%",n.swap(h,null!=h.style.zoom?{zoom:1}:{},function(){d=4===c.offsetWidth}),e=!0,f=!1,g=!0,a.getComputedStyle&&(f="1%"!==(a.getComputedStyle(c,null)||{}).top,e="4px"===(a.getComputedStyle(c,null)||{width:"4px"}).width),h.removeChild(b),c=h=null)}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Nb=/alpha\([^)]*\)/i,Ob=/opacity\s*=\s*([^)]*)/,Pb=/^(none|table(?!-c[ea]).+)/,Qb=new RegExp("^("+T+")(.*)$","i"),Rb=new RegExp("^([+-])=("+T+")","i"),Sb={position:"absolute",visibility:"hidden",display:"block"},Tb={letterSpacing:0,fontWeight:400},Ub=["Webkit","O","Moz","ms"];function Vb(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ub.length;while(e--)if(b=Ub[e]+c,b in a)return b;return d}function Wb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=n._data(d,"olddisplay",Gb(d.nodeName)))):f[g]||(e=V(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Xb(a,b,c){var d=Qb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Yb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Zb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Jb(a),g=l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Kb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ib.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Yb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Kb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=Vb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Rb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]="",i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Vb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Kb(a,b,d)),"normal"===f&&b in Tb&&(f=Tb[b]),""===c||c?(e=parseFloat(f),c===!0||n.isNumeric(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Pb.test(n.css(a,"display"))?n.swap(a,Sb,function(){return Zb(a,b,d)}):Zb(a,b,d):void 0},set:function(a,c,d){var e=d&&Jb(a);return Xb(a,c,d?Yb(a,b,d,l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Ob.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Nb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Nb.test(f)?f.replace(Nb,e):f+" "+e)}}),n.cssHooks.marginRight=Mb(l.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},Kb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Hb.test(a)||(n.cssHooks[a+b].set=Xb)}),n.fn.extend({css:function(a,b){return W(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Jb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)
5},a,b,arguments.length>1)},show:function(){return Wb(this,!0)},hide:function(){return Wb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function $b(a,b,c,d,e){return new $b.prototype.init(a,b,c,d,e)}n.Tween=$b,$b.prototype={constructor:$b,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=$b.propHooks[this.prop];return a&&a.get?a.get(this):$b.propHooks._default.get(this)},run:function(a){var b,c=$b.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):$b.propHooks._default.set(this),this}},$b.prototype.init.prototype=$b.prototype,$b.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},$b.propHooks.scrollTop=$b.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=$b.prototype.init,n.fx.step={};var _b,ac,bc=/^(?:toggle|show|hide)$/,cc=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),dc=/queueHooks$/,ec=[jc],fc={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=cc.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&cc.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function gc(){return setTimeout(function(){_b=void 0}),_b=n.now()}function hc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=U[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function ic(a,b,c){for(var d,e=(fc[b]||[]).concat(fc["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function jc(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&V(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k=Gb(a.nodeName),"none"===j&&(j=k),"inline"===j&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==k?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],bc.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}if(!n.isEmptyObject(o)){r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=ic(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function kc(a,b){var c,d,e,f,g;
vendor: 28,247 bytes, line 5
5for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function lc(a,b,c){var d,e,f=0,g=ec.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=_b||gc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:_b||gc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(kc(k,j.opts.specialEasing);g>f;f++)if(d=ec[f].call(j,a,k,j.opts))return d;return n.map(k,ic,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(lc,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],fc[c]=fc[c]||[],fc[c].unshift(b)},prefilter:function(a,b){b?ec.unshift(a):ec.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=lc(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&dc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(hc(b,!0),a,d,e)}}),n.each({slideDown:hc("show"),slideUp:hc("hide"),slideToggle:hc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(_b=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),_b=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ac||(ac=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(ac),ac=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e=z.createElement("div");e.setAttribute("className","t"),e.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=e.getElementsByTagName("a")[0],c=z.createElement("select"),d=c.appendChild(z.createElement("option")),b=e.getElementsByTagName("input")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==e.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=d.selected,l.enctype=!!z.createElement("form").enctype,c.disabled=!0,l.optDisabled=!d.disabled,b=z.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value,a=b=c=d=e=null}();var mc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(mc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.text(a)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var nc,oc,pc=n.expr.attrHandle,qc=/^(?:checked|selected)$/i,rc=l.getSetAttribute,sc=l.input;n.fn.extend({attr:function(a,b){return W(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===L?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?oc:nc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(F);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?sc&&rc||!qc.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(rc?c:d)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),oc={set:function(a,b,c){return b===!1?n.removeAttr(a,c):sc&&rc||!qc.test(c)?a.setAttribute(!rc&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=pc[b]||n.find.attr;pc[b]=sc&&rc||!qc.test(b)?function(a,b,d){var e,f;return d||(f=pc[b],pc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,pc[b]=f),e}:function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),sc&&rc||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):nc&&nc.set(a,b,c)}}),rc||(nc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},pc.id=pc.name=pc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:nc.set},n.attrHooks.contenteditable={set:function(a,b,c){nc.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var tc=/^(?:input|select|textarea|button|object)$/i,uc=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return W(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):tc.test(a.nodeName)||uc.test(a.nodeName)&&a.href?0:-1}}}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var vc=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(F)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===L||"boolean"===c)&&(this.className&&n._data(this,"__className__",this.className),this.className=this.className||a===!1?"":n._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(vc," ").indexOf(b)>=0)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var wc=n.now(),xc=/\?/,yc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(yc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var zc,Ac,Bc=/#.*$/,Cc=/([?&])_=[^&]*/,Dc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ec=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Fc=/^(?:GET|HEAD)$/,Gc=/^\/\//,Hc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ic={},Jc={},Kc="*/".concat("*");try{Ac=location.href}catch(Lc){Ac=z.createElement("a"),Ac.href="",Ac=Ac.href}zc=Hc.exec(Ac.toLowerCase())||[];function Mc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(F)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nc(a,b,c,d){var e={},f=a===Jc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Oc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Pc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Qc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ac,type:"GET",isLocal:Ec.test(zc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Oc(Oc(a,n.ajaxSettings),b):Oc(n.ajaxSettings,a)},ajaxPrefilter:Mc(Ic),ajaxTransport:Mc(Jc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Dc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||Ac)+"").replace(Bc,"").replace(Gc,zc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(F)||[""],null==k.crossDomain&&(c=Hc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===zc[1]&&c[2]===zc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(zc[3]||("http:"===zc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),Nc(Ic,k,b,v),2===t)return v;h=k.global,h&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Fc.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(xc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Cc.test(e)?e.replace(Cc,"$1_="+wc++):e+(xc.test(e)?"&":"?")+"_="+wc++)),k.ifModified&&(n.lastModified[e]&&v.setRequestHeader("If-Modified-Since",n.lastModified[e]),n.etag[e]&&v.setRequestHeader("If-None-Match",n.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Kc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Nc(Jc,k,b,v)){v.readyState=1,h&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Pc(k,v,c)),u=Qc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(n.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!l.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||n.css(a,"display"))},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Rc=/%20/g,Sc=/\[\]$/,Tc=/\r?\n/g,Uc=/^(?:submit|button|image|reset|file)$/i,Vc=/^(?:input|select|textarea|keygen)/i;function Wc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Sc.test(a)?d(a,e):Wc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Wc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Wc(c,a[c],b,e);return d.join("&").replace(Rc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Vc.test(this.nodeName)&&!Uc.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Tc,"\r\n")}}):{name:b.name,value:c.replace(Tc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$c()||_c()}:$c;var Xc=0,Yc={},Zc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Yc)Yc[a](void 0,!0)}),l.cors=!!Zc&&"withCredentials"in Zc,Zc=l.ajax=!!Zc,Zc&&n.ajaxTransport(function(a){if(!a.crossDomain||l.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Xc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Yc[g],b=void 0,f.onreadystatechange=n.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Yc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function $c(){try{return new a.XMLHttpRequest}catch(b){}}function _c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=z.head||n("head")[0]||z.documentElement;return{send:function(d,e){b=z.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ad=[],bd=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ad.pop()||n.expando+"_"+wc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(bd.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&bd.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(bd,"$1"+e):b.jsonp!==!1&&(b.url+=(xc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ad.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||z;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var cd=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&cd)return cd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h,a.length),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&n.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var dd=a.document.documentElement;function ed(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?(typeof e.getBoundingClientRect!==L&&(d=e.getBoundingClientRect()),c=ed(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||dd;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||dd})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return W(this,function(a,d,e){var f=ed(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Mb(l.pixelPosition,function(a,c){return c?(c=Kb(a,b),Ib.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return W(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var fd=a.jQuery,gd=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=gd),b&&a.jQuery===n&&(a.jQuery=fd),n},typeof b===L&&(a.jQuery=a.$=n),n});
5
6
7wCssClassesToAddGlobal = {'body' : ['wglAddScrollTop'], '#blockTop' : [''], '#blockTopInner' : [''], '#blockBefore #navigationMain, #blockBeforeFull #navigationMain, #blockBeforeFullLeft #navigationMain, #blockBeforeFullRight #navigationMain' : ['wglNavigationOptimizeTouch'], '#blockTop #navigationMain' : ['wglNavigationOptimizeTouch'], '.searchTerm' : ['wglSearchSuggest'], '.clickable' : ['wglClickable'], '.elementContainerStandard_var1' : ['wglAdjustHeightMax'], '.elementSectionParallaxBackground_var10' : ['wglParallaxBackground'], '.elementSectionParallaxBackground_var20' : ['wglParallaxBackground', 'wglParallaxBackground'], '.elementSectionParallaxBackground_var50' : ['wglParallaxBackground'], '.elementSectionIfVisible_var10' : ['wglAnimateIfVisible'], '.elementSectionIfVisible_var20' : ['wglAnimateIfVisible'], '.elementSection_var20' : ['wglAnimateIfVisibleOnce'], '.elementSection_var30' : ['wglExpandToHeighestChild'], '.elementSection_var99' : ['wglAnimateIfVisibleOnce'], '.elementBoxPosition_var220' : ['wglKeepInsideTopOnScroll'], '.elementBoxParallaxBackground_var10' : ['wglParallaxBackground'], '.elementBoxParallaxBackground_var20' : ['wglParallaxBackground'], '.elementBoxIfVisible_var10' : ['wglAnimateIfVisible'], '.elementBoxIfVisible_var20' : ['wglAnimateIfVisible'], '.listEntryClickable, .listEntryInnerClickable' : ['listEntryClickableJS'], '.listDefaultCols_var2' : ['wglAdjustHeightMax'], '.listDefaultCols_var3' : ['wglAdjustHeightMax'], '.listDefaultCols_var4' : ['wglAdjustHeightMax'], '.listDefaultCols_var7' : ['wglAdjustHeightMax'], '.listDefault_var20' : ['wglAdjustHeightMax'], '.listDefault_var3601 .listEntryThumbnail' : ['wglFancybox'], '.listPictureGallery_var2 .listEntriesPreviewInner' : ['wglAdjustHeightMax'], '.listPictureGallery_var53 .listEntriesPreviewInner' : ['wglAdjustHeightMax'], '.listPictureGallery_var223 .listEntries .listEntryImage' : ['wglFancybox'], '.elementContainerLayout_var20' : ['wglKeepInsideTopOnScroll'], '.elementBoxParallaxContent_var10' : ['wglParallaxContent'], '.elementBoxParallaxContent_var20' : ['wglParallaxContent'], '.listBannerSlider_var1 .listEntriesPreviewInner' : ['wglShrinkToMinWidthWithoutBreak'], '.elementSectionInnerHeight_var80' : ['section'], '.elementTabContainer_var21 .tabs' : ['wglCheckWidthParent'], '#_blockMainOuter' : ['nextToSidebar', 'moveWithSidebar']};
8wCssDataToAddGlobal = {'.elementSectionParallaxBackground_var10' : ['parallaxbackgrounddirection=bottom'], '.elementSectionParallaxBackground_var20' : ['parallaxbackgrounddirection=top', 'parallaxbackgrounddirection=top'], '.elementSectionParallaxBackgroundSpeed_var10' : ['parallaxbackgroundspeed=2'], '.elementSectionParallaxBackgroundSpeed_var0' : ['parallaxbackgroundspeed=1'], '.elementSectionParallaxBackgroundSpeed_var50' : ['parallaxbackgroundspeed=0.5'], '.elementSectionParallaxBackgroundSpeed_var90' : ['parallaxbackgroundspeed=0.1'], '.elementSectionParallaxBackground_var50' : ['parallaxbackgrounddirection=bottom'], '.elementSection_var30 > video' : ['adjusttoheighestchild=no'], '.elementBoxParallaxBackground_var10' : ['parallaxbackgrounddirection=bottom'], '.elementBoxParallaxBackground_var20' : ['parallaxbackgrounddirection=top'], '.elementBoxParallaxBackgroundSpeed_var10' : ['parallaxbackgroundspeed=2'], '.elementBoxParallaxBackgroundSpeed_var0' : ['parallaxbackgroundspeed=1'], '.elementBoxParallaxBackgroundSpeed_var50' : ['parallaxbackgroundspeed=0.5'], '.elementBoxParallaxBackgroundSpeed_var90' : ['parallaxbackgroundspeed=0.1'], '.elementBoxParallaxContent_var10' : ['parallaxcontentdirection=bottom'], '.elementBoxParallaxContent_var20' : ['parallaxcontentdirection=top'], '.elementBoxParallaxContentSpeed_var10' : ['parallaxcontentspeed=2'], '.elementBoxParallaxContentSpeed_var0' : ['parallaxcontentspeed=1'], '.elementBoxParallaxContentSpeed_var50' : ['parallaxcontentspeed=0.5'], '.elementBoxParallaxContentSpeed_var90' : ['parallaxcontentspeed=0.1']};
9wCssDOM = {'.listDefaultDate_var20 .listEntryDate' : {'action' : 'prependto', 'path' : 'parent().parent()'}
9, '.listDefaultDate_var22 .listEntryDate' : {'action' : 'prependto', 'path' : 'parent().parent()'}, '.listDefaultDate_var24 .listEntryDate' : {'action' : 'prependto', 'path' : 'parent().parent()'}, '.listDefaultDate_var30 .listEntryDate' : {'action' : 'insertafter', 'path' : 'parent()'}, '.listDefaultDate_var32 .listEntryDate' : {'action' : 'insertafter', 'path' : 'parent()'}, '.listDefaultDate_var70 .listEntryDate' : {'action' : 'insertafter', 'path' : 'parent()'}, '.listDefaultThumbnail_var30 .listEntryThumbnailOuter' : {'action' : 'prependto', 'path' : 'parent()'}, '.listDefaultThumbnail_var61 .listEntryThumbnailOuter' : {'action' : 'prependto', 'path' : 'parent()'}, '.listDefaultThumbnail_var73 .listEntryThumbnailOuter' : {'action' : 'prependto', 'path' : 'parent()'}, '.listDefault_var20 .listEntryThumbnailOuter' : {'action' : 'prependto', 'path' : 'parent()'}, '.listDefaultDate_var80 .listEntryDate' : {'action' : 'prependto', 'path' : 'parent().parent().parent()'}};
10wCssJQuery = {'#blockTop #searchBox .searchTerm' : {'jQuery' : 'jQuery(this).focus(function(){jQuery(this).parent().addClass(\'focused\')}).on(\'blur\', function(){jQuery(this).parent().removeClass(\'focused\');jQuery(this).val(\'\');jQuery(\'#searchSuggestOuter\').remove()})', 'event' : 'document.ready'}, '.elementSection_var99' : {'jQuery' : 'jQuery(this).prepend(\'<div class="sectionTitle">\' + jQuery(this).attr(\'data-title\') + \'</div>\')', 'event' : 'document.ready'}, '.elementBox_var60 > .boxInner' : {'jQuery' : 'jQuery(this).after(\'<div class="boxInnerOpener"></div><div class="boxInnerCloser"></div>\')', 'event' : 'document.ready'}, '.elementBox_var60 > .boxInnerOpener' : {'jQuery' : 'jQuery(this).click(function(){jQuery(this).hide();jQuery(this).prev().animate({\'max-height\': \'10000px\'}, 1000);jQuery(this).next().show()})', 'event' : 'document.ready'}, '.elementBox_var60 > .boxInnerCloser' : {'jQuery' : 'jQuery(this).click(function(){jQuery(this).hide();jQuery(this).prev().prev().animate({\'max-height\': \'200px\'}, 500);jQuery(this).prev().show()})', 'event' : 'document.ready'}, '.elementBox_var62 > .boxInner' : {'jQuery' : 'jQuery(this).after(\'<div class="boxInnerOpener"></div><div class="boxInnerCloser"></div>\')', 'event' : 'document.ready'}, '.elementBox_var62 > .boxInnerOpener' : {'jQuery' : 'jQuery(this).click(function(){jQuery(this).hide();jQuery(this).prev().animate({\'max-height\': \'10000px\'}, 1000);jQuery(this).next().show()})', 'event' : 'document.ready'}, '.elementBox_var62 > .boxInnerCloser' : {'jQuery' : 'jQuery(this).click(function(){jQuery(this).hide();jQuery(this).prev().prev().animate({\'max-height\': \'200px\'}, 500);jQuery(this).prev().show()})', 'event' : 'document.ready'}, '.elementAccordion_var0 .accordionHeader > a' : {'jQuery' : 'jQuery(this).append("<div class=\'clearBoth\'></div>")', 'event' : 'document.ready'}, '.elementAccordion_var1000 .accordionHeader > a' : {'jQuery' : 'jQuery(this).append("<div class=\'clearBoth\'></div>")', 'event' : 'document.ready'}, '.listDefaultDate_var40 .listEntryDate' : {'jQuery' : 'jQuery(this).prependTo(jQuery(this).parent().parent().find(\'.listEntryDescription\'))', 'event' : 'document.ready'}, '.listDefaultThumbnail_var90 .listEntryThumbnail' : {'jQuery' : 'jQuery(this).parent().parent().css(\'background-image\', \'u\' + \'rl(\' + (jQuery(this).attr(\'data-src\') ? jQuery(this).attr(\'data-src\') : jQuery(this).attr(\'src\')) + \')\')', 'event' : 'document.ready'}, '.listDefaultLink_var10 .listEntryMoreOnly' : {'jQuery' : 'jQuery(this).appendTo(jQuery(this).parent().parent().find(\'.listEntryDescription\'))', 'event' : 'document.ready'}, '.listDefaultLink_var22a .listEntryMoreOnly' : {'jQuery' : 'jQuery(this).wrap(\'<div class="listEntryMoreOnlyOuter"/>\')', 'event' : 'document.ready'}, '.listDefaultLink_var23 .listEntryMoreOnly' : {'jQuery' : 'jQuery(this).wrap(\'<div class="listEntryMoreOnlyOuter"/>\')', 'event' : 'document.ready'}, '.listDefaultLink_var26 .listEntryMoreOnly' : {'jQuery' : 'jQuery(this).insertBefore(jQuery(this).parent().find(\'.listEntryTitle\')).wrap(\'<div class="listEntryM
10oreOnlyOuter"/>\')', 'event' : 'document.ready'}, '.listDefaultLink_var27 .listEntryMoreOnly' : {'jQuery' : 'jQuery(this).wrap(\'<div class="listEntryMoreOnlyOuter"/>\')', 'event' : 'document.ready'}, '.listDefaultLink_var37 .listEntryMoreOnly' : {'jQuery' : 'jQuery(this).wrap(\'<div class="listEntryMoreOnlyOuter"/>\')', 'event' : 'document.ready'}, '.listDefaultLink_var39 .listEntryMoreOnly' : {'jQuery' : 'jQuery(this).wrap(\'<div class="listEntryMoreOnlyOuter"/>\')', 'event' : 'document.ready'}, '.listPictureGallery_var7 .listMoverBack' : {'jQuery' : 'jQuery(this).wrap(\'<div class="listMoverBackOuter"/>\')', 'event' : 'document.ready'}, '.listPictureGallery_var7 .listMoverForward' : {'jQuery' : 'jQuery(this).wrap(\'<div class="listMoverForwardOuter"/>\')', 'event' : 'document.ready'}, '.listPictureGallery_var53 .listEntriesPreview .listEntryInner' : {'jQuery' : 'jQuery(this).wrap(\'<a href="\' + jQuery(this).closest(\'.listEntry\').data(\'src-detail\') + \'" class="boxPictureOnly" rel="fancybox_gallery_" title=""/>\')', 'event' : 'document.ready'}, '.listPictureGallery_var53 .listEntriesPreview .listEntryImage' : {'jQuery' : 'jQuery(this).closest(\'.listEntry\').append(\'<a class="listEntryDownload download" target="_blank" href="/wLayout/wGlobal/scripts/accessDocument.php?forceDownload=1&document=\' + jQuery(this).closest(\'.listEntry\').attr(\'data-srcfile-detail\') + \'">\' + jQuery(this).closest(\'.listEntry\').data(\'sizefile-formated\') + \'</a>\') ; jQuery(this).parent().css(\'width\', jQuery(this).attr(\'width\')) ; jQuery(this).parent().find(\'.listEntryTitle\').show()', 'event' : 'document.ready'}, '.listPictureGallery_var223 .listEntries .listEntryInner' : {'jQuery' : 'jQuery(this).append(\'<span class="listEntryPosition" />\')', 'event' : 'document.ready'}, '.elementOverlap_var120 .overlapActivator' : {'jQuery' : 'jQuery(this).append(\'<span class="overlapActivatorReadMore button"></span>\')', 'event' : 'document.ready'}, '.elementOverlap_var120 .overlapActivatorReadMore' : {'jQuery' : 'jQuery(this).click(function(){jQuery(this).closest(\'.overlapActivator\').next().slideToggle();jQuery(this).closest(\'.elementOverlap_var120\').toggleClass(\'contentExpanded\')})', 'event' : 'document.ready'}, '.elementOverlap_var120 .overlapLayer' : {'jQuery' : 'jQuery(this).append(\'<span class="overlapLayerReadLess button"></span>\')', 'event' : 'document.ready'}, '.elementOverlap_var120 .overlapLayerReadLess' : {'jQuery' : 'jQuery(this).click(function(){jQuery(this).closest(\'.overlapLayer\').slideToggle();jQuery(this).closest(\'.elementOverlap_var120\').toggleClass(\'contentExpanded\')})', 'event' : 'document.ready'}, '.listDefaultDate_var80 .listEntryDate' : {'jQuery' : 'jQuery(this).html(\'<span>\' + jQuery(this).html().replace(/ .*/, \'\') + \'</span><span>\' + jQuery(this).html().replace(/.* /, \'\').replace(/&.*/, \'\') + \'</span>\')', 'event' : 'document.ready'}, '.elementBoxBackgroundColor_var5 .elementLink' : {'jQuery' : 'jQuery(this).addClass(\'iconsInvers\')', 'event' : 'document.ready'}, '.elementBoxBackgroundColor_var10 .elementLink' : {'jQuery' : 'jQuery(this).removeClass(\'iconsInvers\')', 'event' : 'document.ready'}, '.elementBoxBackgroundColor_var30 .elementLink' : {'jQuery' : 'jQuery(this).removeClass(\'iconsInvers\')', 'event' : 'document.ready'}, '.elementBoxBackgroundColor_var50 .elementLink' : {'jQuery' : 'jQuery(this).removeClass(\'iconsInvers\')', 'event' : 'document.ready'}, '.elementBoxBackgroundColor_var60 .elementLink' : {'jQuery' : 'jQuery(this).addClass(\'iconsInvers\')', 'event' : 'document.ready'}, '.elementBoxBackgroundColor_var90 .elementLink' : {'jQuery' : 'jQuery(this).addClass(\'iconsInvers\')', 'event' : 'document.ready'}, '.elementSectionBackgroundColor_var60 .elementLink' : {'jQuery' : 'jQuery(this).addClass(\'iconsInvers\')', 'event' : 'document.ready'}, '.elementSectionBackgroundColor_var90 .elementLink' : {'jQuery' : 'jQuery(this).addClass(\'iconsInvers\')', 'event' : 'document.ready'}, '.no-weditor .elementTabContainer_var21 .tabs' : {'jQuery' : 'jQuery(this).clone().prependTo(jQuery(this).parent()).wrap(\'<div class="tabsSmall"/>\').find(\'.tab\').unwrap().parent().html(jQuery(this).html().replace(/>[\\\\n\\\\s]+</gm, \'>&#160;<\'))', 'event' : 'document.ready'}, '.elementTabContainer_var41' : {'jQuery' : 'jQuery(this).prepend(\'<div class="containerTitle">\' + jQuery(this).data(\'title\') + \'</div>\')', 'event' : 'document.ready'}, '.elementTabContainer_var41 .tabs' : {'jQuery' : 'jQuery(this).closest(\'.elementTabContainer\').css(\'min-height\', jQuery(this).closest(\'.elementTabContainer\').innerHeight())', 'event' : 'document.ready'}, '#_blockMainOuter' : {'jQuery' : 'jQuery("#blockMainOuter").before(\'<div id="navigationSidebar" class="navigationSidebarClosed"/>\')', 'event' : 'document.ready'}};
11wMediaqueriesToAddGlobal = {'max1024' : {}, 'max768' : {}, 'min769' : {}, 'max720' : {}
11, 'min721' : {}, 'max620' : {}, 'min621' : {}, 'max540' : {}, 'min541' : {}, 'max400' : {}, 'min401' : {}, 'min1.5' : {}};
12/*
13////////////////////////////////////////////////////////////////
14//
15// UI JavaScript Funktionen
16//
17// Weblication CMS
18// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de
19// erstellt mit Weblication Content Management System, www.weblication.de
20//
21////////////////////////////////////////////////////////////////
22//                                                            //
23//                   BITTE NICHT ANPASSEN!                    //
24//           JS-Anpassungen können in der design.js           //
25//                    durchgeführt werden.                    //
26//                                                            //
27////////////////////////////////////////////////////////////////
28*/
29
30/*
31////////////////////////////////////////////////////////////////
32//
33// UI JavaScript Funktionen
34//
35// Weblication CMS
36// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de
37// erstellt mit Weblication Content Management System, www.weblication.de
38//
39////////////////////////////////////////////////////////////////
40//                                                            //
41//                   BITTE NICHT ANPASSEN!                    //
42//           JS-Anpassungen können in der design.js           //
43//                    durchgeführt werden.                    //
44//                                                            //
45////////////////////////////////////////////////////////////////
46*/
47
48wUiVersion     = '1.0.60'; 
49wAllowMinimize = false;
50wCssClassesToAddGlobal   = typeof(wCssClassesToAddGlobal) != 'undefined' ? wCssClassesToAddGlobal : {};
51wCssDataToAddGlobal      = typeof(wCssDataToAddGlobal) != 'undefined' ? wCssDataToAddGlobal : {};
52wCssEventsToAddGlobal    = typeof(wCssEventsToAddGlobal) != 'undefined' ? wCssEventsToAddGlobal : {};
53wCssJQuery               = typeof(wCssJQuery) != 'undefined' ? wCssJQuery : {};
54wCssDOM                  = typeof(wCssDOM) != 'undefined' ? wCssDOM : {};
55wMediaqueriesToAddGlobal = typeof(wMediaqueriesToAddGlobal) != 'undefined' ? wMediaqueriesToAddGlobal : {};
56
57if(typeof wUiTmp == 'undefined'){
58  wUiTmp = {};
59  if(typeof wUiTmp['wGlobalProjectPath'] == 'undefined'){
60    var scriptTags = document.getElementsByTagName('script');
61    try{
62      for(i = 0; i < scriptTags.length; i++){
63        if(scriptTags[i].getAttribute('src') && scriptTags[i].getAttribute('src').indexOf('/wGlobal/layout/scripts/') != -1){
64          wUiTmp['wGlobalProjectPath'] = scriptTags[i].getAttribute('src').replace(/^(\/[^\/]*)[^\?]*/, '$1').replace(/\?[\s\S]*$/, '');    
65        }  
66      }
67    }
68    catch(e){}
69  }  
70}
71
72devicePixelRatio = window.devicePixelRatio || 1;
73hdLimitDpr       = 2;
74
75if(document.documentElement){
76  document.documentElement.className = document.documentElement.className + (!/MSIE (6|7|8)/.test(navigator.appVersion) ? ' pagestatus-uiloaded' : '');
77}
78
79jQuery(document).ready(function(){
80  //console.log('ready');
81  
82  if(wUiTmp['hasFiredReady']){
83    return;
84  }
85  
86  wUiTmp['hasFiredReady'] = true;
87  
88  wCssClassesToAddGlobal   = typeof(wCssClassesToAddGlobal) != 'undefined' ? wCssClassesToAddGlobal : {};
89  wCssDataToAddGlobal      = typeof(wCssDataToAddGlobal) != 'undefined' ? wCssDataToAddGlobal : {};
90  wCssEventsToAddGlobal    = typeof(wCssEventsToAddGlobal) != 'undefined' ? wCssEventsToAddGlobal : {};
91  wCssJQuery               = typeof(wCssJQuery) != 'undefined' ? wCssJQuery : {};
92  wCssDOM                  = typeof(wCssDOM) != 'undefined' ? wCssDOM : {};
93  wMediaqueriesToAddGlobal = typeof(wMediaqueriesToAddGlobal) != 'undefined' ? wMediaqueriesToAddGlobal : {};
94
95  var htmlAdditionalClasses = '';
96
97  if(navigator.appVersion.match(/MSIE (\d+\..)/)){
98    htmlAdditionalClasses += ' ie' + String(navigator.appVersion.match(/MSIE (\d+\..)/)[1]).replace(/\..*/, '');
99  }
100
101  if(parent != self){
102    if(location.href.indexOf('viewmode=blank') != -1){
103      htmlAdditionalClasses += ' lightbox';
104    }
105  }
106
107  if(/mobile/i.test(navigator.userAgent)) htmlAdditionalClasses += ' mobile';
108  if(/iPad/i.test(navigator.userAgent)) htmlAdditionalClasses += ' ipad';
109  if(/iPhone/i.test(navigator.userAgent)) htmlAdditionalClasses += ' iphone';
110  if(/iPod/i.test(navigator.userAgent)) htmlAdditionalClasses += ' ipod';
111  if(/(iPod|iPhone|iPad)/i.test(navigator.userAgent)){
112    htmlAdditionalClasses += ' ios';
113    wUiTmp['isIOS'] = true;
114    if(/CriOs/i.test(navigator.userAgent)){
115      htmlAdditionalClasses += ' crios';
116    }
117    else if(/Safari/i.test(navigator.userAgent)){
118      wUiTmp['isSafari'] = true;
119      htmlAdditionalClasses += ' saios';
120    }
121  }
122
123  htmlAdditionalClasses += ' viewmode-' + (/viewmode=([^&]+)/.test(location.href) ? RegExp.$1 : 'default');
124  htmlAdditionalClasses += (/targetPreview=embed/.test(location.href) ? ' wpreview' : '');
125
126  htmlAdditionalClasses += (('ontouchstart' in window)|| navigator.msMaxTouchPoints  || window.DocumentTouch && document instanceof DocumentTouch ? ' touch' : ' no-touch');
127
128  htmlAdditionalClasses += jQuery(window).scrollTop() == 0 && document.documentElement.className.indexOf(' scrolled-top') == -1 ? ' scrolled-top' : '';
129
130  if(document.documentElement){
131    if(document.documentElement.getAttribute('lang')){
132      htmlAdditionalClasses += ' lang-' + document.documentElement.getAttribute('lang');
133    }
134
135    var documentElementClassName = document.documentElement.className;
136
137    if(jQuery(window).scrollTop() != 0){
138      documentElementClassName = documentElementClassName.replace(' scrolled-top', '');
139    }
140    documentElementClassName = (documentElementClassName.replace('no-js', '') + ' js' + htmlAdditionalClasses).replace(/^\s+/, '');
141    if(typeof(wEditor) == 'undefined'){
142      documentElementClassName = documentElementClassName.replace('weditor', '') + ' no-weditor';
143    }
144    else{
145      documentElementClassName = documentElementClassName.replace('no-weditor', '') + ' weditor';
146    }
147    documentElementClassName = documentElementClassName + (!/MSIE (6|7|8)/.test(navigator.appVersion) ? ' pagestatus-ready' : '');
148    if(/MSIE (6|7|8)/.test(navigator.appVersion)){
149      documentElementClassName = documentElementClassName.replace(/pagestatus-\w+/g, '');
150    }
151    document.documentElement.className = documentElementClassName;
152  }
153
154  if(document.cookie.indexOf('websitezoom=l') != -1){
155    document.body.className = document.body.className + ' zoom-l';
156  }
157
158  for(var addClassSelector in wCssClassesToAddGlobal){
159	jQuery(addClassSelector).each(function(index){
160	  var classesToAdd = wCssClassesToAddGlobal[addClassSelector];
161      for(var i = 0, arrayLength = classesToAdd.length; i < arrayLength; i++){
162        var classData = classesToAdd[i].split('=');
163        if(classData.length == 2){
164          var selector = jQuery.trim(classData[0]);
165          if(selector == '.'){
166            jQuery(this).addClass(jQuery.trim(classData[1]));
167          }
168          else if(selector == 'parent'){
169            jQuery(this).parent().addClass(jQuery.trim(classData[1]));
170          }
171          else{
172            jQuery(this).find(selector).addClass(jQuery.trim(classData[1]));
173          }
174        }
175        else{
176          jQuery(this).addClass(jQuery.trim(classData[0]));
177        }
178      }
179    });
180  }
181
182  for(var addDataSelector in wCssDataToAddGlobal){
183    jQuery(addDataSelector).each(function(index){
184      var dataToAdd = wCssDataToAddGlobal[addDataSelector];
185      for(var i = 0, arrayLength = dataToAdd.length; i < arrayLength; i++){
186        var data = dataToAdd[i].split('=');
187        jQuery(this).attr('data-' + jQuery.trim(data[0]), jQuery.trim(data[1]));
188      }
189    });
190  }
191
192  jQuery('*[data-w-addclasses]').each(function(index){
193
194    var classesToAdd = jQuery(this).data('w-addclasses').split(',');
195    jQuery(this).removeAttr('data-w-addclasses');
196    for(var i = 0, arrayLength = classesToAdd.length; i < arrayLength; i++){
197      var classData = classesToAdd[i].split('=');
198      var selector = jQuery.trim(classData[0]);
199      if(selector == '.'){
200        jQuery(this).addClass(jQuery.trim(classData[1]));
201      }
202      else{
203        jQuery(this).find(selector).addClass(jQuery.trim(classData[1]));
204      }
205    }
206  });
207
208  for(var addEventSelector in wCssEventsToAddGlobal){
209    jQuery(addEventSelector).each(function(index){
210      var eventsToAdd = wCssEventsToAddGlobal[addEventSelector];
211      for(var i = 0, arrayLength = eventsToAdd.length; i < arrayLength; i++){
212        var eventData = eventsToAdd[i].split('=');
213        if(eventData.length == 2){
214          var eventType     = jQuery.trim(eventData[0]).replace(/^on/, '');
215          var eventFunction = jQuery.trim(eventData[1]);
216          jQuery(this).on(eventType, (new Function('event', eventFunction + '(this, event.originalEvent);')));
217        }
218      }
219    });
220  }
221
222  for(var wCssJQueryEntry in wCssJQuery){
223    jQuery(wCssJQueryEntry).each(function(index){
224      if(!wCssJQuery[wCssJQueryEntry]['event'] || wCssJQuery[wCssJQueryEntry]['event'] == 'document.ready'){
225        eval(wCssJQuery[wCssJQueryEntry]['jQuery']);
226      }
227    });
228  }
229
230  for(var wCssDOMEntry in wCssDOM){
231    jQuery(wCssDOMEntry).each(function(index){
232      domActions = {'prependto' : 'prependTo', 'appendto' : 'appendTo', 'insertbefore' : 'insertBefore', 'insertafter' : 'insertAfter'};
233      if(/^(\w+)\(/.test(wCssDOM[wCssDOMEntry]['path'])){
234        eval('jQuery(this).' + domActions[wCssDOM[wCssDOMEntry]['action'].toLowerCase()] + '(jQuery(this).' + wCssDOM[wCssDOMEntry]['path'].replace(/\*\/$/, '') + ');');
235      }
236      else{
237        if(wCssDOM[wCssDOMEntry]['action'] == 'prependto'){
238          jQuery(this).prependTo(wCssDOM[wCssDOMEntry]['path']);
239        }
240        else if(wCssDOM[wCssDOMEntry]['action'] == 'appendto'){
241          jQuery(this).appendTo(wCssDOM[wCssDOMEntry]['path']);
242        }
243        else if(wCssDOM[wCssDOMEntry]['action'] == 'insertbefore'){
244          jQuery(this).insertBefore(wCssDOM[wCssDOMEntry]['path']);
245        }
246        else if(wCssDOM[wCssDOMEntry]['action'] == 'insertafter'){
247          jQuery(this).insertAfter(wCssDOM[wCssDOMEntry]['path']);
248        }
249      }
250    });
251  }
252
253  var mediaQueriesTmpToAdd = '<div id="wMediaqueriesTmp">';
254
255  for(var wMediaqueryToAddGlobal in wMediaqueriesToAddGlobal){
256    mediaQueriesTmpToAdd += '<div id="wMediaqueryTmp_' + wMediaqueryToAddGlobal + '"></div>';
257  }
258  mediaQueriesTmpToAdd += '</div>';
259  
260  wCookieNoticeVar = typeof(wCookieNoticeVar) != 'undefined' ? wCookieNoticeVar : '';
261  if(typeof(wEditor) != 'undefined' || document.cookie.indexOf('hideCookieNotice' + wCookieNoticeVar + '=1') != -1 || /bot|search|slurp|spider|crawler|mediapartners/i.test(navigator.userAgent)){
262    if(typeof closeCookieNotice == 'function'){    
263      closeCookieNotice();
264    }
265    else{
266      jQuery('#cookieNotice').hide();
267    } 
268  }
269  else{
270    if(typeof showCookieNotice == 'function'){    
271      showCookieNotice();
272    }
273    else{    
274      jQuery('#cookieNotice').show();
275    }  
276  }
277
278  jQuery('body').append(mediaQueriesTmpToAdd);
279
280  jQuery('.wglBannerSlider').wBannerSlider();
281  jQuery('.wglPictureGallery').wPictureGallery();
282  jQuery('.wglTabcontainer').wTabcontainer();
283  jQuery('.wglAccordion').wAccordion();
284  jQuery('.wglSearchSuggest').wSearchSuggest();
285
286  jQuery('label').each(function(index){
287    var nameFor     = jQuery(this).attr('for');
288    if(nameFor && nameFor != ''){
289      var currentForm = jQuery(this).closest('form').get(0);
290      if(currentForm){
291        var elementFor  = currentForm.elements[nameFor];
292        if(elementFor && elementFor.length){
293          elementFor = elementFor[0];
294        }
295
296        if(!elementFor){
297          elementFor = jQuery(this).closest('form').find('#' + nameFor).get(0);
298        }
299
300        if(elementFor && typeof(elementFor.getAttribute('placeholder')) == 'string' && (elementFor.className.indexOf('wglIsInvalid') == -1 || elementFor.value == '')){
301          if(elementFor.getAttribute('data-showlabelifhasplaceholder') != '1' && typeof(elementFor.placeholder) != 'undefined'){
302            jQuery(this).css({'display' : 'none'});
303          }
304        }
305      }
306    }
307  });
308
309  wPrepareHTML();
310
311  if(window.matchMedia){
312    window.matchMedia('print').addListener(function(){
313      wUiTmp['isMediaPrint'] = true;
314      jQuery(window).trigger('resize');
315    });
316  }
317  else{
318    window.onbeforeprint = function(event){
319      wUiTmp['isMediaPrint'] = true;
320      jQuery(window).trigger('resize');
321    };
322  }
323
324  if(/viewmode=print/.test(location.search)){
325    wUiTmp['isViewmodePrint'] = true;
326  }
327
328  
329  window.setTimeout(function(event){
330    wAdaptParallax(event);
331  }, 320);
332  
333  wAdaptConditionalFormData();
334  
335  jQuery('.wglAddScrollProgress').each(function(index){
336
337    var currentElement = jQuery(this);
338    currentElement.append('<progress id="scrollProgress" max="1000" value="
3380"><div></div></progress');
339    
340    wUiTmp['elementScrollProgress'] = jQuery('#scrollProgress');
341    
342    jQuery(window).on('resize scroll', function(){
343      var winScrollTop   = jQuery(window).scrollTop();
344      var winHeight      = jQuery(window).height();       
345      var documentHeight = jQuery(document).height();      
346      var scrollPercentage = Math.round(1000 * winScrollTop / (documentHeight - winHeight));
347      wUiTmp['elementScrollProgress'].attr('value', scrollPercentage)
348    });
349  });
350
351  jQuery('.wglAddScrollTop').each(function(index){
352
353    var currentElement = jQuery(this);
354    if(currentElement.get(0).nodeName.toLowerCase() == 'body'){
355      currentElement.append('<div id="scrollTopOuter"><div id="scrollTop"><div class="scrollTopInner"></div></div></div');
356    }
357    else{
358      currentElement.after('<div id="scrollTopOuter"><div id="scrollTop"><div class="scrollTopInner"></div></div></div');
359    }
360    
361    jQuery('#scrollTop').on('mousedown touchstart', function (event){
362      event.preventDefault();
363	  jQuery('body, html').animate({scrollTop:0});
364	});
365    
366    jQuery(window).scroll(function(){
367      var scrollTop  = jQuery(this).scrollTop();
368      if(scrollTop > 200){
369        jQuery('#scrollTop').fadeIn();
370      }
371      else{
372        jQuery('#scrollTop').fadeOut();
373      }
374    });
375  });
376
377  jQuery('.wglAddFontResizer').each(function(index){
378
379    var currentElement = jQuery(this);
380    var char = 'A';
381    if(currentElement.attr('data-fontResizerVal') == 0) char = '';
382    currentElement.prepend('<div id="fontResizer"><span class="fontResizerLabel"></span><span class="fontResizerShrink">'+char+'</span><span class="fontResizerEnlarge">'+char+'</span></div');
383
384    jQuery('.fontResizerShrink').on('click', function (event){
385      document.cookie = 'websitezoom=;path=/';
386      location.reload();
387		});
388    jQuery('.fontResizerEnlarge').on('click', function (event){
389      document.cookie = 'websitezoom=l;path=/';
390      location.reload();
391	});
392  });
393
394  jQuery('.wglShrinkToMinWidthWithoutBreak').each(function(index){
395
396    var currentElement = jQuery(this);
397    var widthOuter = currentElement.width();
398    var widthInner = currentElement.children('*').outerWidth();
399    var textAlignBefore = currentElement.css('text-align');
400    currentElement.css({'text-align' : 'left'});
401    var lastElementInner = currentElement.children('*:last');
402    var offsetRightLastElementInner = Math.ceil(lastElementInner.get(0).offsetLeft + lastElementInner.outerWidth() + parseInt(lastElementInner.css('margin-right')));
403    currentElement.css({'text-align' : textAlignBefore});
404    currentElement.css({'width' : String(offsetRightLastElementInner) + 'px'});
405  });
406
407  jQuery('.wglAdjustWidthEqual').each(function(index){
408
409    var currentElement = jQuery(this);
410    var numberEntries  = 0;
411    currentElement.children('*').each(function(index){
412      if(jQuery(this).css('display') != 'none'){
413        numberEntries++;
414      }
415    });
416    var widthPerEntry  = String(100 / numberEntries) + '%';
417    currentElement.children('*').each(function(index){
418      if(jQuery(this).css('display') != 'none'){
419        jQuery(this).css({'width' : widthPerEntry});
420      }
421    });
422  });
423
424  jQuery('.wglRemoveOnClick').each(function(index){
425    jQuery(this).attr('onclick', '').off('click');
426  });
427  
428  jQuery('.wglCaptcha').each(function(index){
429    if(jQuery(this).find('iframe[data-h="1"]').length == 1){
430      jQuery(this).closest('.formElementCaptcha').hide();
431      jQuery(this).closest('form').find('button[type="submit"]').on('click', function(event){
432        var iFr = jQuery(this).closest('form').find('iframe[class="wglIFrameSc"]');
433        jQuery(this).closest('form').find('input[id="captchaInput"]').val(iFr.get(0).contentWindow.gv(event.originalEvent, iFr.data('k')).substr(5, 4));
434      });
435    }
436  });
437
438  if(typeof(wEditor) == 'undefined'){
439    jQuery('.wglFancybox').each(function(index){
440      var currentElement = jQuery(this);
441      if(currentElement.get(0).nodeName == 'IMG'){
442        var wrapElement = currentElement.parent().attr('class') == 'listEntryThumbnailOuter' ? currentElement.parent() : currentElement;
443        var srcFancy    = currentElement.attr('src');
444        if(currentElement.attr('data-src') && currentElement.attr('data-src') != ''){
445          srcFancy = currentElement.attr('data-src');
446        }
447        else{
448          if(/\-/.test(srcFancy.replace(/[\s\S]+\//, ''))){
449            srcFancy = srcFancy.replace(/\/weblication\/wThumbnails/, '').replace(/-[^-]+(\.\w+)$/, '$1');
450          }
451          else if(currentElement.attr('data-src2x') && currentElement.attr('data-src2x') != ''){
452            srcFancy = currentElement.attr('data-src2x');
453          }
454        }
455
456        var closestList = currentElement.closest('.elementList');
457        var relId       = '';
458        if(closestList.length == 1){
459          relId = closestList.attr('id');
460        }
461        wrapElement.wrap('<a rel="' + relId + '" onclick="event && event.stopPropagation ? event.stopPropagation() : event.cancelBubble = true;" title="' + currentElement.get(0).alt + '" class="boxPictureOnly" href="' + srcFancy + '"/>');
462      }
463    });
464    
465    if(('ontouchstart' in window) || navigator.msMaxTouchPoints || window.DocumentTouch && document instanceof DocumentTouch){
466      jQuery('.wglNavigationOptimizeTouch li li:not(:has(ul))').each(function(index){
467        //jQuery(this).css({'border' : 'solid 4px blue'});
468        jQuery(this).on('click touchstart', function(event){
469          event.stopPropagation();
470        });
471      });
472      jQuery('.wglNavigationOptimizeTouch li.navLevel1Open > a, .wglNavigationOptimizeTouch li.navLevel1OpenSelected > a, .wglNavigationOptimizeTouch li.navLevel1OpenDescendantSelected > a, .wglNavigationOptimizeTouch li.navLevel1:has(a[data-previewlink]) > a').each(function(index){
473        //jQuery(this).css({'border' : 'solid 4px green'});
474        jQuery(this).on(navigator.userAgent.indexOf('Trident') != -1 && navigator.userAgent.indexOf('Touch') != -1 ? 'pointerdown' : 'click', function(event){
475          var timeClicked = new Date().getTime();
476          if(event.pointerType && event.pointerType == 'mouse'){
477          }
478          else if(event.target.getAttribute('data-on-touch-expire') && event.target.getAttribute('data-on-touch-expire') == 1 && parseInt(event.target.getAttribute('data-has-already-touched')) > timeClicked - 700){
479          }
480          else if(!(event.target.getAttribute('data-on-touch-expire') && event.target.getAttribute('data-on-touch-expire') == 1) && event.target.getAttribute('data-has-already-touched')){
481          }
482          else{
483            event.preventDefault();
484            event.target.setAttribute('data-has-already-touched', timeClicked);
485          }
486        });
487      });
488    }
489    
490    jQuery('form[data-inlinevalidation!="onblur"] input[data-validators="email"]').each(function(){
491      jQuery(this).on('blur', function(){
492        jQuery(this).val(jQuery(this).val().trim());
493      });
494    });    
495  
496    jQuery('form[data-inlinevalidation="onblur"]').each(function(){
497      wUiTmp['formPos'] = wUiTmp['formPos'] ? wUiTmp['formPos'] + 1 : 1;
498      jQuery(this).attr('data-formpos', wUiTmp['formPos']);
499      if(jQuery(this).attr('action').indexOf('/weblication/grid5/tmpHTTP/wForm-') != -1){
500        jQuery(this).find('input, textarea, select').each(function(){
501          if(jQuery(this).attr('name') == 'captchaInput'){
502            return true;
503          }
504          if(location.search.indexOf('wFormStatus=failed') != -1){
505            wglValidateElementInline(jQuery(this).get(0), {'onInit' : true});
506          }
507          var eventsToValidate = 'blur';
508          if(jQuery(this).attr('type') == 'radio'){
509            eventsToValidate = 'click';
510          }
511          else if(jQuery(this).attr('type') == 'file'){
512            eventsToValidate = 'change';
513          }
514          else if(jQuery(this).attr('type') == 'checkbox' || jQuery(this).prop("tagName") == 'SELECT'){
515            eventsToValidate = 'change';
516          }
517          else if(jQuery(this).hasClass('hasDatepicker')){
518            eventsToValidate = 'change';
519          }
520
521          jQuery(this).on(eventsToValidate, function(){
522            wglValidateElementInline(jQuery(this).get(0), {});
523          });
524        });
525      }
526    });
527  }
528
529  jQuery('.wglClickable').css({'cursor': 'pointer'});
530
531  //if(/Android/i.test(navigator.userAgent) || navigator.userAgent.match(/Trident\/7/)){
532  if(/Android/i.test(navigator.userAgent)){
533    jQuery('a').each(function(){
534      var cE = jQuery(this);
535      var hrefCurrent = cE.attr('href');
536      if(/\.pdf$/.test(hrefCurrent) && !/accessDocument\.php/.test(hrefCurrent) && !/^https?\:\/\//.test(hrefCurrent)){
537        if(cE.attr('data-pathPrepend')){
538          hrefCurrent = cE.attr('data-pathPrepend') + hrefCurrent; 
539        }
540        cE.attr('href', wUiTmp['wGlobalProjectPath'] + '/wGlobal/scripts/accessDocument.php?forceDownload=' + (cE.hasClass('download') ? '1' : '0') + '&document=' + encodeURIComponent(hrefCurrent));
541      }
542    });
543  }
544  
545  jQuery(window).trigger('resize');
546  //console.log('ready END');
547});
548
549
550jQuery(window).on('load', function(){
551	//console.log('onload');
552	
553  for(var wCssJQueryEntry in wCssJQuery){
554  		
555    jQuery(wCssJQueryEntry).each(function(index){
556  	if(wCssJQuery[wCssJQueryEntry]['event'] && wCssJQuery[wCssJQueryEntry]['event'] == 'window.load'){
557        eval(wCssJQuery[wCssJQueryEntry]['jQuery']);
558      }
559    });
560  }
561
562  if(document.documentElement && !/MSIE (6|7|8)/.test(navigator.appVersion)){
563      window.setTimeout(function(){
564      document.documentElement.className = document.documentElement.className + ' pagestatus-loaded';
565    }, 1000);
566  }
567  
568  jQuery("img[data-srchover]").each(function(){
569    var thisElement         = jQuery(this);
570    var hoverTriggerElement = thisElement;
571    var hoverTriggerPath    = thisElement.data('hovertrigger');
572    if(hoverTriggerPath){
573      eval('hoverTriggerElement = hoverTriggerElement.' + hoverTriggerPath);
574    }
575    hoverTriggerElement.on('mouseover', function (event){
576      thisElement.data('srcbeforehover', thisElement.attr('src'));
577      if(thisElement.data('ishd') == '1'){
578        thisElement.attr('src', thisElement.data('srchover2x'));
579      }
580      else{
581        thisElement.attr('src', thisElement.data('srchover'));
582      }
583    });
584    hoverTriggerElement.on('mouseout', function (event){
585      thisElement.attr('src', thisElement.data('srcbeforehover'));
586    });
587  });
588
589  window.setTimeout(function(){
590    var jQueryHashId = location.hash;
591    if(jQueryHashId != '' && (jQueryHashId.indexOf('#anchor') == 0 || jQueryHashId.indexOf('#tab') == 0)){
592      var anchor = jQuery(jQueryHashId.replace(/\./g, '\\.').replace(/\:/g, '\\:'));
593      if(anchor.length > 0){
594        var offsetTopAnchor = (anchor.offset())['top'];
595        offsetTopAnchor = offsetTopAnchor - wGetScrollTopHeight(); 
596        jQuery('body, html').animate({scrollTop: offsetTopAnchor});
597      }  
598    }
599  }, 120);
600
601  jQuery('.wglMagnifier').wMagnifier();
602
603  jQuery('.wglOverflowXTouch').each(function(index){
604
605    var currentElement = jQuery(this);
606    var widthOuter = currentElement.width();
607    var widthInner = currentElement.children('*').outerWidth();
608    if(!currentElement.is(":visible")){
609      return false;
610    }
611    else if(widthInner <= widthOuter){
612      return false;
613    }
614    else{
615      var lastElementInner = currentElement.children('*').children('*:last');
616      var offsetRightLastElementInner = lastElementInner.get(0).offsetLeft + lastElementInner.outerWidth() + parseInt(lastElementInner.css('margin-right'));
617      currentElement.children('*').children('*').each(function(index){
618        jQuery(this).css('width', jQuery(this).width());
619      });
620      lastElementInner.parent().css({'width' : String(offsetRightLastElementInner) + 'px'})
621    }
622
623    jQuery(this).find('img').attr('unselectable', 'on');
624
625    jQuery('body').on('touchstart mousedown', function(event){
626      if(jQuery(event.target).closest(currentElement).length != 0){
627        event.preventDefault();
628      }
629    });
630
631    jQuery('body').on("touchmove mousemove", function(event){
632      if(jQuery('body').data('wtouchelement')){
633
634        var mouseXDiff   = (event.originalEvent.touches ? event.originalEvent.touches[0].pageX : event.pageX) - jQuery('body').data('wtouchmousex');
635        var mouseYDiff   = (event.originalEvent.touches ? event.originalEvent.touches[0].pageY : event.pageY) - jQuery('body').data('wtouchmousey');
636
637        jQuery('body').data('wtouchmousex', event.originalEvent.touches ? event.originalEvent.touches[0].pageX : event.pageX);
638        jQuery('body').data('wtouchmousey', event.originalEvent.touches ? event.originalEvent.touches[0].pageY : event.pageY);
639        jQuery('body').data('wtouchlastdiffx', mouseXDiff);
640        jQuery('body').data('wtouchlastdiffy', mouseYDiff);
641
642        var milliseconds = (new Date()).getTime();
643        var timeDiff     = milliseconds - jQuery('body').data('timestamplast');
644        jQuery('body').data('timestampbefore', jQuery('body').data('timestamplast'));
645        jQuery('body').data('timestamplast', milliseconds);
646
647        var speedX = Math.round(100 * (mouseXDiff > 0 ? mouseXDiff : -mouseXDiff) / timeDiff) + 1;
648
649        jQuery('body').data('wtouchspeedX', speedX);
650
651        var touchDiffX = jQuery('body').data('wtouchmousex') - jQuery('body').data('wtouchstartmousex');
652        jQuery('body').data('wtouchdiffx', touchDiffX);
653
654        var widthOuter = parseInt(jQuery('body').data('wtouchelement').width());
655        var left       = parseInt(jQuery('body').data('wtouchelement').children('*').css('margin-left'));
656        left           = isNaN(left) ? 0 : left;
657        var right      = parseInt(jQuery('body').data('wtouchelement').width()) - parseInt(jQuery('body').data('wtouchelement').children('*').css('margin-left')) - jQuery('body').data('wtouchelement').children('*').width();
658        right = isNaN(right) ? 0 : right;
659
660        if(left > 32){
661          jQuery('body').data('wtouchelement').children('*').animate({'margin-left' : 0});
662          jQuery('body').removeData('wtouchelement');
663          return false;
664        }
665        else if(right > 32){
666          jQuery('body').data('wtouchelement').children('*').animate({'margin-left' : String(parseInt(jQuery('body').data('wtouchelement').width()) - parseInt(jQuery('body').data('wtouchelement').children('*').width())) + 'px'});
667          jQuery('body').removeData('wtouchelement');
668          return false;
669        }
670        if(jQuery('body').data('wtouchelement').data('wtouchstartmarginleft') + touchDiffX < 0){
671          jQuery('body').data('wtouchelement').children('*').css({'margin-left' : String(jQuery('body').data('wtouchelement').data('wtouchstartmarginleft') + touchDiffX) + 'px'});
672        }
673        else{
674          jQuery('body').data('wtouchelement').children('*').css({'margin-left' : String(jQuery('body').data('wtouchelement').data('wtouchstartmarginleft') + touchDiffX) + 'px'});
675        }
676      }
677    });
678
679    jQuery(this).on('touchstart mousedown', function(event){
680      jQuery(this).children('*').stop();
681      jQuery('body').data('wtouchelement', jQuery(this));
682      jQuery(this).data('wtouchstartmarginleft', parseInt(jQuery(this).children('*').css('margin-left')));
683      jQuery(this).data('wtouchstartmargintop', parseInt(jQuery(this).children('*').css('margin-top')));
684      jQuery('body').data('wtouchstartmousex', event.originalEvent.touches ? event.originalEvent.touches[0].pageX : event.pageX);
685      jQuery('body').data('wtouchstartmousey', event.originalEvent.touches ? event.originalEvent.touches[0].pageY : event.pageY);
686    });
687
688    jQuery('body').on("touchend mouseup", function(event){
689
690      if(jQuery('body').data('wtouchelement')){
691
692        var milliseconds = (new Date()).getTime();
693        var timeDiff     = milliseconds - jQuery('body').data('timestamplast');
694        var touchDiffX   = jQuery('body').data('wtouchdiffx');
695        var lastDiffX    = jQuery('body').data('wtouchlastdiffx');
696        var lastDiffXn   = lastDiffX >= 0 ? lastDiffX : -lastDiffX;
697
698        if(lastDiffXn > 1){
699          var speedX = (Math.round((lastDiffXn > 0 ? lastDiffXn : -lastDiffXn) / timeDiff) + 1) * 5;
700          if(speedX > 200){
701            speedX = 200;
702          }
703          var movingWidth = Math.round(touchDiffX * 2 * (1 + speedX / 100));
704          if(jQuery('body').data('wtouchdiffx') < 0){
705            var right      = parseInt(jQuery('body').data('wtouchelement').width()) - parseInt(jQuery('body').data('wtouchelement').children('*').css('margin-left')) - jQuery('body').data('wtouchelement').children('*').width();
706            if(movingWidth < right){
707              movingWidth = right;
708            }
709            var duration    = (movingWidth > 0 ? movingWidth : -movingWidth) * 1.5 + Math.round(100 / speedX);
710            jQuery('body').data('wtouchelement').children('*').animate({'margin-left' : '+=' + String(movingWidth)}, {'duration' : duration, 'easing' : 'wEaseOutScroll'});
711          }
712          else{
713            var left       = parseInt(jQuery('body').data('wtouchelement').children('*').css('margin-left'));
714            if(-movingWidth < left){
715              movingWidth = -left;
716            }
717            var duration    = (movingWidth > 0 ? movingWidth : -movingWidth) * 1.5 + Math.round(100 / speedX);
718            jQuery('body').data('wtouchelement').children('*').animate({'margin-left' : '+=' + String(movingWidth)}, {'duration' : duration, 'easing' : 'wEaseOutScroll'});
719          }
720        }
721        jQuery('body').removeData('wtouchelement');
722      }
723    });
724  });
725
726  if(typeof(wHightlightBlockRootCustom) != 'undefined'){
727    wHighlightBlockRoot = wHightlightBlockRootCustom;
728  }
729  else if(typeof(wHighlightBlockRoot) == 'undefined'){
730    wHighlightBlockRoot = 'blockContentInner';
731  }  
732
733  if(wHighlightBlockRoot != 'none' && /highlight=([^&]+)/.test(decodeURIComponent(location.search.replace('+', ' ')))){
734    highlightTexts = RegExp.$1;
735    window.setTimeout(function(){
736      var highlightTextsArray = highlightTexts.split(/\s+/);
737      var elementRoot = jQuery('#' + wHighlightBlockRoot);
738      for(var j = 0; j < highlightTextsArray.length; j++){
739        var highlightText = highlightTextsArray[j];
740        var regExpWord  = new RegExp('^(?:[\\w\\W]*\\W+|)(' + highlightText.replace('+', '\\+').replace(/(\w) /, '$1\\w* +') + '\\w*)([\\w\\W]*|)$', 'gim');
741        elementRoot.find('div, p, h1, h2, h3, h4, h5, h6, li').each(function(){
742          var nodeCurrent      = jQuery(this).get(0);
743          if(nodeCurrent.tagName != 'DIV' && !/<\w+/.test(nodeCurrent.innerHTML)){
744            nodeCurrent.innerHTML = nodeCurrent.innerHTML.replace(/[\n\r\s\t]+/g, ' ');
745          }
746          for(var j = 0; j < 6; j++){
747            var childNodes       = nodeCurrent.childNodes;
748            var childNodesLength = childNodes.length;
749            for(var i = childNodesLength - 1; i >= 0; i--){
750              if(childNodes[i].nodeType == 3 && childNodes[i].nodeValue.trim() != ''){
751                if(regExpWord.test(childNodes[i].nodeValue)){  
752                  var splitedNode = childNodes[i].splitText(childNodes[i].nodeValue.length - RegExp.$1.length - RegExp.$2.length);
753                  splitedNode.nodeValue = splitedNode.nodeValue.substr(RegExp.$1.length);
754                  var highlightNode = document.createElement('span');
755                  highlightNode.className = 'wglHighlightWord';
756                  highlightNode.appendChild(document.createTextNode(RegExp.$1));
757                  splitedNode.parentNode.insertBefore(highlightNode, splitedNode);
758                }
759              }
760            }
761          }    
762        });
763        elementRoot.find('span, strong, td, a').each(function(){
764          var nodeCurrent      = jQuery(this).get(0);
765          if(nodeCurrent.className != 'wglHighlightWord'){
766            if(!/<\w+/.test(nodeCurrent.innerHTML)){
767              nodeCurrent.innerHTML = nodeCurrent.innerHTML.replace(/[\n\r\s\t]+/g, ' ');
768            }
769            for(var j = 0; j < 6; j++){
770              var childNodes       = nodeCurrent.childNodes;
771              var childNodesLength = childNodes.length;
772              for(var i = childNodesLength - 1; i >= 0; i--){
773                if(childNodes[i].nodeType == 3 && childNodes[i].nodeValue.trim() != ''){
774                  if(regExpWord.test(childNodes[i].nodeValue)){  
775                    var splitedNode = childNodes[i].splitText(childNodes[i].nodeValue.length - RegExp.$1.length - RegExp.$2.length);
776                    splitedNode.nodeValue = splitedNode.nodeValue.substr(RegExp.$1.length);
777                    var highlightNode = document.createElement('span');
778                    highlightNode.className = 'wglHighlightWord';
779                    highlightNode.appendChild(document.createTextNode(RegExp.$1));
780                    splitedNode.parentNode.insertBefore(highlightNode, splitedNode);
781                  }
782                }
783              }
784            }  
785          }    
786        });        
787      }
788    }, 160);   
789  }
790});
791
792jQuery(window).on('load resize', function(){
793	    //console.log('onload resize');
794	    wOptimizePictureSizes();
795
796	    var hasChangedMediaQuery = false;
797
798	    jQuery('#wMediaqueriesTmp > div').each(function(index){
799	      if(window.getComputedStyle){
800	        try{
801	          var computedStyle  = window.getComputedStyle(jQuery(this).get(0));
802	          var fontFamily     = computedStyle.fontFamily.replace(/"/g, '');
803	          var lastMediaQuery = jQuery(this).data('lastmediaquery') || '';
804	          if(fontFamily != lastMediaQuery){
805	            if(fontFamily.indexOf('mediaquery_') == 0){
806	              eval('if(typeof(' + fontFamily + '_onactivate) == \'function\'){' + fontFamily + '_onactivate();}');
807	            }
808	            else if(lastMediaQuery.indexOf('mediaquery_') == 0){
809	              eval('if(typeof(' + lastMediaQuery + '_ondeactivate) == \'function\'){' + lastMediaQuery + '_ondeactivate();}');
810	            }
811	            jQuery(this).data('lastmediaquery', fontFamily);
812	            hasChangedMediaQuery = true;
813	          }
814	        }
815	        catch(e){};
816	      }
817	    });
818
819	    if(hasChangedMediaQuery){
820	      jQuery("img[data-srcmin]").each(function(){
821	        var currentImg    = jQuery(this);
822	        var widthOrig     = parseInt(typeof(currentImg.attr('widthorig')) != 'undefined' ? currentImg.attr('data-widthorig') : currentImg.attr('width'));
823	        var srcMin        = currentImg.data('srcmin') ? currentImg.data('srcmin') : '';
824	        var widthCurrent  = parseInt(currentImg.width());
825	        var attrWidthCur = parseInt(typeof(currentImg.attr('width')) != 'undefined' ? currentImg.attr('width') : 0);
826	        var widthMin      = parseInt(srcMin.replace(/.*@min/, '').replace(/\..*/, ''));
827	        //var widthOuter    = parseInt(currentImg.closest('.elementStandard').width());
828	        var widthOuter    = parseInt(currentImg.parent().width());
829
830	        var diffWidthFrame = 0;
831	        if(currentImg.parent().parent().parent().parent().hasClass('picture')){
832	          diffWidthFrame = currentImg.parent().parent().parent().parent().outerWidth() - widthCurrent;
833	        }
834	        else if(currentImg.parent().parent().hasClass('picture')){
835	          diffWidthFrame = currentImg.parent().parent().outerWidth() - widthCurrent;
836	        }
837
838	        if(widthCurrent > widthOrig && widthOuter > widthOrig + diffWidthFrame + 1 && widthMin > widthOrig){
839	          currentImg.attr('src', srcMin);
840	          if(typeof(currentImg.attr('width')) != 'undefined' && currentImg.attr('width') != ''){
841	            currentImg.attr('data-widthorig', currentImg.attr('width'));
842	            currentImg.removeAttr('width');
843	            currentImg.attr('height', 'auto');
844	          }
845	        }
846	      });
847	    }
848
849	    jQuery('.wglExpandToHeighestChild').each(function(index){
850
851	      var currentElement = jQuery(this);
852	      var maxHeight      = 0;
853	      currentElement.children('*').each(function(index){
854	        if(jQuery(this).attr('data-adjusttoheighestchild') != 'no' && jQuery(this).outerHeight(true) > maxHeight){
855	          maxHeight = jQuery(this).outerHeight(true);
856	        }
857	      });
858	      if(maxHeight > 0){
859	        currentElement.css('height', String(maxHeight) + 'px');
860	      }
861	    });
862
863	    jQuery('.wglCheckWidthParent').each(function(index){
864
865	      var currentElement = jQuery(this);
866	      var widthSelf      = currentElement.attr('data-width-init') || currentElement.outerWidth();
867	      var widthParent    = currentElement.parent().width();
868	      
869	      if(currentElement.parent().hasClass('isToSmall') && !currentElement.parent().is(":visible")){
870	        currentElement.parent().removeClass('isToSmall');
871	        widthParent    = currentElement.parent().width();
872	        currentElement.parent().addClass('isToSmall');
873	      }
874	      
875	      if(!currentElement.attr('data-width-init')){
876	        currentElement.attr('data-width-init', widthSelf);
877	      }
878	      else if(currentElement.attr('data-width-init') == 0 && currentElement.parent().is(":visible")){
879	        widthSelf = currentElement.outerWidth();
880	      }
881	      
882	      if(widthParent > widthSelf){
883	        currentElement.parent().removeClass('isToSmall');
884	      }
885	      else{
886	        currentElement.parent().addClass('isToSmall');
887	      }
888	    });
889
890	    jQuery('.wglExpandToParent').each(function(index){
891
892	      var currentElement = jQuery(this);
893	      var height         = currentElement.parent().height();
894	      currentElement.css('height', String(height) + 'px');
895	    });
896	    
897	    wProcessWglAdjustHeightMax();
898	  });
899  
900
901jQuery(window).on('load resize scroll', function(event){
902
903	    var winScrollTop = jQuery(window).scrollTop();
904
905	    if(wUiTmp['lastScrollTop']){
906	      if(winScrollTop <= 0){
907	        if(wUiTmp['lastScrollStatus'] != 'top'){
908	          document.documentElement.className = document.documentElement.className.replace(' scrolled-top', '').replace(' scrolldirection-down', '').replace(' scrolldirection-up', '') + ' scrolled-top';
909	        }
910	        wUiTmp['lastScrollStatus'] = 'top';
911	      }
912	      else if(winScrollTop < wUiTmp['lastScrollTop']){
913	        if(wUiTmp['lastScrollStatus'] != 'scrollup'){
914	          document.documentElement.className = document.documentElement.className.replace(' scrolled-top', '').replace(' scrolldirection-down', '') + ' scrolldirection-up';
915	        }
916	        wUiTmp['lastScrollStatus'] = 'scrollup';
917	      }
918	      else if(winScrollTop > wUiTmp['lastScrollTop']){
919	        if(wUiTmp['lastScrollStatus'] != 'scrolldown'){
920	          document.documentElement.className = document.documentElement.className.replace('scrolled-top', '').replace(' scrolldirection-up', '') + ' scrolldirection-down';
921	        }
922	        wUiTmp['lastScrollStatus'] = 'scrolldown';
923	      }
924	    }
925
926	    wUiTmp['lastScrollTop'] = winScrollTop;
927
928	    var winHeight    = jQuery(window).height();
929	    jQuery('img.wglLazyLoadInit').each(function(index){
930
931	      var currentImg   = jQuery(this);
932	      var offsetTop    = parseInt(currentImg.offset().top);
933	      var srcMin       = currentImg.data('srcmin') ? currentImg.data('srcmin') : '';
934	      var widthCurrent = parseInt(currentImg.width());
935	      var attrWidthCur = parseInt(typeof(currentImg.attr('width')) != 'undefined' ? currentImg.attr('width') : 0);
936	      var widthMin     = parseInt(srcMin.replace(/.*@min/, '').replace(/\..*/, ''));
937
938	      var isVisibleComponent = true;
939
940	      if(currentImg.attr('data-maxwidthifinvisible') && currentImg.attr('data-maxwidthifinvisible') > widthCurrent){
941	        widthCurrent = currentImg.attr('data-maxwidthifinvisible');
942	      }
943
944	      //console.log(widthCurrent);
945	      //console.log(srcMin)
946	      //console.log(currentImg.get(0));
947
948	      //if(currentImg.hasClass('listEntryImage')){
949	        if(!currentImg.is(':visible')){
950	          isVisibleComponent = false;
951	          closestElement = currentImg.closest('.elementList');
952	          if(closestElement.length > 0 && closestElement.is(':visible')){
953	            if(closestElement.offset().top < winScrollTop + winHeight){
954	              isVisibleComponent = true;
955	            }
956	          }
957	        }
958	      //}
959
960	      if(isVisibleComponent || wUiTmp['isMediaPrint'] || wUiTmp['isViewmodePrint']){
961	        if((offsetTop < winScrollTop + winHeight ) || wUiTmp['isMediaPrint'] || wUiTmp['isViewmodePrint']){
962	          if(devicePixelRatio >= hdLimitDpr && typeof(currentImg.attr('data-src2x')) != 'undefined' && currentImg.attr('data-src2x') != '' && attrWidthCur < widthCurrent * 2 && currentImg.attr('data-ishd') != '1'){
963	            currentImg.attr('src', currentImg.data('src2x'));
964	            currentImg.attr('data-ishd', '1');
965	          }
966	          else if(typeof(currentImg.attr('data-srcmin')) != 'undefined' && currentImg.attr('data-srcmin') != '' && widthCurrent < widthMin && widthMin < attrWidthCur && currentImg.attr('data-ismin') != '1' && currentImg.attr('data-ishd') != '1' && currentImg.attr('data-isld') != '1'){
967	            currentImg.attr('src', currentImg.data('srcmin'));
968	            currentImg.attr('data-ismin', '1');
969	          }
970	          else if(typeof(currentImg.attr('data-src')) != 'undefined' && currentImg.attr('data-src') != '' && currentImg.attr('data-ishd') != '1' && currentImg.attr('data-isld') != '1'){
971	            if(currentImg.data('src').indexOf('@px') != -1){
972	              try{
973	                if(currentImg.get(0).getBoundingClientRect()['width'] - widthCurrent == -0.5){
974	                  currentImg.get(0).style.width    = 'calc(100% + 0.5px)';
975	                  currentImg.get(0).style.maxWidth = 'calc(100% + 0.5px)';
976	                }
977	              }
978	              catch(e){console.log(e)}
979	              currentImg.attr('src', currentImg.data('src').replace('@px', '@' + (devicePixelRatio >= hdLimitDpr ? widthCurrent * 2 : widthCurrent) + 'px'));
980	            }
981	            else{
982	              currentImg.attr('src', currentImg.data('src'));
983	              currentImg.attr('data-isld', '1');
984	            }
985	          }
986	          if(currentImg.parent().prop('tagName') == 'PICTURE'){
987	            currentImg.parent().children('source').each(function(){
988	              jQuery(this).attr('media', jQuery(this).attr('media').replace('wlazyload and ', ''));
989	            });
990	          }
991	          currentImg.removeClass('wglLazyLoadInit');
992	        }
993	      }
994	    });
995
996  jQuery('.wglReader[data-init!="1"]').each(function(index){
997    
998    if(window.speechSynthesis){
999      var currentElement = jQuery(this);      
1000      var textToRead     = currentElement.get(0).innerText;
1001
1002      if(textToRead != ''){
1003        if(currentElement.data('readertarget') == 'prepend'){
1004          var readerHTML = '<div class="wReaderPanelEmbed"><div class="wButtonStartReading" onclick="wStartReadingText(this.parentNode.parentNode, this.parentNode)"></div><div class="wButtonPauseReading" onclick="wPauseReadingText(this.parentNode.parentNode, this.parentNode)"></div><div class="wButtonStopReading" onclick="wStopReadingText(this.parentNode.parentNode, this.parentNode)"></div></div>';
1005          currentElement.prepend(readerHTML);        
1006        }
1007        else{
1008          var readerHTML = '<div class="wReaderPanelEmbed"><div class="wButtonStartReading" onclick="wStartReadingText(this.parentNode.nextSibling, this.parentNode)"></div><div class="wButtonPauseReading" onclick="wPauseReadingText(this.parentNode.nextSibling, this.parentNode)"></div><div class="wButtonStopReading" onclick="wStopReadingText(this.parentNode.nextSibling, this.parentNode)"></div></div>';
1009          currentElement.before(readerHTML);
1010        }
1011      }
1012
1013      currentElement.attr('data-init', '1');
1014    }  
1015  });
1016	    
1017  jQuery('.wglCountUp[data-init!="1"]').each(function(index){
1018
1019    var currentElement = jQuery(this);
1020    var nodeName = currentElement.get(0).nodeName;
1021
1022    if(typeof(wEditor) != 'undefined'){
1023      currentElement.attr('data-init', '1');
1024      return false;
1025    }
1026
1027    var offsetTop = parseInt(currentElement.offset().top);
1028    if(offsetTop > winScrollTop + winHeight){
1029      return false;
1030    }
1031
1032    currentElement.attr('data-init', '1');
1033    var currentDataOrig = currentElement.data();
1034    var currentData     = {};
1035
1036    for(key in currentDataOrig){
1037      currentData[key.toLowerCase()] = currentDataOrig[key];
1038    }
1039
1040    currentData['countupFrom']      = currentData['countupfrom'] || 0;
1041    currentData['countupTo']        = currentData['countupto'] || currentElement.html();
1042    currentData['countupDecimals']  = currentData['countupdecimals'] || 0;  
1043    currentData['countupDuration']  = currentData['countupduration'] || 2;
1044    currentData['countupInitdelay'] = currentData['countupinitdelay'] || 1000;
1045    currentData['countupPrefix']    = currentData['countupprefix'] || '';
1046    currentData['countupSuffix']    = currentData['countupsuffix'] || '';
1047   
1048    if(/^([^\d\,\.]*)([\d\,\.]+)([^\d\,\.]*)$/.test(currentData['countupTo'])){
1049      currentData['countupPrefix'] = RegExp.$1;
1050      currentData['countupTo']     = RegExp.$2;
1051      currentData['countupSuffix'] = RegExp.$3;
1052    }
1053    
1054    currentData['countupSeperator'] = '';
1055    
1056    if(/^\d+\.\d\d\d/.test(currentData['countupFrom']) || /^\d+\.\d\d\d/.test(currentData['countupTo'])){
1057      currentData['countupSeperator'] = true;      
1058    }
1059    
1060    if(currentData['countupSeperator'] != ''){
1061      currentData['countupFrom'] = String(currentData['countupFrom']).replace(/^(\d+)\.(\d\d\d)/, '$1$2').replace(/^(\d+)\.(\d\d\d)/, '$1$2').replace(/^(\d+)\.(\d\d\d)/, '$1$2');      
1062      currentData['countupTo']   = String(currentData['countupTo']).replace(/^(\d+)\.(\d\d\d)/, '$1$2').replace(/^(\d+)\.(\d\d\d)/, '$1$2').replace(/^(\d+)\.(\d\d\d)/, '$1$2');            
1063    }    
1064 
1065    valueToSet = String(currentData['countupFrom']);  
1066        
1067    currentData['countupTo'] = currentData['countupTo'].replace(',', '.');
1068    if(currentData['countupTo']){
1069      if(/^\d+\.(\d+)$/.test(currentData['countupTo'])){
1070        currentData['countupDecimals'] = RegExp.$1.length;
1071      }
1072      else if(/^([\d\,\.]+)$/.test(currentData['countupTo'])){
1073        
1074      }
1075      else{
1076        return false;
1077      }
1078    }
1079    else{
1080      return false;
1081    }
1082    
1083    if(currentData['countupDecimals'] > 0){
1084      valueToSet = parseFloat(valueToSet).toFixed(currentData['countupDecimals']).replace('.', ',');
1085    }
1086    else{ 
1087      valueToSet = String(Math.ceil(valueToSet));      
1088      if(currentData['countupSeperator'] != ''){
1089        valueToSet = valueToSet.replace(/(\d)(\d{3})$/, '$1.$2');
1090        valueToSet = valueToSet.replace(/(\d)(\d{3})\./, '$1.$2.');            
1091        valueToSet = valueToSet.replace(/(\d)(\d{3})\./, '$1.$2.');             
1092      }                 
1093    }    
1094
1095    if(nodeName == 'text'){
1096      currentElement.get(0).textContent = currentData['countupPrefix'] + valueToSet + currentData['countupSuffix'];
1097    }  
1098    else{
1099      currentElement.html(currentData['countupPrefix'] + valueToSet + currentData['countupSuffix']);
1100    }  
1101    
1102    var timeoutInit = 25;
1103    var timeout     = timeoutInit;
1104    window.setTimeout(function(){
1105            
1106      //console.log(currentData);
1107      
1108      var intervalCountup = window.setInterval(function(){
1109        if(timeout < 0.5){
1110          timeout -= 0.02;
1111        }
1112        else if(timeout < 2){
1113          timeout -= 0.05;
1114        }
1115        else if(timeout < 3){
1116          timeout -= 0.14;
1117        }
1118        else if(timeout < 4){
1119          timeout -= 0.4;
1120        }
1121        else{
1122          timeout--;
1123        }
1124
1125        var valueToSet = (currentData['countupTo'] - currentData['countupFrom']) / timeoutInit * (timeoutInit - timeout) + parseFloat(currentData['countupFrom']);      
1126
1127        if(timeout <= 0.1){
1128          window.clearInterval(intervalCountup);
1129          valueToSet = currentData['countupTo'];
1130        }
1131
1132        if(currentData['countupDecimals'] > 0){
1133          valueToSet = String(parseFloat(valueToSet).toFixed(currentData['countupDecimals']).replace('.', ','));
1134          if(currentData['countupSeperator'] != ''){
1135            if(/(\d+)\,(\d+)/.test(valueToSet)){
1136              var valueToSetBefore = RegExp.$1;
1137              var valueToSetAfter  = RegExp.$2;   
1138              valueToSetBefore = valueToSetBefore.replace(/(\d)(\d{3})$/, '$1.$2');
1139              valueToSetBefore = valueToSetBefore.replace(/(\d)(\d{3})\./, '$1.$2.');            
1140              valueToSetBefore = valueToSetBefore.replace(/(\d)(\d{3})\./, '$1.$2.');                 
1141              valueToSet = valueToSetBefore + ',' + valueToSetAfter;
1142            }                        
1143          }                  
1144        }
1145        else{
1146          valueToSet = String(Math.ceil(valueToSet));
1147        
1148          if(currentData['countupSeperator'] != ''){
1149            valueToSet = valueToSet.replace(/(\d)(\d{3})$/, '$1.$2');
1150            valueToSet = valueToSet.replace(/(\d)(\d{3})\./, '$1.$2.');            
1151            valueToSet = valueToSet.replace(/(\d)(\d{3})\./, '$1.$2.');             
1152          }            
1153        }
1154        
1155        if(nodeName == 'text'){        
1156          currentElement.get(0).textContent = currentData['countupPrefix'] + valueToSet + currentData['countupSuffix'];
1157        }
1158        else{
1159          currentElement.html(currentData['countupPrefix'] + valueToSet + currentData['countupSuffix']);          
1160        }
1161        //console.log(valueToSet);
1162      }, parseInt(currentData['countupDuration'] * 500 / timeoutInit));
1163    }, currentData['countupInitdelay']);
1164  });
1165
1166	    jQuery('.wglAnimateIfVisibleOnce').each(function(index){
1167	      var currentElement = jQuery(this);
1168	      var offsetTop      = parseInt(currentElement.offset().top);
1169	      if(offsetTop < winScrollTop + winHeight || location.href.indexOf('viewmode=print') != -1){
1170	        currentElement.addClass('wglAnimateIfVisibleOnceVisible');
1171	        currentElement.removeClass('wglAnimateIfVisibleOnce');
1172	      }
1173	    });
1174
1175	    jQuery('.wglAnimateIfVisible').each(function(index){
1176	      var currentElement = jQuery(this);
1177	      var offsetTop      = parseInt(currentElement.offset().top);
1178	      var offsetHeight   = parseInt(currentElement.outerHeight());
1179	      if((offsetTop < winScrollTop + winHeight && offsetTop + offsetHeight > winScrollTop) || location.href.indexOf('viewmode=print') != -1){
1180	        currentElement.addClass('isVisibleOnce');
1181	        currentElement.addClass('isVisible');
1182	        currentElement.removeClass('isInvisible');
1183	      }
1184	      else{
1185	        currentElement.addClass('isInvisible');
1186	        currentElement.removeClass('isVisible');
1187	      }
1188	    });
1189	    
1190	    jQuery('.wglKeepInsideTopOnScroll').each(function(index){
1191	      var currentElement = jQuery(this);
1192	      var elementMoved   = null;
1193	      var offsetTop      = parseInt(currentElement.offset().top);
1194	      var diffTop        = offsetTop - winScrollTop;
1195	      var moveID         = '';
1196
1197	      if(diffTop < 0){
1198	        if(currentElement.attr('data-hasmoved') != '1'){
1199	          if(!jQuery('.wglContainerInsideTopOnScroll').length){
1200	            jQuery('body').prepend('<div class="wglContainerInsideTopOnScroll"></div>');
1201	          }
1202	          currentElement.attr('data-hasmoved', '1');
1203	          moveID = String(parseInt(Math.random() * 1000000));
1204
1205	          if(typeof(currentElement.attr('data-moveidsource')) == 'undefined'){
1206	            currentElement.attr('data-moveidsource', moveID);
1207	          }
1208	          else{
1209	            moveID = currentElement.attr('data-moveidsource');
1210	          }
1211
1212	          currentElement.before('<div id="moveidsource-' + moveID + '" class="wglKeepInsideTopOnScroll" data-hasmoved="1" data-moveidsource="' + moveID + '"></div>');
1213	          currentElement.removeAttr('data-moveidsource').attr('data-moveidtarget', moveID).attr('data-moveidtarget', moveID).appendTo('.wglContainerInsideTopOnScroll').addClass('moved-init').removeClass('wglKeepInsideTopOnScroll').removeClass('restored-init').removeClass('restored-ready');
1214	          window.setTimeout(function(){
1215	            currentElement.removeClass('moved-init').addClass('moved-ready');
1216	          }, 10);
1217	          height = currentElement.height();
1218	          jQuery('#' + 'moveidsource-' + moveID).css('height', String(height) + 'px');
1219	        }
1220	        else{
1221	          height = jQuery(".wglContainerInsideTopOnScroll *[data-moveidtarget='" + currentElement.attr('data-moveidsource') + "']").height();
1222	          currentElement.css('height', String(height) + 'px');
1223	        }
1224	      }
1225	      else if(currentElement.attr('data-hasmoved') == '1'){
1226	        if(currentElement.parent().attr('id') == 'blockMainInner') currentElement.css('display', 'none');
1227	        moveID = currentElement.attr('data-moveidsource');
1228	        elementMoved = jQuery(".wglContainerInsideTopOnScroll *[data-moveidtarget='" + moveID + "']");
1229	        currentElement.before(elementMoved.addClass('wglKeepInsideTopOnScroll').removeClass('moved-init').removeClass('moved-ready').addClass('restored-init').removeAttr('data-hasmoved'));
1230	        window.setTimeout(function(){
1231	          if(currentElement.html() == ''){
1232	            currentElement.remove();
1233	          }            
1234	          elementMoved.removeClass('restored-init').addClass('restored-ready');
1235	        }, 10);
1236	      }
1237	    });
1238
1239	    var idTopSection = '', titleSection = '', currentElement, nearestPositionTop = 100000, elementPositionTop = 0;
1240
1241	    var offsetTopFixed = jQuery('.wglContainerInsideTopOnScroll').outerHeight();
1242
1243	    jQuery('.elementSection').each(function(index){
1244	      currentElement = jQuery(this);
1245	      elementPositionTop  = parseInt(currentElement.offset().top) - winScrollTop - offsetTopFixed;
1246	      if(elementPositionTop < winHeight - 128 && (elementPositionTop >= 0 && elementPositionTop < nearestPositionTop || elementPositionTop < 0 && elementPositionTop * -1 < nearestPositionTop)){
1247	        nearestPositionTop = (elementPositionTop > 0 ? elementPositionTop : - elementPositionTop);
1248	        titleSection       = currentElement.attr('id');
1249	      }
1250	    });
1251
1252	    if(titleSection != '' && titleSection != wUiTmp['lastSectionSelected']){
1253	      jQuery(".elementNavigationSections li").removeClass('selected');
1254	      jQuery(".elementNavigationSections li > a[href='#" + titleSection + "']").parent().addClass('selected');
1255	      wUiTmp['lastSectionSelected'] = titleSection;
1256	    }
1257    	
1258        wUiTmp['hasToAdaptParallax'] = true;
1259  		if(!wUiTmp['adaptParallax']){
1260    		window.requestAnimationFrame(wAdaptParallax);
1261        	wUiTmp['adaptParallax'] = true;
1262 		}
1263	    
1264  });
1265  
1266jQuery('body').on("touchmove", function(event){
1267  wAdaptParallax(event);
1268});
1269
1270jQuery(window).on("touchend", function(event){
1271  wAdaptParallax(event);
1272});
1273	  
1274jQuery(window).on('mousewheel DOMMouseScroll', function (event){
1275  jQuery('body, html').stop(true, true);
1276});  
1277
1278wglValidateElementInline = function(currentInputElement, options){
1279
1280    var currentInput = jQuery(currentInputElement);
1281
1282    var formPos      = currentInput.closest('form').attr('data-formpos');
1283    var formAction   = currentInput.closest('form').attr('action');
1284
1285    var elementName = currentInput.attr('name');
1286    elementName = elementName.replace('[]', '');
1287
1288    var elementValue = currentInput.val();
1289    if(currentInput.attr('type') == 'checkbox'){
1290      elementValue = '';
1291      currentInput.parent().parent().find('input').each(function(){
1292        elementValue += (jQuery(this).get(0).checked ? jQuery(this).val() : '');
1293      });
1294    }
1295    else if(currentInput.attr('type') == 'radio'){
1296      elementValue = '';
1297      currentInput.parent().parent().find('input').each(function(){
1298        elementValue += (jQuery(this).get(0).checked ? jQuery(this).val() : '');
1299      });
1300    }
1301    else if(currentInput.prop("tagName") == 'SELECT' && currentInput.attr('multiple') == 'multiple'){
1302      elementValue = '';
1303      currentInput.children().each(function(){
1304        elementValue += (jQuery(this).get(0).selected ? jQuery(this).val() : '');
1305      });
1306    }
1307
1308    if(elementValue == null){
1309      elementValue = '';
1310    }
1311  
1312    if(typeof(wTrimInputsBeforeValidateOnBlur) != 'undefined' && wTrimInputsBeforeValidateOnBlur && event && event.type == 'blur'){
1313      if(currentInput.prop("nodeName") == 'TEXTAREA' || currentInput.attr("type") == 'text'){
1314        currentInput.val(currentInput.val().trim());
1315        elementValue = currentInput.val();
1316      }
1317    }
1318
1319    var urlValidation = formAction + '?action=ve&en=' + elementName + '&ev=' + encodeURIComponent(elementValue);
1320
1321    jQuery.ajax({type: "GET", async: true, dataType: "json", url: urlValidation,
1322      success: function(result){
1323
1324        elementsWithValidationClass = currentInput;
1325
1326        var validationID = formPos + (elementsWithValidationClass.attr('id') ? elementsWithValidationClass.attr('id') : '');                
1327        
1328        if(currentInput.attr('type') == 'checkbox' || currentInput.attr('type') == 'radio'){
1329          validationID                = formPos + (elementsWithValidationClass.attr('name').replace('[]', '') ? elementsWithValidationClass.attr('name').replace('[]', '') : '');  
1330          elementsWithValidationClass = elementsWithValidationClass.parent().parent().children();
1331        }
1332
1333        var elementToAddError = elementsWithValidationClass.parent();
1334
1335        if(elementsWithValidationClass.parent().prev('dt').length != 0){
1336          elementToAddError = elementsWithValidationClass.parent().prev('dt');
1337        }
1338        else if(elementsWithValidationClass.parent().prev('div').length != 0){
1339          elementToAddError = elementsWithValidationClass.parent().prev('div');
1340        }
1341        
1342        var elementToAddOK = elementsWithValidationClass.parent();
1343
1344        if(elementsWithValidationClass.attr('name') && elementsWithValidationClass.closest('form').find('label[for="' + elementsWithValidationClass.attr('name').replace('[]', '') + '"]')){
1345          elementToAddOK = elementsWithValidationClass.closest('form').find('label[for="' + elementsWithValidationClass.attr('name').replace('[]', '') + '"]');
1346        }
1347        else if(elementsWithValidationClass.parent().prev('dt').length != 0 && elementsWithValidationClass.parent().prev('dt').find('label')){       
1348          elementToAddOK = elementsWithValidationClass.parent().prev('dt').find('label');
1349        }
1350        else if(elementsWithValidationClass.parent().prev('div').length != 0 && elementsWithValidationClass.parent().prev('div').find('label')){          
1351          elementToAddOK = elementsWithValidationClass.parent().prev('div').find('label');
1352        }        
1353
1354        if(!result['isValid']){
1355          elementsWithValidationClass.addClass('wglIsInvalid');
1356          elementsWithValidationClass.removeClass('wglIsValid');
1357
1358          jQuery('#validationStatus_' + validationID).remove();
1359
1360          if(result['errorMessage'] != ''){
1361            if(jQuery('#errorMessage_' + validationID).length == 0){
1362              elementToAddError.addClass('wglContainsErrorMessageInline').append('<div class="wglErrorMessageInline" id="errorMessage_' + validationID + '"><div>' + result['errorMessage'] + '</div></div>');
1363              if(elementToAddError.addClass('wglContainsErrorMessageInline').find('label').length == 2){
1364                if(currentInput.attr('id') == elementToAddError.addClass('wglContainsErrorMessageInline').find('label').attr('for')){
1365                  jQuery('#errorMessage_' + validationID).css({'right' : String(Math.round(elementToAddError.addClass('wglContainsErrorMessageInline').width() - elementToAddError.addClass('wglContainsErrorMessageInline').find('label').width())) + 'px'});
1366                }
1367              }              
1368              (function(validationID){
1369                window.setTimeout(function(){
1370                  jQuery('#errorMessage_' + validationID).addClass("loaded");
1371                }, 32);
1372              })(validationID);
1373            }
1374          }
1375        }
1376        else{
1377          elementsWithValidationClass.removeClass('wglIsInvalid');
1378          elementsWithValidationClass.addClass('wglIsValid');
1379
1380          jQuery('#errorMessage_' + validationID).remove();
1381          if(elementToAddError.find('.wglErrorMessageInline').length == 0){
1382            elementToAddError.removeClass('wglContainsErrorMessageInline');
1383            elementToAddError.find('.wglErrorMessageInline').remove();
1384          }
1385
1386          if(jQuery('#validationStatus_' + validationID).length == 0){
1387            elementToAddOK.addClass('wglContainsValidationStatusInline').append('<div class="wglValidationStatusOK" id="validationStatus_' + validationID + '"><div></div></div>');
1388            (function(validationID){
1389              window.setTimeout(function(){
1390                jQuery('#validationStatus_' + validationID).addClass("loaded");
1391              }, 32);
1392            })(validationID);
1393          }
1394        }
1395      }
1396    });
1397  };
1398
1399wPrepareHTML = function(root){
1400
1401  if(!root){
1402    root = jQuery('body');
1403  }
1404
1405  jQuery("a[data-ajaxurl]").each(function(){
1406    var thisElement = jQuery(this);
1407    var ajaxURL     = thisElement.data('ajaxurl');
1408    thisElement.on('click', function (event){
1409      jQuery.ajax({type: "GET", url: ajaxURL, success: function(result){
1410        var elementTarget = thisElement.parent().parent();
1411        elementTarget.fadeTo(0, 0);
1412        elementTarget.html(result);
1413        history.pushState({page: thisElement.attr('href')}, '', thisElement.attr('href'));
1414        wPrepareHTML(elementTarget.get(0));
1415        elementTarget.fadeTo(600, 1);
1416        wScrollSmoothToElement(elementTarget.get(0), {'targetPos' : 'top'});
1417
1418        for(var addClassSelector in wCssClassesToAddGlobal){
1419          jQuery(addClassSelector).each(function(index){
1420            var classesToAdd = wCssClassesToAddGlobal[addClassSelector];
1421            for(var i = 0, arrayLength = classesToAdd.length; i < arrayLength; i++){
1422              var classData = classesToAdd[i].split('=');
1423              if(classData.length == 2){
1424                var selector = jQuery.trim(classData[0]);
1425                if(selector == '.'){
1426                  jQuery(this).addClass(jQuery.trim(classData[1]));
1427                }
1428                else if(selector == 'parent'){
1429                  jQuery(this).parent().addClass(jQuery.trim(classData[1]));
1430                }
1431                else{
1432                  jQuery(this).find(selector).addClass(jQuery.trim(classData[1]));
1433                }
1434              }
1435              else{
1436                jQuery(this).addClass(jQuery.trim(classData[0]));
1437              }
1438            }
1439          });
1440        }
1441
1442        if(typeof(wOnAfterReloadElementByAjaxUrl) == 'function'){     
1443          wOnAfterReloadElementByAjaxUrl(elementTarget);
1444        }            
1445
1446        window.setTimeout(function(){
1447          jQuery(window).trigger('resize');
1448        }, 100);
1449      }});
1450      return false;
1451    });
1452  });
1453};
1454
1455wScrollSmoothToElement = function(elementTarget, options){
1456
1457  var id, offsetTopFixed, scrollTop;
1458
1459  options = options || {};
1460
1461  elementTarget = jQuery(elementTarget);
1462
1463  var currentTimestamp = new Date().getTime();
1464  if(elementTarget.length > 0 && !elementTarget.attr('data-lct') || elementTarget.attr('data-lct') < currentTimestamp - 320){
1465    elementTarget.attr('data-lct', currentTimestamp);
1466
1467    try{
1468      jQuery('body, html').stop(true, true);
1469      scrollDuration = parseInt(elementTarget.attr('data-scrollsmoothtotargetduration') ? elementTarget.attr('data-scrollsmoothtotargetduration') : 400);
1470
1471      offsetTopFixed    = jQuery('#blockTop').height() + jQuery('#blockHeader').height();
1472
1473      var visibleMin    = document.body.scrollTop + offsetTopFixed;
1474      var visibleMax    = visibleMin + jQuery(window).height();
1475      var posTopElement = elementTarget.offset().top;
1476
1477      //console.log(visibleMin + ' < ' + posTopElement + ' < ' + visibleMax);
1478
1479      if(posTopElement > visibleMin && posTopElement < visibleMax){
1480        return true;
1481      }
1482
1483      //console.log(posTopVisible);
1484      //console.log(winHeight);
1485
1486      wUiTmp['scrollingAuto'] = true;
1487
1488      jQuery('body, html').animate({scrollTop: elementTarget.offset().top - offsetTopFixed}, {duration: scrollDuration, complete: function(){
1489        offsetTopFixed = jQuery('.wglContainerInsideTopOnScroll').height() + jQuery('#blockHeader').height();
1490        if(offsetTopFixed > 0){
1491          jQuery('body, html').animate({scrollTop: elementTarget.offset().top - offsetTopFixed}, {duration: scrollDuration, complete: function(){
1492            wUiTmp['scrollingAuto'] = false;
1493            jQuery(window).trigger('resize');
1494          }});
1495        }
1496        else{
1497          wUiTmp['scrollingAuto'] = false;
1498          jQuery(window).trigger('resize');
1499        }
1500      }});
1501      return false;
1502    }
1503    catch(e){console.log(e)}
1504  }
1505};
1506
1507jQuery.extend(jQuery.easing, {
1508  wEaseOutScroll: function(x, t, b, c, d){
1509    return (t == d) ? b + c : b + c * (-Math.pow(1.5, -20 * t / d) + 1);
1510  }
1511});
1512
1513////////////////////////////////////////////////////////////////
1514//
1515// @method void addAnalytics()
1516//
1517// @desc Überwacht Links mit Google Analytics
1518//
1519// @return void
1520//
1521////////////////////////////////////////////////////////////////
1522
1523jQuery.fn.wAddAnalytics = function(viewmode){
1524
1525  jQuery.each($(this), function(){
1526    jQuery(this).click(function(){ga('send', {'hitType': 'pageview', 'page': jQuery(this).attr('href'), 'title': jQuery(this).attr('title')})});
1527  });
1528};
1529
1530////////////////////////////////////////////////////////////////
1531//
1532// @method void setViewmode(viewmode)
1533//
1534// @desc Setzt den Ansichtsmodus eines Links
1535//
1536// @param viewmode Ansichtmodus
1537//
1538// @return void
1539//
1540////////////////////////////////////////////////////////////////
1541
1542jQuery.fn.wSetViewmode = function(viewmode){
1543
1544  jQuery.each(jQuery(this), function(){
1545
1546    var hrefNew = this.getAttribute('href') || '';
1547    var anchor  = '';
1548    if(/#[^#]+$/.test(hrefNew)){
1549      anchor  = hrefNew.replace(/.*#/, '');
1550      hrefNew = hrefNew.replace(/#.*/, '');
1551    }
1552
1553    hrefNew = hrefNew.indexOf('?') != -1 ? hrefNew + '&viewmode=' + viewmode: hrefNew + '?viewmode=' + viewmode;
1554
1555    if(anchor != ''){
1556      hrefNew += '#' + anchor;
1557    }
1558    if(this.className.indexOf('boxOnly') == -1 && this.innerHTML.indexOf('<img ') != -1){
1559      this.style.background  = 'none';
1560      this.style.paddingLeft = 'none';
1561    }
1562    this.setAttribute('href', hrefNew);
1563  });
1564};
1565
1566////////////////////////////////////////////////////////////////
1567//
1568// @method void wOpenPrintPreview(url)
1569//
1570// @desc Öffnet die aktuelle Seite in der Druckvorschau
1571//
1572// @return void
1573//
1574////////////////////////////////////////////////////////////////
1575
1576wOpenPrintPreview = function(width, height, name){
1577
1578  var name = name || 'printpreview';
1579
1580  var url = location.href.indexOf('?') == -1 ? location.href.replace(/#.*/, '') + '?viewmode=print' : location.href.replace(/#.*/, '') + '&viewmode=print';
1581
1582  options = ',location=no,menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=no';
1583
1584  wOpenPopupURL(url, width, height, name, options);
1585};
1586
1587////////////////////////////////////////////////////////////////
1588//
1589// @method void wOpenURL(url)
1590//
1591// @desc Öffnet eine Seite
1592//
1593// @return void
1594//
1595////////////////////////////////////////////////////////////////
1596
1597wOpenURL = function(url, target, event){
1598
1599  if(location.pathname.indexOf('/weblication/grid5/') != 0){
1600    if(target == '_blank'){
1601      var windowOpen;
1602      windowOpen = window.open(url);
1603      windowOpen.opener = null;
1604      windowOpen.location = url;
1605    }
1606    else if(target == '_top'){
1607      top.location.href = url;
1608    }
1609    else if(target == 'box'){
1610      var widthFancybox = '80%';
1611      var heightFancybox = '80%';
1612
1613      if(jQuery(window).width() <= 480){
1614        widthFancybox = '100%';
1615      }
1616
1617      if(typeof(lightboxType) != 'undefined' && lightboxType == 'wLightbox' && !/MSIE\s*(7|8)/.test(navigator.appVersion)){
1618        wLightbox({"type": "iframe", "href" : url, "class": "default", "width": widthFancybox, "height": heightFancybox});
1619      }
1620      else if(jQuery.fancybox && jQuery.fancybox.version && parseInt(String(jQuery.fancybox.version).replace(/(\d+\.\d+)\.\d+/, '$1')) >= 2){
1621        if(/box\w*\-(\d+)\-(\d+)/.test(target)){
1622          widthFancybox  = RegExp.$1 + 'px';
1623          heightFancybox = RegExp.$2 + 'px';
1624          jQuery.fancybox({"type": "iframe", "href" : url, "width": widthFancybox, "maxHeight": heightFancybox, "titlePosition": "inside", helpers : {title : {type : 'inside'}, overlay : {css : {'background' : 'rgba(0, 0, 0, 0.2)'}}}});
1625        }
1626        else{
1627          jQuery.fancybox({"type": "iframe", "href" : url, "width": widthFancybox, "minHeight": '80%', "titlePosition": "inside", helpers : {title : {type : 'inside'}, overlay : {css : {'background' : 'rgba(0, 0, 0, 0.2)'}}}});
1628        }
1629      }
1630      else{
1631        jQuery.fancybox({"type": "iframe", "href" : url, "width": widthFancybox, "height": '80%', "titlePosition": "inside", "transitionIn" : "none", "transitionOut" : "none", "hideOnContentClick": true, "zoomOpacity": true, "zoomSpeedChange": 200, "zoomSpeedIn": 400, "zoomSpeedOut": 400, "overlayShow": false, "overlayOpacity": 1});
1632      }
1633    }
1634    else{
1635      if(url.indexOf('#') == 0){
1636        wScrollSmoothToElement(url);
1637      }
1638      else {
1639        location.href = url;
1640      }
1641    }
1642  }
1643};
1644
1645////////////////////////////////////////////////////////////////
1646//
1647// @method void wOpenPopupURL(url, width, height, name, options)
1648//
1649// @desc Öffnet eine Seite in einem Popup
1650//
1651// @return void
1652//
1653////////////////////////////////////////////////////////////////
1654
1655wOpenPopupURL = function(url, width, height, name, options){
1656
1657  var name = name || '';
1658
1659  if(width == '' || width == ' ' || typeof(width) == 'undefined'){
1660    width = 786;
1661  }
1662  if(height == '' || height == ' ' || typeof(height) == 'undefined'){
1663    height = 677;
1664  }
1665
1666  url = url.replace(/&amp;/g, '&');
1667  options = options || ',location=no,menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=no';
1668
1669  width   = parseInt(width);
1670  height  = parseInt(height);
1671
1672  var posLeft = (screen.width / 2)  - (width  / 2);
1673  var posTop  = (screen.height / 2) - (height / 2);
1674  var windowOpen;
1675  windowOpen = window.open(url, name, 'top='+posTop+',left='+posLeft+',width='+width+',height='+height+',' + options);
1676  if(!/^\/\w+/.test(url)){
1677      windowOpen.opener = null;
1678      windowOpen.location = url;
1679  }
1680};
1681
1682////////////////////////////////////////////////////////////////
1683//
1684// @method void wSetParameterAndReload(name, value)
1685//
1686// @desc Setzt einen Parameter und lädt die Seite neu
1687//
1688// @return void
1689//
1690////////////////////////////////////////////////////////////////
1691
1692wSetParameterAndReload = function(name, value){
1693  
1694  var url = location.href;
1695  var paramReg = new RegExp('([\?|\&])' + name + '=([^\&]+)');
1696  if(paramReg.test(location.search)){
1697    url = url.replace(paramReg, RegExp.$1 + name + '=' + value);
1698  }
1699  else if(url.indexOf('?') != -1){
1700    url += '&' + name + '=' + value;
1701  }
1702  else{
1703    url += '?' + name + '=' + value;
1704  }
1705  location.href = url;
1706};
1707
1708////////////////////////////////////////////////////////////////
1709//
1710// @method void wDisableAnalytics()
1711//
1712// @desc Deaktiviert Google Analytics per Cookie
1713//
1714// @return void
1715//
1716////////////////////////////////////////////////////////////////
1717
1718wDisableAnalytics = function(){
1719
1720  document.cookie = 'disableGoogleAnalytics=1; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
1721  if(window['gaId']){
1722    window['ga-disable-' + window['gaId']] = true;
1723  }
1724  else if(typeof(gaOptout) != 'undefined'){
1725    gaOptout();    
1726  }
1727};
1728
1729////////////////////////////////////////////////////////////////
1730//
1731// @method void wSendMailNospam(data)
1732//
1733// @desc Öffnet eine E-Mail zum Versenden
1734//
1735// @return void
1736//
1737////////////////////////////////////////////////////////////////
1738
1739wSendMailNospam = function(data){
1740
1741  top.location.href = 'mailto:' + data.replace('|', '@');
1742};
1743
1744wAdaptConditionalFormData = function(){
1745
1746  jQuery("*[data-conditionalformdata]").each(function(){
1747    var cE = jQuery(this);
1748
1749    var conditionalformdata = cE.data('conditionalformdata');
1750
1751    var type               = 'showIf';
1752    var dyndisplayOperator = 'and';
1753
1754    if(/type:(showIf|hideIf)/.test(conditionalformdata)){
1755      type = RegExp.$1;
1756    }
1757
1758    if(/operator:(and|or)/.test(conditionalformdata)){
1759      dyndisplayOperator = RegExp.$1;
1760    }
1761
1762    if(/conditions:(.*)/.test(conditionalformdata)){
1763      conditionalformdata = RegExp.$1;
1764    }
1765
1766    conditionalformdata = conditionalformdata.replace(/,(\w+(==|\!=|\>=|\>|\<=|\<|)')/g, '_WCMA_$1');
1767
1768    var conditionalFormDatas = conditionalformdata.split('_WCMA_');
1769    var isActive             = dyndisplayOperator == 'or' ? false : true;
1770    var isActiveCurrent      = false;
1771
1772    for(var i = 0; i < conditionalFormDatas.length; i++){
1773
1774      conditionalFormDatas[i] = conditionalFormDatas[i].replace("\\'", 'WBSAP');
1775
1776      /^([\w\-]+)(\=\=|\!\=|<\=|<|>|>\=|pregMatch|\!pregMatch|contains|\!contains|pregiMatch|\!pregiMatch|containsi|\!containsi)\'([^\']*)\'/.test(conditionalFormDatas[i]);
1777
1778      var elementToObserveName = RegExp.$1;
1779      var operator             = RegExp.$2;
1780      var condition            = RegExp.$3.replace('WBSAP', "'");
1781
1782      if(condition.substr(0, 1) == '$'){
1783        var elementWidthConditionName = condition.substr(1);
1784        var elementWithConditionValue = null;
1785        var elementWithCondition      = cE.closest('form').find("*[name='" + elementWidthConditionName + "']");
1786        if(elementWithCondition.length != 0){
1787          condition = elementWithCondition.val();
1788
1789          if(elementWithCondition.attr('type') == 'radio'){
1790            elementWithConditionValue = cE.closest('form').find("input[name='" + elementWidthConditionName + "']:checked, input[name='" + elementWidthConditionName + "[]:checked']");
1791            if(elementWithConditionValue.length != 0){
1792              condition = elementWithConditionValue.val();
1793            }
1794            else{
1795              condition = '';
1796            }
1797          }
1798          else if(elementWithCondition.attr('type') == 'checkbox'){
1799            condition = new Array();
1800            elementToObserve.each(function(){
1801              if(jQuery(this).is(':checked')){
1802                condition.push(jQuery(this).val());
1803              }
1804            });
1805          }
1806        }
1807      }
1808
1809      var elementToObserve      = cE.closest('form').find("*[name='" + elementToObserveName + "'], *[name='" + elementToObserveName + "[]']");
1810      var elementToObserveValue = elementToObserve;
1811      var value                 = elementToObserveValue.val();
1812
1813      if(elementToObserve.attr('type') == 'radio'){
1814        elementToObserveValue = cE.closest('form').find("input[name='" + elementToObserveName + "']:checked, input[name='" + elementToObserveName + "[]:checked']");
1815        if(elementToObserveValue.length != 0){
1816          value = elementToObserveValue.val();
1817        }
1818        else{
1819          value = '';
1820        }
1821      }
1822      else if(elementToObserve.attr('type') == 'checkbox'){
1823        value = new Array();
1824        elementToObserve.each(function(){
1825          if(jQuery(this).is(':checked')){
1826            value.push(jQuery(this).val());
1827          }
1828        });
1829      }
1830
1831      if(!elementToObserve.data('hasaddedobserver')){
1832        elementToObserve.data('hasaddedobserver', true);
1833        elementToObserve.on('change keyup', function(){wAdaptConditionalFormData();});
1834      }
1835
1836      isActiveCurrent = false;
1837
1838      if(operator == '<' || operator == '<=' || operator == '>=' || operator == '>'){
1839        value = isNaN(parseFloat(value)) ? 0 : parseFloat(value);
1840      }
1841
1842      //console.log(elementToObserveName + '(' + value + ') ' + operator + ' ' + condition);
1843
1844      var regExpOperator = null;
1845      if(operator == 'pregMatch' || operator == '!pregMatch'){
1846        regExpOperator = new RegExp(condition);
1847      }
1848      else if(operator == 'pregiMatch' || operator == '!pregiMatch'){
1849        regExpOperator = new RegExp(condition, 'i');
1850      }
1851
1852      if(Array.isArray(value) && condition == ''){
1853        if(operator == '!=' && value.length != 0 || operator == '==' && value.length == 0){
1854          if(dyndisplayOperator == 'or'){
1855            isActive = true;
1856            break;
1857          }
1858        }
1859        else{
1860          if(dyndisplayOperator == 'and'){
1861            isActive = false;
1862            break;
1863          }
1864        }
1865      }
1866      else if(Array.isArray(value) && condition.indexOf('|') == -1){
1867        if(operator == '!=' && value.indexOf(condition) == -1 || operator == '==' && value.indexOf(condition) != -1){
1868          if(dyndisplayOperator == 'or'){
1869            isActive = true;
1870            break;
1871          }
1872        }
1873        else{
1874          if(dyndisplayOperator == 'and'){
1875            isActive = false;
1876            break;
1877          }
1878        }
1879      }
1880      else if(Array.isArray(value)){
1881        var conditions = condition.split('|');
1882        isActiveCurrent = false;
1883        for(var j = 0; j < conditions.length; j++){
1884          if(operator == '!=' && value.indexOf(conditions[j]) == -1 || operator == '==' && value.indexOf(conditions[j]) != -1){
1885            isActiveCurrent = true;
1886            break;
1887          }
1888        }
1889        if(isActiveCurrent){
1890          if(dyndisplayOperator == 'or'){
1891            isActive = true;
1892            break;
1893          }
1894        }
1895        else{
1896          if(dyndisplayOperator == 'and'){
1897            isActive = false;
1898            break;
1899          }
1900        }
1901      }
1902      else if(operator == 'pregMatch' && regExpOperator.test(value) || operator == '!pregMatch' && !regExpOperator.test(value) || operator == 'pregiMatch' && regExpOperator.test(value) || operator == '!pregiMatch' && !regExpOperator.test(value)){
1903        if(dyndisplayOperator == 'or'){
1904          isActive = true;
1905          break;
1906        }
1907      }
1908      else if(operator == 'contains' && value.indexOf(condition) != -1 || operator == '!contains' && value.indexOf(condition) == -1 || operator == 'containsi' && value.toLowerCase().indexOf(condition.toLowerCase()) != -1 || operator == '!containsi' && value.toLowerCase().indexOf(condition.toLowerCase()) == -1){
1909        if(dyndisplayOperator == 'or'){
1910          isActive = true;
1911          break;
1912        }
1913      }
1914      else if(operator == '!=' && value != condition || operator == '==' && value == condition || operator == '<' && value < condition || operator == '<=' && value <= condition || operator == '>=' && value >= condition || operator == '>' && value > condition){
1915        if(dyndisplayOperator == 'or'){
1916          isActive = true;
1917          break;
1918        }
1919      }
1920      else{
1921        if(dyndisplayOperator == 'and'){
1922          isActive = false;
1923          break;
1924        }
1925      }
1926    }
1927
1928    if(type == 'showIf' && !isActive || type == 'hideIf' && isActive){
1929      cE.addClass('wglConditionalFormdata');
1930      cE.addClass('wglHideConditionalFormdata');
1931      cE.removeClass('wglShowConditionalFormdata');
1932      cE.find('input, textarea, select').each(function(index){
1933        if(jQuery(this).attr('tabindex') && jQuery(this).attr('tabindex') != -1){
1934          jQuery(this).attr('data-tabindex', jQuery(this).attr('tabindex'));
1935        }
1936        if(typeof(wResetConditionalFormdataOnHide) != 'undefined' && wResetConditionalFormdataOnHide){
1937          if(typeof(jQuery(this).data('valueinit')) == 'undefined'){
1938            if(jQuery(this).attr('type') == 'checkbox' || jQuery(this).attr('type') == 'radio'){
1939              jQuery(this).data('valueinit', jQuery(this).prop('checked') ? 'checked' : 'unchecked');
1940            }
1941            else{
1942              jQuery(this).data('valueinit', jQuery(this).val());
1943            }
1944            if(jQuery(this).attr('type') == 'hidden' && jQuery(this).attr('id').indexOf('inputUploader-') == -1){
1945              jQuery(this).val('');
1946            }
1947          }
1948          else{
1949            if(jQuery(this).attr('type') == 'checkbox' || jQuery(this).attr('type') == 'radio'){
1950              jQuery(this).prop('checked', jQuery(this).data('valueinit') == 'checked' ? true : false);
1951            }
1952            else{
1953              jQuery(this).val(jQuery(this).data('valueinit'));
1954            }
1955          }
1956        }
1957
1958        if(jQuery(this).attr('type') == 'hidden' && jQuery(this).attr('id').indexOf('inputUploader-') == -1){
1959          jQuery(this).val('');
1960        }
1961
1962        jQuery(this).attr('tabindex', -1);
1963      });
1964    }
1965    else{
1966      cE.addClass('wglConditionalFormdata');
1967      cE.removeClass('wglHideConditionalFormdata');
1968      cE.addClass('wglShowConditionalFormdata');
1969      cE.find('input').each(function(index){
1970        if(jQuery(this).attr('data-tabindex')){
1971          jQuery(this).attr('tabindex', jQuery(this).attr('data-tabindex'));
1972        }
1973        else{
1974          jQuery(this).removeAttr('tabindex');
1975        }
1976        if(jQuery(this).attr('type') == 'hidden' && jQuery(this).attr('id').indexOf('inputUploader-') == -1 && typeof(jQuery(this).data('valueinit')) != 'undefined'){
1977          jQuery(this).val(jQuery(this).data('valueinit'));
1978        }
1979      });
1980    }
1981  });
1982};
1983
1984wGetScrollTopHeight = function(options){
1985
1986  var scrollTop = 0;
1987
1988  if(jQuery('.wglContainerInsideTopOnScroll').length > 0 && jQuery('.wglContainerInsideTopOnScroll > *').height() > 0){
1989    scrollTop = jQuery('.wglContainerInsideTopOnScroll').height();
1990  }
1991  else if(jQuery('.wglKeepInsideTopOnScroll').length > 0){
1992    scrollTop = jQuery('.wglKeepInsideTopOnScroll').height();
1993  }
1994  else if(jQuery('#blockTop').length > 0 && jQuery('#blockTop').css('position') == 'fixed'){
1995    scrollTop = jQuery('#blockTop').height();
1996  }
1997  return scrollTop;
1998};
1999
2000wAdaptParallax = function(event){
2001 
2002  var winScrollTop = jQuery(window).scrollTop();
2003  var winHeight    = jQuery(window).height();
2004
2005  wUiTmp['lastEventType'] = event ? event.type : '';
2006
2007  if(winScrollTop == window['lastScrollTop']){
2008    return;
2009  }
2010  else if(!window['lastScrollTop']){
2011    wUiTmp['scrollDirection'] = winScrollTop > window['lastScrollTop'] ? 'down' : 'up';
2012    wUiTmp['lastScrollTop']   = winScrollTop;
2013  }
2014
2015  wUiTmp['lastScrollTop'] = winScrollTop;
2016
2017  if(typeof(wEditor) == 'undefined'){
2018    jQuery('.wglParallaxBackground').each(function(index){
2019
2020      var currentElement  = jQuery(this);
2021
2022      if(wUiTmp['lastEventType'] != 'resize' && currentElement.data('disableParallax') == '1'){
2023        return false;
2024      }
2025
2026      var offsetTop       = parseInt(currentElement.offset().top);
2027      var offsetTopInit   = 0;
2028      var offsetHeight    = parseInt(currentElement.outerHeight());
2029      var offsetWidth     = parseInt(currentElement.outerWidth());
2030      var posInsideTop    = winScrollTop + winHeight - offsetTop;
2031      var posInsideBottom = offsetTop + offsetHeight - winScrollTop;
2032      var useEdgeOnInit   = currentElement.data('useedgeoninit') == '1' ? true : false;
2033      var moveMax         = offsetHeight + winHeight;
2034
2035      if(posInsideTop > 0 && posInsideBottom > 0){
2036        var posTopPercentage = posInsideTop / moveMax;
2037        var backgroundPositionTop       = 0;
2038        var backgroundPositionLeft      = 0;
2039        var backgroundPositionTopOrigin = 0;
2040
2041        var direction         = (currentElement.data('parallaxbackgrounddirection') ? currentElement.data('parallaxbackgrounddirection').toLowerCase() : 'bottom');
2042        var parallaxElement   = (currentElement.data('parallaxbackgroundelement') ? document.getElementById(currentElement.data('parallaxbackgroundelement')) : null);
2043
2044        var speed     = 1;
2045
2046        try{
2047          speed       = (currentElement.data('parallaxbackgroundspeed') ? currentElement.data('parallaxbackgroundspeed') : 1);
2048        }
2049        catch(e){
2050          speed = 1;
2051        }
2052
2053        if(speed == 'no' || speed == 'image'){
2054          return false;
2055        }
2056        else if(speed == 'screen'){
2057          speed = 1;
2058          currentElement.data('parallaxbackgroundspeed', speed);
2059        }
2060
2061        if(!currentElement.data('backgroundHeight') && direction.indexOf('top') != -1 && direction.indexOf('bottom') != -1){          
2062          image = new Image();
2063          image.src = currentElement.get(0).style.backgroundImage.replace(/url\((['"])?(.*?)\1\)/i, '$2');
2064          image.onload = (function(currentElement){
2065            if(image.height == 0){
2066              return false;
2067            }
2068            if(currentElement.data('disableParallax') != '1'){
2069              if(speed == 'image'){
2070                currentElement.data('backgroundHeight', image.height);
2071                speed = (image.height - offsetHeight) / offsetHeight;
2072                if(speed < 0){
2073                  speed = 'no';
2074                  currentElement.data('parallaxbackgroundspeed', speed);
2075                  return;
2076                }
2077                currentElement.data('parallaxbackgroundspeed', speed);
2078              }
2079              else{
2080                backgroundSize = currentElement.css('background-size');
2081
2082                var heightScaled    = parseInt(offsetWidth / image.width * image.height);
2083                var disableParallax = false;
2084
2085                if(/auto$/i.test(backgroundSize) || backgroundSize == ''){
2086                  heightScaled = image.height;
2087                }
2088
2089                currentElement.data('backgroundHeight', heightScaled);
2090                //console.log(image.height + ' < ' + offsetHeight);
2091                //console.log(backgroundSize + ' :: ' + heightScaled + ' + ' + parseInt(currentElement.css('background-position').split(' ')[1]) + '  <' + offsetHeight);
2092
2093                if(heightScaled + parseInt(currentElement.css('background-position').split(' ')[1]) < offsetHeight){
2094                  currentElement.css({'background-size' : 'cover', 'background-position' : '0 0'});
2095                  currentElement.data('disableParallax', '1');
2096                }
2097                else{
2098                  currentElement.css({'outline' : 'none'});
2099                  currentElement.data('disableParallax', '0');
2100                }
2101              }
2102            }
2103          })(currentElement);
2104        }
2105
2106        speed = parseFloat(speed);
2107
2108        //console.log(direction);
2109
2110        if(currentElement.data('disableParallax') == '1'){
2111          return false;
2112        }
2113
2114        if(direction.indexOf('right') != -1){
2115          backgroundPositionLeft = '-' + String(Math.round(offsetHeight - posTopPercentage * offsetHeight) * speed);
2116        }
2117        else if(direction.indexOf('left') != -1){
2118          backgroundPositionLeft = '-' + String(Math.round(posTopPercentage * offsetHeight) * speed);
2119        }
2120        if(direction.indexOf('top') != -1){
2121          backgroundPositionTop = '-' + String(Math.round(posTopPercentage * offsetHeight) * speed);
2122          backgroundPositionTopOrigin = backgroundPositionTop;
2123          if(useEdgeOnInit == true){
2124            offsetTopInit = currentElement.data('offsettopinit');
2125            if(!wUiTmp['hasInitParallax'] && !offsetTopInit){
2126              offsetTopInit = backgroundPositionTop;
2127              currentElement.data('offsettopinit', offsetTopInit);
2128            }
2129            else if(!offsetTopInit){
2130              offsetTopInit = 0;
2131            }
2132            backgroundPositionTop -= offsetTopInit;
2133            if(backgroundPositionTop > 0 ){
2134              backgroundPositionTop = 0;
2135            }
2136          }
2137          //console.log(offsetHeight + ' - ' + backgroundPositionTop + ' > ' + currentElement.data('backgroundHeight'));
2138          if(currentElement.data('backgroundHeight') && (offsetHeight - backgroundPositionTop) > currentElement.data('backgroundHeight')){
2139            backgroundPositionTop = offsetHeight - currentElement.data('backgroundHeight')
2140          }
2141        }
2142        else if(direction.indexOf('bottom') != -1 || direction == ''){
2143          backgroundPositionTop = '-' + String(Math.round(offsetHeight - posTopPercentage * offsetHeight) * speed);
2144          backgroundPositionTopOrigin = backgroundPositionTop;
2145          if(useEdgeOnInit == true){
2146            offsetTopInit = currentElement.data('offsettopinit');
2147            if(!wUiTmp['hasInitParallax'] && !offsetTopInit){
2148              offsetTopInit = backgroundPositionTop - offsetHeight;
2149              currentElement.data('offsettopinit', offsetTopInit);
2150            }
2151            else if(!offsetTopInit){
2152              offsetTopInit = 0;
2153            }
2154            backgroundPositionTop -= offsetTopInit;
2155            if(backgroundPositionTop < offsetHeight && backgroundPositionTop > 0){
2156              backgroundPositionTop = offsetHeight;
2157            }
2158          }
2159          if(currentElement.data('backgroundHeight') && (offsetHeight - backgroundPositionTop) > currentElement.data('backgroundHeight')){
2160            backgroundPositionTop = offsetHeight - currentElement.data('backgroundHeight')
2161          }
2162        }
2163
2164        backgroundPositionLeft = String(backgroundPositionLeft) + 'px';
2165        backgroundPositionTop  = String(backgroundPositionTop) + 'px';
2166
2167        wUiTmp['lastEventTypeBefore'] = wUiTmp['lastEventType'];
2168        if(parallaxElement){
2169          parallaxElement.style.marginTop = backgroundPositionTop;
2170        }
2171        else{
2172          if(wUiTmp['isIOS']){
2173            if(wUiTmp['lastEventType'] == 'touchmove'){
2174              currentElement.css({'transform' : 'translate3d(0, 0, 0)', 'transition' : '', 'background-position' : backgroundPositionLeft + ' ' + backgroundPositionTop});
2175            }
2176            else if(wUiTmp['lastEventType'] == 'touchend'){
2177            }
2178            else if(wUiTmp['lastEventType'] == 'scroll'){
2179              currentElement.css({'transform' : 'translate3d(0, 0, 0)', 'transition' : 'background-position ease 0.6s', 'background-position' : backgroundPositionLeft + ' ' + backgroundPositionTop});
2180            }
2181          }
2182          else{
2183            currentElement.css({'background-position' : backgroundPositionLeft + ' ' + backgroundPositionTop});
2184          }
2185        }
2186      }
2187    });
2188
2189    jQuery('.wglParallaxContent').each(function(index){
2190      var currentElement    = jQuery(this).children().first();
2191      var offsetTop         = parseInt(currentElement.offset().top);
2192      var offsetHeight      = parseInt(currentElement.height());
2193      var posInsideTop    = winScrollTop + winHeight - offsetTop;
2194      var posInsideBottom = offsetTop + offsetHeight - winScrollTop;
2195      if(posInsideTop > 0 && posInsideBottom > 0){
2196        var posTopPercentage = posInsideTop / (offsetHeight + winHeight);
2197        var positionTop  = 0;
2198        var positionLeft = 0;
2199        var direction = (currentElement.parent().data('parallaxcontentdirection') ? currentElement.parent().data('parallaxcontentdirection').toLowerCase() : 'left');
2200
2201        if(direction.indexOf('right') != -1){
2202          var offsetWidth = parseInt(currentElement.width());
2203          var left = - (1 - posTopPercentage * 2) * offsetWidth;
2204          if(left > 0) left = 0;
2205          positionLeft = String(parseInt(left)) + 'px';
2206        }
2207        else if(direction.indexOf('left') != -1){
2208          var parentOffsetWidth = parseInt(currentElement.parent().width());
2209          var left = (1 - posTopPercentage * 2) * parentOffsetWidth;
2210          if(left < 0) left = 0;
2211          positionLeft = String(parseInt(left)) + 'px';
2212        }
2213        if(direction.indexOf('top') != -1){
2214          positionTop = String(1 - posTopPercentage * offsetHeight + offsetHeight) + 'px';
2215        }
2216        else if(direction.indexOf('bottom') != -1 || direction == ''){
2217          positionTop = String(posTopPercentage * offsetHeight) + 'px';
2218        }
2219        currentElement.css({'transform' : 'translate3d(0, 0, 0)', 'margin-left' : positionLeft, 'margin-top' : positionTop});
2220      }
2221    });
2222  }
2223  wUiTmp['hasInitParallax'] = true;
2224  wUiTmp['adaptParallax']   = false;
2225};
2226
2227wScrollSmoothToTarget = function(element, event){
2228 
2229  var id, href = element.getAttribute('href'), offsetTopFixed, targetName, elementTarget, scrollTop;
2230  
2231
2232   //stopt einen Klick auf einen externen Link
2233  if(element.getAttribute('target') != null && element.getAttribute('target') != '') return true;
2234  if(element.href.replace(/#[\S\s]*$/, '') != location.href.replace(/#[\S\s]*$/, '')){
2235    return true;
2236  }
2237  else if(/(#.*)/.test(href)){
2238    
2239    targetName = RegExp.$1;
2240    targetSelector = targetName.replace(/\./, '\\.');
2241    elementTarget = jQuery(targetSelector);
2242    var currentTimestamp = new Date().getTime();
2243    if(elementTarget.length > 0 && !element.getAttribute('data-lct') || element.getAttribute('data-lct') < currentTimestamp - 320){
2244      element.setAttribute('data-lct', currentTimestamp);
2245      if(!(/_Tab-|#tab_|_Accordion-/.test(href))) {
2246        event.preventDefault();  
2247      }
2248      jQuery(element).parent().parent().find('li').removeClass('selected');
2249      jQuery(element).parent().addClass('selected');
2250
2251      try{
2252        jQuery('body, html').stop(true, true);
2253        scrollDuration = parseInt(element.getAttribute('data-scrollsmoothtotargetduration') ? element.getAttribute('data-scrollsmoothtotargetduration') : 400);
2254        offsetTopFixed = wGetScrollTopHeight();
2255        jQuery('body, html').animate({scrollTop: elementTarget.offset().top - offsetTopFixed}, {duration: scrollDuration, complete: function(){
2256          var offsetTopFixed = wGetScrollTopHeight();
2257          if(offsetTopFixed > 0){
2258            jQuery('body, html').animate({scrollTop: elementTarget.offset().top - offsetTopFixed}, scrollDuration);
2259          }
2260          
2261          if(history.pushState){
2262            history.pushState(null, null, targetName);
2263          }
2264        
2265        }});
2266
2267        return false;
2268      }
2269      catch(e){}
2270    }
2271  }
2272};
2273
2274wOptimizePictureSizes = function(){
2275
2276  jQuery("img[data-src2x]:not(.wglLazyLoadInit), img.wglLazyLoad:not(.wglLazyLoadInit)").each(function(){
2277    var currentImg   = jQuery(this);
2278    var offsetTop    = parseInt(currentImg.offset().top);
2279    var srcMin       = currentImg.data('srcmin') ? currentImg.data('srcmin') : '';
2280    var widthCurrent = parseInt(currentImg.width());
2281    var attrWidthCur = parseInt(typeof(currentImg.attr('width')) != 'undefined' ? currentImg.attr('width') : 0);
2282    var widthMin     = parseInt(srcMin.replace(/.*@min/, '').replace(/\..*/, ''));
2283
2284    if(currentImg.attr('data-maxwidthifinvisible') && currentImg.attr('data-maxwidthifinvisible') > widthCurrent){
2285      widthCurrent = currentImg.attr('data-maxwidthifinvisible');
2286    }
2287
2288    //console.log(widthCurrent + ' < ' + widthMin);
2289
2290    if(devicePixelRatio >= hdLimitDpr && typeof(currentImg.attr('data-src2x')) != 'undefined' && currentImg.attr('data-src2x') != '' && attrWidthCur < widthCurrent * 2 && currentImg.attr('data-ishd') != '1'){
2291      currentImg.attr('src', currentImg.data('src2x'));
2292      currentImg.attr('data-ishd', '1');
2293    }
2294    else if(typeof(currentImg.attr('data-src2x')) != 'undefined' && currentImg.attr('data-src2x') != '' && attrWidthCur < widthCurrent && currentImg.attr('data-ishd') != '1'){
2295      currentImg.attr('src', currentImg.data('src2x'));
2296      currentImg.attr('data-ishd', '1');
2297    }
2298    else if(typeof(currentImg.attr('data-srcmin')) != 'undefined' && currentImg.attr('data-srcmin') != '' && widthCurrent < widthMin && widthMin < attrWidthCur && currentImg.attr('data-ishd') != '1' && currentImg.attr('data-isld') != '1'){
2299      if(typeof(currentImg.attr('src')) != 'undefined' && currentImg.attr('src').indexOf('data:image') == 0 && currentImg.attr('data-ismin') != '1'){
2300        currentImg.attr('src', currentImg.data('srcmin'));
2301        currentImg.attr('data-ismin', '1');
2302      }
2303    }
2304    else if(typeof(currentImg.attr('data-src')) != 'undefined' && currentImg.attr('data-src') != '' && currentImg.attr('data-ishd') != '1' && currentImg.attr('data-isld') != '1'){
2305      currentImg.attr('src', currentImg.data('src'));
2306      currentImg.attr('data-isld', '1');
2307    }
2308  });
2309};
2310
2311wProcessWglAdjustHeightMax = function(){
2312  
2313  jQuery('.wglAdjustHeightMax').each(function(index){
2314    var currentElement = jQuery(this);
2315    var offsetLeft     = 0;
2316    var offsetLeftLast = 0;
2317    var maxHeight      = 0;
2318    var adjust         = true;
2319    var positionCol    = 0;
2320    var childsToAdapt  = new Array();
2321    var numberChilds   = 0;
2322    var subElement     = null;
2323    var elementHeight  = 0;
2324
2325    currentElement.children('*:visible').each(function(index){
2326      var className = jQuery(this).attr('class') || '';
2327      if(className.toLowerCase().indexOf('clear') == -1 && className.toLowerCase().indexOf('editor') == -1){
2328        numberChilds++;
2329      }
2330    });
2331    currentElement.children('*:visible').each(function(index){
2332      subElement    = jQuery(this);
2333      var className = jQuery(this).attr('class') || '';
2334      if(className.toLowerCase().indexOf('clear') == -1 && className.toLowerCase().indexOf('editor') == -1){
2335        if(jQuery(this).data('wHasSetHeightToAjustHeightMax') == '1'){
2336          jQuery(this).css({'height' : ''});
2337        }
2338        offsetLeft = jQuery(this).get(0).offsetLeft - (jQuery(this).parent().css('position') == 'relative' ? 0 : jQuery(this).get(0).parentNode.offsetLeft);
2339
2340        if(index > 0 && (offsetLeft == 0 || offsetLeft <= offsetLeftLast) && jQuery(this).css('position') != 'absolute'){
2341          if(positionCol == 1){
2342            childsToAdapt = new Array();
2343            maxHeight = 0;
2344          }
2345          positionCol = 0;
2346          if(offsetLeft <= offsetLeftLast){
2347            offsetLeft = 0;
2348          }
2349        }
2350
2351        positionCol++;
2352
2353        elementHeight          = subElement.css('box-sizing') == 'border-box' ? subElement.outerHeight() : subElement.height();
2354
2355        if(index + 1 == numberChilds && positionCol > 1){
2356          maxHeight = elementHeight > maxHeight ? elementHeight : maxHeight;
2357          childsToAdapt.push(jQuery(this));
2358        }
2359
2360        if(childsToAdapt.length > 1 && (index > 0 && positionCol == 1 || index + 1 == numberChilds)){
2361          for(i = 0; i < childsToAdapt.length; i++){
2362            childToAdapt = childsToAdapt[i];
2363            var className = childToAdapt.attr('class') || '';
2364            if(className.toLowerCase().indexOf('clear') == -1 && className.toLowerCase().indexOf('editor') == -1){
2365              childToAdapt.css({'height' : maxHeight});
2366              childToAdapt.data('wHasSetHeightToAjustHeightMax', '1');
2367            }
2368          }
2369          childsToAdapt = new Array();
2370          maxHeight = 0;
2371        }
2372
2373        offsetLeftLast = offsetLeft;
2374        maxHeight = elementHeight > maxHeight ? elementHeight : maxHeight;
2375        childsToAdapt.push(jQuery(this));
2376      }
2377    });
2378    if(typeof(wOnAfterAdjustHeight) == 'function'){     
2379      wOnAfterAdjustHeight(currentElement);
2380    } 
2381  });
2382};
2383
2384jQuery.fn.wBannerSlider = function(){
2385
2386  jQuery.each(jQuery(this), function(){
2387
2388    var bannerSliderCurrent   = jQuery(this);
2389    var bannerSliderCurrentId = bannerSliderCurrent.attr('id').replace(/bannerSlider_/, '');
2390
2391    var options = {};
2392
2393    options['initOn']         = options['initon']  || jQuery(this).data('initon');
2394    options['initOpen']       = options['initopen']  || jQuery(this).data('initopen');
2395    options['initDelay']      = options['initDelay'] || jQuery(this).data('initdelay');
2396    if(options['initDelay'] == ''){
2397      options['initDelay'] = 0;
2398    }
2399    else{
2400      options['initDelay'] *= 1000;
2401    }
2402
2403    eval('selectEntry_' + bannerSliderCurrentId + ' = function (position){selectListEntryBannerSlider(bannerSliderCurrentId, position);}');
2404
2405    var bannerSliderInit = function(){
2406
2407      if(options['initOpen'] != ''){
2408        window.bannerSliderObjects[bannerSliderCurrentId] = {};
2409        selectListEntryBannerSlider(bannerSliderCurrentId, parseInt(options['initOpen']), {'animation' : 'none'});
2410      }
2411
2412      window.setTimeout(function(){
2413        initBannerSlider(bannerSliderCurrentId);
2414      }, options['initDelay']);
2415    };
2416
2417    if(options['initOn'] == 'load'){
2418      jQuery(window).on('load', bannerSliderInit);
2419    }
2420    else{
2421      bannerSliderInit();
2422    }
2423  });
2424};
2425
2426jQuery.fn.wSearchSuggest = function(){
2427  
2428  jQuery.each(jQuery(this), function(index){
2429    var cE = jQuery(this);
2430    cE.attr('autocomplete', 'off');
2431
2432    cE.on('keydown', function(event){
2433      if(event.keyCode == 27){
2434        jQuery('#searchSuggestOuter').remove();
2435      }
2436      else if(event.keyCode == 40 || event.keyCode == 38){
2437        event.preventDefault();
2438
2439        if(event.target.value == ''){
2440          return false;
2441        }
2442
2443        var positionSuggestSelected = 0;
2444        if(event.target.getAttribute('data-positionsuggestedselected')){
2445          positionSuggestSelected = positionSuggestSelected + parseInt(event.target.getAttribute('data-positionsuggestedselected'));
2446        }
2447
2448        positionSuggestSelected = event.keyCode == 40 ? positionSuggestSelected + 1 : positionSuggestSelected - 1;
2449        if(positionSuggestSelected > jQuery('#searchSuggestOuter .searchSuggestEntry').length){
2450          positionSuggestSelected = jQuery('#searchSuggestOuter .searchSuggestEntry').length;
2451        }
2452        else if(positionSuggestSelected < 1){
2453          positionSuggestSelected = 1;
2454        }
2455        
2456        if(jQuery('#searchSuggestOuter .searchSuggestEntry:nth-child(' + positionSuggestSelected + ')').data('word')){
2457          event.target.value = jQuery('#searchSuggestOuter .searchSuggestEntry:nth-child(' + positionSuggestSelected + ')').data('word');  
2458          event.target.setAttribute('data-positionsuggestedselected', positionSuggestSelected);
2459        }
2460
2461        jQuery('#searchSuggestOuter .searchSuggestEntry').removeClass('selected');
2462        jQuery('#searchSuggestOuter .searchSuggestEntry:nth-child(' + positionSuggestSelected + ')').addClass('selected');
2463      }
2464    });
2465
2466    cE.on('keyup', function(event){
2467      event.preventDefault();
2468      var searchTerm = jQuery(this).val();
2469
2470      if(typeof(wUiTmp['searchTermNumberResults']) == 'undefined'){
2471        wUiTmp['searchTermNumberResults'] = {};
2472      }
2473
2474      if(searchTerm != '' && searchTerm != wUiTmp['lastSearchTerm']){
2475        if(event.keyCode == 40 || event.keyCode == 38){
2476          event.preventDefault();
2477          return;
2478        }
2479
2480        if(wUiTmp['lastSearchTerm'] && searchTerm.indexOf(wUiTmp['lastSearchTerm']) == 0 && wUiTmp['lastSearchTermNumberResults'] == 0){
2481          return;
2482        }
2483
2484        if(wUiTmp['searchTermNumberResults'][searchTerm] && wUiTmp['searchTermNumberResults'][searchTerm] == 0){
2485          return;
2486        }
2487        var project       = location.pathname.replace(/[^\/]*$/, '').replace(/^(\/[^\/]*)[^\?]*/, '$1');
2488        if(cE.data('project-search')){
2489          projectSearch = cE.data('project-search');
2490          if(project == '/'){
2491            project = projectSearch;
2492          }
2493          else if(projectSearch.indexOf('!important') != -1){
2494            project = projectSearch.replace(/\s*\!important/, '');
2495          }
2496        }
2497        var projectGlobal = wUiTmp['wGlobalProjectPath'];
2498        var search        = 'default';
2499        if(cE.data('id-search')){
2500          search = cE.data('id-search');
2501        }
2502        var url = projectGlobal + '/wGlobal/scripts/php/wSearchSuggest.php?searchTerm=' + encodeURIComponent(searchTerm) + '&project=' + project + '&search=' + search;
2503        if(cE.data('usecache') == '1'){
2504          url = project + '/weblication/wSearchSuggest/searchTerm=' + encodeURIComponent(searchTerm).replace(/~/g, '_WT-IL_').replace(/%/g, '~').toLowerCase() + '.html';
2505        }
2506        jQuery.ajax({type: "GET", url: url, dataType: 'json', success: function(resultData){
2507          var numberResults = 0;
2508          var innerHTMLSuggest = '<div id="searchSuggestOuter"><div id="searchSuggestInner">';
2509          for(word in resultData){
2510            innerHTMLSuggest += '<div class="searchSuggestEntry" data-word="' + word + '">' + word + '</div>';
2511            numberResults++;
2512          }
2513          wUiTmp['lastSearchTermNumberResults'] = numberResults;
2514          wUiTmp['searchTermNumberResults'][searchTerm] = numberResults;
2515
2516          innerHTMLSuggest += '</div></div>';
2517          jQuery('#searchSuggestOuter').remove();
2518          if(numberResults > 0){
2519            cE.after(innerHTMLSuggest);
2520            jQuery('.searchSuggestEntry').on('mousedown', function(){
2521              jQuery(this).closest('#searchSuggestOuter').prev('input').val(jQuery(this).data('word'));
2522              jQuery(this).closest('form').submit();
2523              jQuery('#searchSuggestOuter').remove();
2524            });
2525          }
2526        }});
2527      }
2528      else if(searchTerm != wUiTmp['lastSearchTerm']){
2529        jQuery('#searchSuggestOuter').remove();
2530      }
2531      wUiTmp['lastSearchTerm'] = searchTerm;
2532    });
2533  }); 
2534};
2535
2536jQuery.fn.wPictureGallery = function(){
2537
2538  jQuery.each(jQuery(this), function(){
2539
2540    var options = {};
2541    var pictureGalleryCurrent   = jQuery(this);
2542    var pictureGalleryCurrentId = pictureGalleryCurrent.attr('id').replace(/pictureGallery_/, '');
2543
2544    eval('selectEntry_' + pictureGalleryCurrentId + ' = function (position){selectListEntryGallery(pictureGalleryCurrentId, position);}');
2545
2546    initGallery(pictureGalleryCurrentId);
2547  });
2548};
2549
2550jQuery.fn.wTabcontainer = function(){
2551
2552  var maxHeightContent = 0;
2553
2554  jQuery.each(jQuery(this), function(){
2555
2556    var tabcontainerCurrent     = jQuery(this);
2557    var tabcontainerID          = tabcontainerCurrent.get(0).id.replace(/tabContainer_/, '');
2558    
2559    var options = {};
2560
2561    options['initOpen']         = options['initOpen']         || jQuery(this).data('initopen');
2562    options['rememberSelected'] = options['rememberSelected'] || jQuery(this).data('rememberselected');
2563    options['pushstateonselect'] = options['pushstateonselect'] || jQuery(this).data('pushstateonselect');
2564
2565    var activeContent = options['initOpen'] || 0;
2566
2567    if(/^\d+$/.test(activeContent)){
2568      activeContent = parseInt(activeContent) - 1;
2569    }
2570
2571    if(options['rememberSelected'] == '1' || typeof(wEditor) != 'undefined'){
2572      var checkCookieRegExp = new RegExp('registerTab_' + tabcontainerID + '=(\\d+)');
2573      if(checkCookieRegExp.test(document.cookie)){
2574        activeContent = RegExp.$1 - 1;
2575      }
2576    }
2577
2578    var jQueryHashId = location.hash.replace(/\:/g, '\\:').replace(/\./g, '\\.').replace('open_', 'anchor_');
2579    
2580    if(jQueryHashId != '' && jQuery(this).find(jQueryHashId).length > 0){
2581      if(/_(\d+)$/.test(jQuery(jQueryHashId).attr('id'))){
2582        activeContent = RegExp.$1 - 1;
2583      }
2584      else if(/_Tab-(\d+)-/.test(jQuery(jQueryHashId).attr('id'))){
2585        activeContent = RegExp.$1 - 1;
2586      }
2587      else{
2588        var containerIndex = jQuery(jQueryHashId).parents('.container, .containerInvisible').index();
2589        if(containerIndex >= 0){
2590          activeContent = containerIndex;
2591        }
2592      }
2593    }
2594
2595    if(!activeContent || activeContent == '' || activeContent < 0){
2596      activeContent = 0;
2597    }
2598    
2599    tabcontainerCurrent.find('> .tabs > .tabSelected').removeClass('tabSelected').addClass('tab');
2600    tabcontainerCurrent.find('> .tabs > .tab:nth-child(' + (activeContent + 1) + ')').removeClass('tab').addClass('tabSelected');
2601    tabcontainerCurrent.find('> .containers > .container,> div > div > .containers > .container').addClass('containerInvisible');
2602    tabcontainerCurrent.find('> .containers > .container:nth-child(' + (activeContent + 1) + '),> div > div > .containers > .container:nth-child(' + (activeContent + 1) + ')').removeClass('containerInvisible').addClass('containerSelected').addClass('containerSelectedAfterInit');
2603  
2604    jQuery(this).find('> .tabsSmall, > .tabsSelectbox, > .tabs, > div > div > .tabs').children('.tab, .tabSelected').on('click', function(event){
2605      event.preventDefault();
2606      var headerSelected  = jQuery(this);
2607
2608      var tabcontainerSelected = headerSelected.get(0).id.replace(/.*_/, '');
2609      
2610      if(options['pushstateonselect'] != '0' &&  history.pushState && headerSelected.attr('id')){
2611        history.pushState({page: '#' + headerSelected.attr('id')}, '', '#' + headerSelected.attr('id'));
2612      }
2613
2614      jQuery(this).parent().parent().find('> .containers, > div > div > .containers').children('.container, .containerSelected, .containerInvisible').each(function(){
2615        currentContainer = this;
2616        (function(currentContainer){
2617          if(currentContainer.id == 'container_' + tabcontainerID + '_' + tabcontainerSelected){
2618            currentContainer.className = 'container containerSelected';
2619            window.setTimeout(function(){jQuery(currentContainer).addClass('containerSelectedAfterInit')}, 32);
2620          }
2621          else{
2622            currentContainer.className = 'container containerInvisible';
2623            window.setTimeout(function(){jQuery(currentContainer).addClass('containerInvisibleAfterInit')}, 32);
2624          }
2625        })(currentContainer);
2626      });
2627
2628      jQuery(this).parent().parent().find('> .tabsSmall, > .tabsSelectbox, > .tabs, > div > div > .tabs').children('.tab, .tabSelected').each(function(){
2629       if(this.id == 'tab_' + tabcontainerID + '_' + tabcontainerSelected){
2630      		jQuery(this).removeClass('tab');
2631      		jQuery(this).addClass('tabSelected');
2632        }
2633        else{
2634      		jQuery(this).removeClass('tabSelected');
2635      		jQuery(this).addClass('tab');
2636        }
2637      });
2638
2639      if(typeof(wEditor) != 'undefined' || options['rememberSelected'] != '0'){
2640        document.cookie = 'registerTab_' + tabcontainerID + '=' + tabcontainerSelected;
2641      }
2642      jQuery(window).trigger('resize');
2643    });
2644
2645    if(typeof(wEditor) == 'undefined'){
2646      jQuery(this).find('.container, .containerSelected, .containerInvisible').each(function(index){
2647        if(jQuery(this).html() == ''){
2648          tabcontainerCurrent.find('> .tabs > div:nth-child(' + (index + 1) + ')').remove();
2649        }
2650      });
2651    }
2652  });
2653};
2654
2655jQuery.fn.wAccordion = function(){
2656
2657  var maxHeightContent = 0;
2658
2659  jQuery.each(jQuery(this), function(){
2660    
2661    var options = {};
2662
2663    options['initOpen']         = options['initOpen']         || jQuery(this).data('initopen');
2664    options['multiple']         = options['multiple']         || jQuery(this).data('multiple');
2665    options['expandAll']        = options['expandAll']        || jQuery(this).data('expandall');
2666    options['collapsible']      = options['collapsible']      || jQuery(this).data('collapsible');
2667    options['rememberSelected'] = options['rememberSelected'] || jQuery(this).data('rememberselected');
2668    options['pushstateonselect'] = options['pushstateonselect'] || jQuery(this).parent().data('pushstateonselect');
2669   
2670    var accordionID   = jQuery(this).get(0).id.replace(/accordion_/, '');
2671
2672    var activeContent = options['initOpen'];
2673
2674    if(/^\d+$/.test(activeContent)){
2675      activeContent = parseInt(activeContent) - 1;
2676    }
2677
2678    if(options['rememberSelected'] == '1'){
2679      var checkCookieRegExp = new RegExp('accordionTab_' + accordionID + '=Accordion-(\\d+)');
2680      if(checkCookieRegExp.test(document.cookie)){
2681        activeContent = RegExp.$1 - 1;
2682      }
2683      else{
2684        var checkCookieRegExp = new RegExp('accordionTab_' + accordionID + '=(\\d+)');
2685        if(checkCookieRegExp.test(document.cookie)){
2686          activeContent = RegExp.$1 - 1;
2687        }
2688      }
2689    }
2690
2691    var jQueryHashTmp = location.hash.replace('open_', 'anchor_'); 
2692    var jQueryHashId = jQueryHashTmp.replace(/\./g, '\\.').replace(/\:/g, '\\:');
2693
2694    options['active'] = options['active'] || activeContent;
2695
2696    jQuery(this).children('.accordionContent').each(function(index){
2697      var heightContent = jQuery(this).height();
2698      if(heightContent > maxHeightContent){
2699        maxHeightContent = heightContent;
2700      }
2701    });
2702
2703    var lastOpenedEntry = null;
2704
2705    jQuery(this).children('h1, h2, h3, h4').each(function(index){
2706
2707      var openCurrent = false;
2708
2709      if(jQueryHashId != '' &&  '#' + jQuery(this).attr('id') == jQueryHashTmp || jQuery(this).next('.accordionContent').find(jQueryHashId).length > 0){
2710        if(/_Accordion-/.test(jQuery(jQueryHashId).attr('id'))){
2711          options['active'] = index;
2712          if(!options['multiple'] && lastOpenedEntry){
2713            lastOpenedEntry.addClass('accordionHeaderHidden').removeClass('accordionHeaderVisible');
2714            lastOpenedEntry.next('.accordionContent').addClass('accordionContentHidden').removeClass('accordionContentVisible').hide();
2715            lastOpenedEntry = null;
2716          }
2717          openCurrent = true;
2718        }
2719        else if(jQuery(jQueryHashId).parents('.accordionContent').length > 0){
2720          options['active'] = index;
2721        }
2722      }
2723      else{
2724        jQueryHashIdAlt = jQueryHashId.replace(/_Accordion-\d+/, '_Accordion');
2725
2726        if(jQueryHashIdAlt != '' &&  '#' + jQuery(this).attr('id') == jQueryHashIdAlt || jQuery(this).next('.accordionContent').find(jQueryHashIdAlt).length > 0){
2727          if(/_Accordion-/.test(jQuery(jQueryHashIdAlt).attr('id'))){
2728            options['active'] = index;
2729            if(!options['multiple'] && lastOpenedEntry){
2730              lastOpenedEntry.addClass('accordionHeaderHidden').removeClass('accordionHeaderVisible');
2731              lastOpenedEntry.next('.accordionContent').addClass('accordionContentHidden').removeClass('accordionContentVisible').hide();
2732              lastOpenedEntry = null;
2733            }
2734            openCurrent = true;
2735          }
2736          else if(jQuery(jQueryHashIdAlt).parents('.accordionContent').length > 0){
2737            options['active'] = index;
2738          }
2739        }
2740      }
2741
2742      if(options['collapsible']){
2743        jQuery(this).addClass('accordionHeaderCollapsible').removeClass('accordionHeaderNoneCollapsible');
2744      }
2745      else{
2746        jQuery(this).addClass('accordionHeaderNoneCollapsible').removeClass('accordionHeaderCollapsible');
2747      }
2748
2749      if(options['expandAll'] || typeof(options['active']) == 'number' && options['active'] == index){
2750        lastOpenedEntry = jQuery(this);
2751        jQuery(this).addClass('accordionHeaderVisible').removeClass('accordionHeaderHidden');
2752        jQuery(this).next('.accordionContent').addClass('accordionContentVisible').removeClass('accordionContentHidden').show();
2753      }
2754      else{
2755        jQuery(this).addClass('accordionHeaderHidden').removeClass('accordionHeaderVisible');
2756        jQuery(this).next('.accordionContent').addClass('accordionContentHidden').removeClass('accordionContentVisible').hide();
2757      }
2758
2759      if(options['heightStyle'] == 'auto'){
2760        jQuery(this).next('.accordionContent').css({'height' : maxHeightContent});
2761      }
2762
2763      jQuery(this).on('click', function(event, forceOpen){
2764        event.preventDefault();
2765        
2766        var headerSelected  = jQuery(this);
2767
2768        forceOpen = typeof(forceOpen) != 'undefined' ? forceOpen : false;
2769        
2770        if(options['pushstateonselect'] != '0' && history.pushState && headerSelected.attr('id')){
2771          history.pushState({page: '#' + headerSelected.attr('id')}, '', '#' + headerSelected.attr('id'));
2772        }
2773        
2774        if(typeof(wOnBeforeClickAccordeon) == 'function'){
2775          var rtcEvent = wOnBeforeClickAccordeon(headerSelected);
2776          if(rtcEvent === false){
2777            return false;
2778          }
2779        }
2780        
2781        var contentSelected = jQuery(this).next('.accordionContent');
2782        var hasEntryVisible = false, hasEntryInvisible = false;
2783        
2784        jQuery(this).parent().children('.accordionContent').each(function(index){
2785          if(jQuery(this).get(0) == contentSelected.get(0)){
2786            if(jQuery(this).hasClass('accordionContentVisible')){
2787              hasEntryInvisible = true;
2788            }
2789            else{
2790              hasEntryVisible = true;
2791            }
2792            if(jQuery(this).hasClass('accordionContentVisible') && ! forceOpen){
2793              if(options['collapsible']){
2794                jQuery(this).parent().trigger('accordionbeforeactivate', {'newHeader' : contentSelected});
2795                jQuery(this).prev('.accordionHeader').addClass('accordionHeaderHidden').removeClass('accordionHeaderVisible');
2796                jQuery(this).addClass('accordionContentHidden').removeClass('accordionContentVisible').slideUp('normal', function(){
2797                  jQuery(this).parent().trigger('accordionchange', {'newHeader' : headerSelected});
2798                });
2799              }
2800            }
2801            else{
2802              jQuery(this).prev('.accordionHeader').addClass('accordionHeaderVisible').removeClass('accordionHeaderHidden');
2803              if(options['collapsible']){
2804                jQuery(this).prev('.accordionHeader').addClass('accordionHeaderCollapsible').removeClass('accordionHeaderNoneCollapsible');
2805              }
2806              else{
2807                jQuery(this).prev('.accordionHeader').addClass('accordionHeaderNoneCollapsible').removeClass('accordionHeaderCollapsible');
2808              }
2809              jQuery(this).addClass('accordionContentVisible').removeClass('accordionContentHidden').slideDown('normal', function(){
2810                jQuery(this).parent().trigger('accordionchange', {'newHeader' : headerSelected});
2811                jQuery(this).parent().trigger('accordionactivate', {'newHeader' : headerSelected});
2812              });
2813            }
2814          }
2815          else{ 
2816            if(options['multiple'] == true){}
2817          	else{
2818              jQuery(this).prev('.accordionHeader').addClass('accordionHeaderHidden').removeClass('accordionHeaderVisible');
2819			  jQuery(this).addClass('accordionContentHidden').removeClass('accordionContentVisible').slideUp('normal');
2820          	}
2821            if(jQuery(this).hasClass('accordionContentVisible')){
2822              hasEntryVisible = true;
2823            }
2824            else{
2825              hasEntryInvisible = true;
2826            } 
2827        }
2828          
2829        });
2830        if(hasEntryInvisible){
2831          jQuery('#accordionOpener' + accordionID).show();
2832          jQuery('#accordionCloser' + accordionID).hide();
2833        }
2834        else{
2835          jQuery('#accordionOpener' + accordionID).hide();
2836          jQuery('#accordionCloser' + accordionID).show();
2837        }
2838        
2839        jQuery(window).trigger('resize');
2840
2841      });
2842    });
2843
2844    jQuery(this).on('accordionactivate', function(event, ui){
2845      try{
2846        var currentHeader          = ui.newHeader;
2847        var offsetTopCurrentHeader = (currentHeader.offset())['top'];
2848        var windowScrollTop        = jQuery(window).scrollTop();
2849        if(parseInt(offsetTopCurrentHeader) < windowScrollTop){
2850          offsetTopCurrentHeader = offsetTopCurrentHeader - wGetScrollTopHeight();
2851          jQuery('body, html').animate({scrollTop: offsetTopCurrentHeader});
2852          
2853        }
2854        else{
2855          var offsetBottomCurrentContent = (jQuery(currentHeader).next('.accordionContent').offset())['top'] + jQuery(currentHeader).next('.accordionContent').outerHeight();
2856          var windowBottom               = windowScrollTop + jQuery(window).height();
2857          if(offsetBottomCurrentContent > windowBottom){
2858            var scrollDiff =  offsetBottomCurrentContent - windowBottom;
2859            if(scrollDiff > offsetTopCurrentHeader - windowScrollTop){
2860              scrollDiff = offsetTopCurrentHeader - windowScrollTop;
2861            }
2862            scrollDiff = scrollDiff - wGetScrollTopHeight();
2863            jQuery('body, html').animate({scrollTop: windowScrollTop + scrollDiff});
2864          }
2865        }
2866      }
2867      catch(e){}
2868    });
2869
2870    jQuery(this).on('accordionchange', function(event, ui){
2871      var eventTarget = event.target || event.srcElement;
2872      var id          = eventTarget.id.replace(/accordion_/, '');
2873      if(options['rememberSelected']){
2874        if(ui.newHeader[0]){
2875          if(ui.newHeader[0].className.indexOf('accordionHeaderHidden') != -1){
2876            document.cookie = 'accordionTab_' + id + '=';
2877          }
2878          else{
2879            document.cookie = 'accordionTab_' + id + '=' + ui.newHeader[0].id.replace(/.*_/, '');
2880          }
2881        }
2882      }
2883      jQuery(window).trigger('resize');
2884    });
2885  });
2886};
2887
2888jQuery(window).on('hashchange', function(e){
2889  var jQueryHashId = location.hash.replace(/!/g, '\\!').replace(/\//g, '\\/').replace(/\./g, '\\.').replace(/\:/g, '\\:').replace('open_', 'anchor_');
2890  if(jQueryHashId != '' && jQuery(jQueryHashId).length > 0){
2891
2892    if(/#anchor/.test(jQueryHashId) && jQuery(jQueryHashId).length != 0 && jQuery(jQueryHashId).parent().attr('id') && jQuery(jQueryHashId).parent().attr('id').indexOf('tab_') == 0){
2893      document.location.hash = jQuery(jQueryHashId).parent().attr('id');
2894      jQueryHashId = '#' + jQuery(jQueryHashId).parent().attr('id');
2895    }
2896
2897    if(/_Tab-|#tab_/.test(jQueryHashId)){
2898      if(/_Tab-|tab_/.test(jQuery(jQueryHashId).attr('id'))){
2899        jQuery(jQueryHashId).trigger('click', [true]);
2900        try{
2901          offsetTopFixed = wGetScrollTopHeight();
2902          if(offsetTopFixed > 0){
2903            jQuery('body, html').animate({scrollTop: jQuery(jQueryHashId).parent().offset().top - offsetTopFixed}, 0);
2904          }
2905        }
2906        catch(e){}
2907      }
2908      else{
2909        var containerIndex = jQuery(jQueryHashId).parents('.containerInvisible').index();
2910        if(containerIndex >= 0){
2911          jQuery(jQueryHashId).parents('.containerInvisible').parent().parent().find('> .tabs > .tab:nth-child(' + (containerIndex + 1) + ')').trigger('click', [true]);
2912        }
2913      }
2914    }
2915    else if(/_Accordion-/.test(jQuery(jQueryHashId).attr('id'))){
2916      jQuery(jQueryHashId).trigger('click', [true]);
2917      var containerIndex = jQuery(jQueryHashId).parents('.containerInvisible, .accordionContentHidden').index();
2918
2919      if(containerIndex >= 0){
2920        jQuery(jQueryHashId).parents('.containerInvisible').parent().parent().find('> .tabs > .tab:nth-child(' + (containerIndex + 1) + ')').trigger('click', [true]);
2921        jQuery(jQueryHashId).parents('.accordionContent').prev('.accordionHeader').trigger('click', [true, true]);
2922      }
2923    }
2924    else{
2925      var containerIndex = jQuery(jQueryHashId).parents('.containerInvisible').index();
2926      if(containerIndex >= 0){
2927        jQuery(jQueryHashId).parents('.containerInvisible').parent().parent().find('> .tabs > .tab:nth-child(' + (containerIndex + 1) + ')').trigger('click', [true]);
2928      }
2929      jQuery(jQueryHashId).parents('.accordionContent').prev('.accordionHeader').trigger('click', [true]);
2930      wScrollSmoothToElement(jQuery(jQueryHashId));
2931    }
2932  }
2933});
2934
2935wOpenAllAccordions = function(id){
2936  
2937  jQuery('#accordion_' + id + ' .accordionContent').addClass('accordionContentVisible').removeClass('accordionContentHidden').slideDown('normal', function(){
2938    var headerSelected = jQuery(this).prev();
2939    jQuery(this).addClass('accordionContentVisible');
2940    jQuery(this).parent().trigger('accordionchange', {'newHeader' : headerSelected});
2941    jQuery(this).parent().trigger('accordionactivate', {'newHeader' : headerSelected});
2942    jQuery(window).trigger('resize');
2943  });
2944  jQuery('#accordion_' + id + ' .accordionHeader').addClass('ui-state-active').addClass('ui-accordion-header-active').addClass('accordionHeaderVisible').removeClass('accordionHeaderHidden');
2945  jQuery('#accordion_' + id + ' .accordionHeader span').addClass('ui-icon-triangle-1-s').removeClass('ui-icon-triangle-1-e');
2946  jQuery('#accordionOpener' + id).hide();
2947  jQuery('#accordionCloser' + id).show();
2948  jQuery(window).trigger('resize');
2949};
2950
2951wCloseAllAccordions = function(id){
2952  jQuery('#accordion_' + id + ' .accordionContent').addClass('accordionContentHidden').removeClass('accordionContentVisible').slideUp('normal', function(){
2953	jQuery(this).addClass('accordionContentHidden');
2954    jQuery(window).trigger('resize');
2955  });
2956  jQuery('#accordion_' + id + ' .accordionHeader').removeClass('ui-state-active').removeClass('ui-accordion-header-active').removeClass('accordionHeaderVisible').addClass('accordionHeaderHidden');
2957  jQuery('#accordion_' + id + ' .accordionHeader span').addClass('ui-icon-triangle-1-e').removeClass('ui-icon-triangle-1-s');
2958  jQuery('#accordionCloser' + id).hide();
2959  jQuery('#accordionOpener' + id).show();
2960};
2961
2962wsmn = function(ml){
2963  var mln = '';for(var i=0;i<ml.length/3;i++){mln = ml.substr(i*3+1,1)+mln;}
2964  var pms = '';
2965  if(/(\?.*)/.test(mln)){
2966    pms = RegExp.$1;
2967    mln = mln.replace(/(\?.*)/, '');
2968  }
2969  mln = 'm'+'a'+'ilt'+'o'+':'+mln.replace(/a/g, '@').replace(/e/g, '.').replace(/\*/g, 'a').replace(/;/g, 'e').replace(/:/g, 'o').replace(/,/g, 'u').replace(/\!/g, 'i');
2970  mln += pms;
2971  top.location.href = mln;
2972};
2973
2974var wMagnifierElement      = null;
2975var wMagnifierImageElement = null;
2976
2977jQuery.fn.wMagnifier = function(options){
2978
2979  jQuery.each(jQuery(this), function(){
2980    if(jQuery(this).attr('data-src2x')){
2981      jQuery(this).on('mouseover', function(event){
2982        jQuery('.wMagnifier').remove();
2983        jQuery('.wMagnifierMovingArea').remove();
2984
2985        var objectCurrent     = jQuery(this);
2986        objectCurrent.parent().css({'position' : 'relative', 'display' : jQuery(this).css('display') == 'inline-block' ? 'inline-block' : 'block'});
2987        objectCurrent.parent().append('<div id="wMagnifierMovingArea" class="wMagnifierMovingArea" style="z-index:1000;cursor:none;position:absolute;top:0;left:0;width:100%;height:100%"></div>');
2988        objectCurrent.parent().append('<div id="wMagnifier" class="wMagnifier"></div>');
2989        wMagnifierElement = jQuery('#wMagnifier');
2990        wMagnifierMovingAreaElement = jQuery('#wMagnifierMovingArea');
2991        wMagnifierImageElement = objectCurrent;
2992
2993        var offset = objectCurrent.offset();
2994        objectCurrent.data('offsetLeft', parseInt(offset.left));
2995        objectCurrent.data('offsetTop', parseInt(offset.top));
2996        objectCurrent.data('zoomerWidth', wMagnifierElement.width());
2997        objectCurrent.data('zoomerHeight', wMagnifierElement.height());
2998        objectCurrent.data('imageWidth',  objectCurrent.width());
2999        objectCurrent.data('imageHeight', objectCurrent.height());
3000        objectCurrent.data('borderLeftWidth', parseInt(wMagnifierElement.css('border-left-width')));
3001        objectCurrent.data('borderTopWidth', parseInt(wMagnifierElement.css('border-top-width')));
3002
3003        var scale = objectCurrent.width() / (typeof(objectCurrent.attr('width')) != 'undefined' ? objectCurrent.attr('width') : objectCurrent.attr('data-widthorig'));
3004        var ratio = 2 / scale;
3005
3006        var posX = parseInt(typeof(event.pageX !== 'undefined') ? event.pageX : (event.clientX + document.documentElement.scrollLeft)) - wMagnifierImageElement.data('offsetLeft');
3007        var posY = parseInt(typeof(event.pageY !== 'undefined') ? event.pageY : (event.clientY + document.documentElement.scrollTop)) - wMagnifierImageElement.data('offsetTop');
3008        wMagnifierElement.css({'left' : posX - wMagnifierImageElement.data('borderLeftWidth') - wMagnifierImageElement.data('zoomerWidth') / 2, 'top' : posY - wMagnifierImageElement.data('borderTopWidth') - wMagnifierImageElement.data('zoomerHeight') / 2, 'background-position' : String(-posX * ratio + wMagnifierImageElement.data('zoomerWidth') / 2) + 'px ' +  String(-posY * ratio + wMagnifierImageElement.data('zoomerHeight') / 2) + 'px'});
3009        wMagnifierElement.css({'background-image' : 'url(' + wMagnifierImageElement.attr('data-src2x') + ')', 'background-repeat' : 'no-repeat'});
3010
3011        wMagnifierMovingAreaElement.on('mousemove', function(event){
3012          var posX = parseInt(typeof(event.pageX !== 'undefined') ? event.pageX : (event.clientX + document.documentElement.scrollLeft)) - wMagnifierImageElement.data('offsetLeft');
3013          var posY = parseInt(typeof(event.pageY !== 'undefined') ? event.pageY : (event.clientY + document.documentElement.scrollTop)) - wMagnifierImageElement.data('offsetTop');
3014          wMagnifierElement.css({'left' : posX - wMagnifierImageElement.data('borderLeftWidth') - wMagnifierImageElement.data('zoomerWidth') / 2, 'top' : posY - wMagnifierImageElement.data('borderTopWidth') - wMagnifierImageElement.data('zoomerHeight') / 2, 'background-position' : String(-posX * ratio + wMagnifierImageElement.data('zoomerWidth') / 2) + 'px ' +  String(-posY * ratio + wMagnifierImageElement.data('zoomerHeight') / 2) + 'px'});
3015        });
3016        wMagnifierMovingAreaElement.on('mouseout click', function(event){
3017          jQuery('.wMagnifier').remove();
3018          jQuery('.wMagnifierMovingArea').remove();
3019        });
3020      });
3021     }
3022  });
3023};
3024
3025jQuery.fn.wLightbox = function(options){
3026  jQuery.each(jQuery(this), function(){
3027    jQuery(this).click(function(){
3028      var objectCurrent     = jQuery(this);
3029      return wLightbox(objectCurrent, options);
3030    });
3031  });
3032};
3033
3034
3035wLightbox = function(objectCurrent, options){
3036
3037  
3038  if(objectCurrent.length > 0){
3039    if(objectCurrent.attr('data-widthbox') != null){
3040  	  options["width"] = objectCurrent.attr('data-widthbox');
3041    }
3042    if(objectCurrent.attr('data-heightbox') != null){
3043  	  options["height"] = objectCurrent.attr('data-heightbox');
3044    }
3045  }
3046
3047  var elementCurrent, src, rel;
3048
3049  if(typeof(objectCurrent.jquery) == 'undefined'){
3050    options = objectCurrent;
3051    src = options['href'];
3052    rel = '';
3053    objectCurrent  = null;
3054  }
3055  else{
3056    elementCurrent    = objectCurrent.get(0);    
3057    src = objectCurrent.attr('href');
3058    if(!src){
3059      src = objectCurrent.find('img').attr('src');
3060    }
3061    rel = objectCurrent.attr('rel');
3062  }
3063
3064  var lightboxClassName = 'wLightbox-' + (options['class'] ? options['class'] : 'default');
3065
3066  var contentWidth       = 0;
3067  var contentHeight      = 0;
3068
3069  var elementsRel = jQuery("*[rel = '" + rel + "']");
3070  var numberRel   = elementsRel.length;
3071  var positionRel = 1;
3072  for(i = 0; i < numberRel; i++){
3073    if(elementCurrent && elementsRel[i] == elementCurrent){
3074      positionRel = i + 1;
3075      break;
3076    }
3077  }
3078
3079  var classPrev = 'wLightboxPrev' + (numberRel > 1 && positionRel > 1 ? ' wLightboxPrevAvailable' : '');
3080  var classNext = 'wLightboxNext' + (numberRel > 1 && positionRel < numberRel ? ' wLightboxNextAvailable' : '');
3081
3082  if(options['type'] == 'inline' || options['type'] == 'ajax'){
3083
3084    options['content'] = options['content'] || '';
3085
3086    if(options['type'] == 'ajax'){
3087      if(!options['width']){
3088        options['width'] = 'content';
3089      }
3090      if(!options['height']){
3091        options['height'] = 'content';
3092      }
3093    }
3094
3095    var boxWasOpened = true;
3096
3097    if(jQuery('.wLightbox').length == 0){
3098      jQuery('<div id="wLightbox" class="wLightbox wLightbox-' + options['type'] + ' ' + lightboxClassName + '" data-src="' + src + '"><div class="wLightboxBackground"></div><div class="wLightboxOuter"><div class="wLightboxInner" touchstart="event.preventDefault();" mousedown="event.preventDefault();"><div class="wLightboxCloser"></div>' + options['content'] + '<div class="wLightboxTitle"></div></div></div></div>').appendTo('body');
3099      //jQuery('.wLightboxCloser, .wLightboxBackground').on('mousedown touchstart', function(){wLightboxClose()});
3100
3101      jQuery(document).on('keydown', function(e){
3102        if(e.keyCode == 27){
3103          wLightboxClose();
3104        }
3105        else if(e.keyCode == 37){
3106          jQuery(elementsRel[parseInt(jQuery('.wLightboxPrev').data('entry'))]).trigger('click');
3107        }
3108        else if(e.keyCode == 39){
3109          jQuery(elementsRel[parseInt(jQuery('.wLightboxNext').data('entry'))]).trigger('click');
3110        }
3111      });
3112      boxWasOpened = false;
3113    }
3114
3115    var heightTitle = 0;
3116
3117    if(elementCurrent && elementCurrent.getAttribute('title') && elementCurrent.getAttribute('title') != ''){
3118      jQuery('.wLightboxTitle').show().html(elementCurrent.getAttribute('title'));
3119    }
3120    else{
3121      jQuery('.wLightboxTitle').hide();
3122    }
3123
3124    heightTitle = jQuery('.wLightboxTitle').outerHeight();
3125
3126    var maxWidthBox  = (window.innerWidth ? window.innerWidth : (document.documentElement ? document.documentElement.offsetWidth : document.body.clientWidth))    - (parseInt(jQuery('.wLightboxOuter').css('padding-left')) + parseInt(jQuery('.wLightboxInner').css('border-left-width'))) * 2;
3127    var maxHeightBox = (window.innerHeight ? window.innerHeight : (document.documentElement ? document.documentElement.offsetHeight : document.body.clientHeight)) - (parseInt(jQuery('.wLightboxOuter').css('padding-top')) + parseInt(jQuery('.wLightboxInner').css('border-top-width'))) * 2 - heightTitle;
3128
3129    if(/^(\d+)px$/.test(options['width'])){
3130      maxWidthBox = parseInt(RegExp.$1);
3131    }
3132    else if(/^(\d+)%$/.test(options['width'])){
3133      maxWidthBox = parseInt(jQuery(window).width()) * RegExp.$1 / 100;
3134    }
3135
3136    if(/^(\d+)px$/.test(options['height'])){
3137      maxHeightBox = parseInt(RegExp.$1);
3138    }
3139    else if(/^(\d+)%$/.test(options['height'])){
3140      maxHeightBox = parseInt(jQuery(window).height()) * RegExp.$1 / 100;
3141    }
3142
3143    if(options && options['width'] && /^\d+(.\d+)?$/.test(options['width'])){
3144      contentWidth = options['width'];
3145    }
3146    else{
3147      contentWidth = maxWidthBox;
3148    }
3149
3150    if(options && options['height'] && /^\d+(.\d+)?$/.test(options['height'])){
3151      contentHeight = options['height'];
3152    }
3153    else{
3154      contentHeight = maxHeightBox;
3155    }
3156
3157    var pageRatio    = maxWidthBox / maxHeightBox;
3158    var contentRatio = contentWidth / contentHeight;
3159
3160    var lightboxWidth  = contentWidth;
3161    var lightboxHeight = contentHeight + heightTitle;
3162
3163    if(contentWidth > maxWidthBox || contentHeight > maxHeightBox){
3164      if(contentRatio > pageRatio){
3165        lightboxWidth  = maxWidthBox;
3166        lightboxHeight = Math.round(maxWidthBox / contentRatio) + heightTitle;
3167      }
3168      else{
3169        lightboxWidth  = Math.round(maxHeightBox * contentRatio);
3170        lightboxHeight = maxHeightBox + heightTitle;
3171      }
3172    }
3173
3174    widthAttrib  = String(lightboxWidth) + 'px';
3175    heightAttrib = String(lightboxHeight) + 'px';
3176
3177    if(options['height'] == 'content'){
3178      jQuery('.wLightboxOuter').css({'max-height' : '100%'});
3179    }
3180    else{
3181      jQuery('.wLightboxOuter').css({'height' : heightAttrib});
3182    }
3183
3184    if(options['width'] == 'content'){
3185      jQuery('.wLightboxInner').css({'max-width' : '100%'});
3186    }
3187    else{
3188      jQuery('.wLightboxInner').css({'width' : widthAttrib});
3189    }
3190
3191    jQuery('.wLightboxPrev').data('entry', positionRel - 2);
3192    jQuery('.wLightboxNext').data('entry', positionRel);
3193
3194    if(boxWasOpened){
3195      jQuery('.wLightboxPrev').attr('class', classPrev);
3196      jQuery('.wLightboxNext').attr('class', classNext);
3197      jQuery('.wLightboxImage').attr('src', src);
3198      jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading');
3199    }
3200    else{
3201      jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading');
3202      jQuery('.wLightboxOuter, .wLightboxBackground').on('click', function(){
3203        wLightboxClose()
3204      });
3205      jQuery('.wLightboxPrev, .wLightboxNext').on('click', function(){
3206        jQuery('.wLightbox').removeClass('wLightboxStatusLoaded');
3207        jQuery(elementsRel[jQuery(this).data('entry')]).trigger('click');
3208        event.stopPropagation();
3209      });
3210    }
3211    if(options['type'] == 'ajax'){
3212      jQuery.ajax({type: "GET", url: src, success: function(result){
3213        jQuery('.wLightboxCloser').after('<div class="wLightboxContent">' + result + '</div>');
3214        if(options['height'] == 'content'){
3215          jQuery('.wLightboxContent').css({'max-height' : String(lightboxHeight) + 'px'});
3216        }
3217      }});
3218    }
3219    if(typeof(wOnAfterInitLightbox) == 'function'){
3220      wOnAfterInitLightbox();
3221    }
3222  }
3223  else if(/\.(jpg|jpeg|gif|png)$/i.test(src) || options['type'] == 'image' || objectCurrent && objectCurrent.attr('data-lightboxtype') == 'image'){
3224    var image = new Image();
3225    jQuery('.wLightbox').removeClass('wLightboxStatusLoaded').addClass('wLightboxStatusLoading');
3226    image.onload = function(){
3227
3228      var imageRatio     = image.width / image.height;
3229      var lightboxWidth  = image.width;
3230      var lightboxHeight = image.height;
3231
3232      var boxWasOpened   = true;
3233      var titleInnerHTML = '';
3234
3235      if(jQuery('.wLightbox').length == 0){
3236        jQuery('<div id="wLightbox" class="wLightbox wLightbox-image ' + lightboxClassName + '" data-src="' + src + '"><div class="wLightboxBackground"></div><div class="wLightboxOuter"><div class="wLightboxInner"><div class="wLightboxCloser"></div><div class="' + classPrev + '"></div><div class="' + classNext + '"></div><div class="wLightboxImageOuter"><img class="wLightboxImage" src="' + src + '"/></div><div class="wLightboxFooter"><div class="wLightboxTitle">' + titleInnerHTML + '</div><div class="wLightboxDescription">' + titleInnerHTML + '</div></div></div></div></div>').appendTo('body');
3237
3238        jQuery(document).on('keydown', function(e){
3239          if(e.keyCode == 27){
3240            wLightboxClose();
3241          }
3242          else if(e.keyCode == 37){
3243            jQuery(elementsRel[parseInt(jQuery('.wLightboxPrev').data('entry'))]).trigger('click');
3244          }
3245          else if(e.keyCode == 39){
3246            jQuery(elementsRel[parseInt(jQuery('.wLightboxNext').data('entry'))]).trigger('click');
3247          }
3248        });
3249
3250        boxWasOpened = false;
3251      }
3252
3253      var maxWidthBox  = (window.innerWidth ? window.innerWidth : (document.documentElement ? document.documentElement.offsetWidth : document.body.clientWidth)) - (parseInt(jQuery('.wLightboxOuter').css('padding-left')) + parseInt(jQuery('.wLightboxInner').css('border-left-width'))) * 2;
3254
3255      if(elementCurrent && elementCurrent.getAttribute('title') && elementCurrent.getAttribute('title') != ''){
3256        jQuery('.wLightboxTitle').show().html(elementCurrent.getAttribute('title'));
3257      }
3258      else{
3259        jQuery('.wLightboxTitle').hide();
3260      }
3261
3262      if(elementCurrent && elementCurrent.getAttribute('data-description') != ''){
3263        jQuery('.wLightboxDescription').show();
3264        var diffWidthDescription = parseInt(jQuery('.wLightboxInner').width() - jQuery('.wLightboxDescription').width());
3265        jQuery('.wLightboxDescription').css({'width' : maxWidthBox - diffWidthDescription, 'visibility' : 'hidden'}).show().html(elementCurrent.getAttribute('data-description'));
3266      }
3267      else{
3268        jQuery('.wLightboxDescription').hide();
3269      }
3270
3271      if(objectCurrent && objectCurrent.attr('data-lightboxdownloadable') == '1'){
3272        jQuery('.wLightboxDownload').remove();
3273        var srcDownload = src;
3274        if(objectCurrent.attr('data-srcdownload')){
3275          srcDownload = objectCurrent.attr('data-srcdownload');
3276        }
3277        jQuery('.wLightboxFooter').addClass('wLightboxFooterHasDownload').append('<div class="wLightboxDownload" data-src="' + srcDownload + '" title="Download"></div>');
3278        jQuery('.wLightboxDownload').on('click', function (event){
3279          window.open(jQuery(this).data('src'));
3280        });
3281      }
3282      else{
3283        jQuery('.wLightboxFooter').removeClass('wLightboxFooterHasDownload');
3284      }
3285
3286      heightFooter = jQuery('.wLightboxFooter').outerHeight();
3287      jQuery('.wLightboxDescription').css({'width' : '', 'visibility' : ''})
3288
3289      var maxHeightBox = (window.innerHeight ? window.innerHeight : (document.documentElement ? document.documentElement.offsetHeight : document.body.clientHeight)) - (parseInt(j
3289Query('.wLightboxOuter').css('padding-top')) + parseInt(jQuery('.wLightboxInner').css('border-top-width'))) * 2 - heightFooter;
3290
3291      if(/^(\d+)px$/.test(options['width'])){
3292        maxWidthBox = parseInt(RegExp.$1);
3293      }
3294      else if(/^(\d+)%$/.test(options['width'])){
3295        maxWidthBox = parseInt(jQuery(window).width()) * RegExp.$1 / 100;
3296      }
3297
3298      var pageRatio    = maxWidthBox / maxHeightBox;
3299
3300      if(image.width > maxWidthBox || image.height > maxHeightBox){
3301        if(options['scrollIfToHeight']){
3302          if(imageRatio > pageRatio){
3303            lightboxWidth  = maxWidthBox;
3304            lightboxHeight = Math.round(maxWidthBox / imageRatio) + heightFooter;
3305          }
3306          else{
3307            lightboxWidth  = Math.round(image.width > maxWidthBox ? maxWidthBox : image.width);
3308            lightboxHeight = maxHeightBox;
3309            jQuery('.wLightboxImageOuter').css({'max-height' : String(lightboxHeight - heightFooter) + 'px', 'overflow' : 'auto'});
3310            jQuery('.wLightboxImage').css({'max-height' : ''});
3311          }
3312        }
3313        else{
3314          if(imageRatio > pageRatio){
3315            lightboxWidth  = maxWidthBox;
3316            lightboxHeight = Math.round(maxWidthBox / imageRatio) + heightFooter;
3317          }
3318          else{
3319            lightboxWidth  = Math.round(maxHeightBox * imageRatio);
3320            lightboxHeight = maxHeightBox + heightFooter;
3321          }
3322        }
3323      }
3324      else{
3325        lightboxHeight = image.height + heightFooter;
3326      }
3327
3328      widthAttrib  = String(Math.round(lightboxWidth))  + 'px';
3329      heightAttrib = String(lightboxHeight) + 'px';
3330
3331      jQuery('.wLightboxOuter').css({'height' : heightAttrib});
3332      jQuery('.wLightboxInner').css({'width' : widthAttrib});
3333
3334      jQuery('.wLightboxPrev').data('entry', positionRel - 2);
3335      jQuery('.wLightboxNext').data('entry', positionRel);
3336
3337      jQuery('.wLightboxOuter').on('transitionend', function(event){
3338        if(jQuery('.wLightboxOuter').data('transisionended') != '1'){
3339          jQuery('.wLightboxOuter').data('transisionended', '1');
3340
3341
3342          heightFooter = jQuery('.wLightboxFooter').outerHeight();
3343
3344          var maxWidthBox  = (window.innerWidth ? window.innerWidth : (document.documentElement ? document.documentElement.offsetWidth : document.body.clientWidth))    - (parseInt(jQuery('.wLightboxOuter').css('padding-left')) + parseInt(jQuery('.wLightboxInner').css('border-left-width'))) * 2;
3345          var maxHeightBox = (window.innerHeight ? window.innerHeight : (document.documentElement ? document.documentElement.offsetHeight : document.body.clientHeight)) - (parseInt(jQuery('.wLightboxOuter').css('padding-top')) + parseInt(jQuery('.wLightboxInner').css('border-top-width'))) * 2 - heightFooter;
3346
3347          if(/^(\d+)px$/.test(options['width'])){
3348            maxWidthBox = parseInt(RegExp.$1);
3349          }
3350          else if(/^(\d+)%$/.test(options['width'])){
3351            maxWidthBox = parseInt(jQuery(window).width()) * RegExp.$1 / 100;
3352          }
3353
3354          var pageRatio    = maxWidthBox / maxHeightBox;
3355
3356          if(image.width > maxWidthBox || image.height > maxHeightBox){
3357            if(options['scrollIfToHeight']){
3358               if(imageRatio > pageRatio){
3359                 lightboxWidth  = maxWidthBox;
3360                 lightboxHeight = Math.round(maxWidthBox / imageRatio) + heightFooter;
3361               }
3362               else{
3363                 lightboxWidth  = Math.round(image.width > maxWidthBox ? maxWidthBox : image.width);
3364                 lightboxHeight = maxHeightBox;
3365                 jQuery('.wLightboxImageOuter').css({'max-height' : String(lightboxHeight - heightFooter) + 'px', 'overflow' : 'auto'});
3366                 jQuery('.wLightboxImage').css({'max-height' : ''});
3367               }
3368             }
3369             else{
3370              if(imageRatio > pageRatio){
3371                lightboxWidth  = maxWidthBox;
3372                lightboxHeight = Math.round(maxWidthBox / imageRatio) + heightFooter;
3373              }
3374              else{
3375                lightboxWidth  = Math.round(maxHeightBox * imageRatio);
3376                lightboxHeight = maxHeightBox + heightFooter;
3377              }
3378            }
3379          }
3380          else{
3381            lightboxHeight = image.height + heightFooter;
3382          }
3383          heightAttrib = String(lightboxHeight) + 'px';
3384          jQuery('.wLightboxOuter').css({'height' : heightAttrib});
3385        }
3386      });
3387
3388      if(boxWasOpened){
3389        jQuery('.wLightboxPrev').attr('class', classPrev);
3390        jQuery('.wLightboxNext').attr('class', classNext);
3391        jQuery('.wLightboxImage').attr('src', src);
3392        jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading');
3393      }
3394      else{
3395        jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading');
3396        jQuery('.wLightboxOuter, .wLightboxBackground').on('click', function(event){
3397          wLightboxClose()
3398        });
3399        jQuery('.wLightboxPrev, .wLightboxNext').on('click', function(event){
3400          jQuery('.wLightbox').removeClass('wLightboxStatusLoaded');
3401          jQuery(elementsRel[jQuery(this).data('entry')]).trigger('click');
3402          event.stopPropagation();
3403        });
3404      }
3405      if(typeof(wOnAfterInitLightbox) == 'function'){
3406        wOnAfterInitLightbox();
3407      }
3408    };
3409    image.src = src;
3410  }
3411  else if(/\.(mpeg|mp4|m4v)(\?[^\/]*)*$/i.test(src) || options['type'] == 'video' ||objectCurrent && objectCurrent.attr('data-lightboxtype') == 'video'){
3412
3413    var boxWasOpened = true;
3414
3415    var videoWidth = 0, videoHeight = 0, videoRatio = 0;
3416
3417    if(jQuery('.wLightbox').length == 0){
3418      var titleInnerHTML = '';
3419      var mimeTypeVideo  = 'video/mp4';
3420      jQuery('<div id="wLightbox" class="wLightbox wLightbox-image ' + lightboxClassName + '" data-src="' + src + '"><div class="wLightboxBackground"></div><div class="wLightboxOuter"><div class="wLightboxInner" ontouchstart="event.preventDefault();" onmousedown="event.preventDefault();"><div class="wLightboxCloser"></div><video controls="" autoplay="autoplay" style="max-width:100%;width:auto;height:auto;"><source src="' + src + '" type="' + mimeTypeVideo + '" /></video><div class="wLightboxFooter"><div class="wLightboxTitle">' + titleInnerHTML + '</div></div></div></div></div>').appendTo('body');
3421      jQuery(document).on('keydown', function(e){
3422        if(e.keyCode == 27){
3423          wLightboxClose();
3424        }
3425        else if(e.keyCode == 37){
3426          jQuery(elementsRel[parseInt(jQuery('.wLightboxPrev').data('entry'))]).trigger('click');
3427        }
3428        else if(e.keyCode == 39){
3429          jQuery(elementsRel[parseInt(jQuery('.wLightboxNext').data('entry'))]).trigger('click');
3430        }
3431      });
3432
3433      boxWasOpened = false;
3434    }
3435    else{
3436      jQuery('.wLightbox').removeClass('wLightboxStatusLoaded').addClass('wLightboxStatusLoading');
3437    }
3438
3439    if(elementCurrent && elementCurrent.getAttribute('title') && elementCurrent.getAttribute('title') != ''){
3440      jQuery('.wLightboxTitle').show().html(elementCurrent.getAttribute('title'));
3441    }
3442    else{
3443      jQuery('.wLightboxTitle').hide();
3444    }
3445
3446    if(objectCurrent && objectCurrent.attr('data-lightboxdownloadable') == '1'){
3447      jQuery('.wLightboxDownload').remove();
3448      jQuery('.wLightboxFooter').addClass('wLightboxFooterHasDownload').append('<div class="wLightboxDownload" data-src="' + src + '" title="Download"></div>');
3449      jQuery('.wLightboxDownload').on('click', function (event){
3450        window.open(jQuery(this).data('src'));
3451      });
3452    }
3453    else{
3454      jQuery('.wLightboxFooter').removeClass('wLightboxFooterHasDownload');
3455    }
3456
3457    var heightFooter = jQuery('.wLightboxFooter').outerHeight();
3458
3459    var maxWidthBox  = (window.innerWidth ? window.innerWidth : (document.documentElement ? document.documentElement.offsetWidth : document.body.clientWidth))    - (parseInt(jQuery('.wLightboxOuter').css('padding-left')) + parseInt(jQuery('.wLightboxInner').css('border-left-width'))) * 2;
3460    var maxHeightBox = (window.innerHeight ? window.innerHeight : (document.documentElement ? document.documentElement.offsetHeight : document.body.clientHeight)) - (parseInt(jQuery('.wLightboxOuter').css('padding-top')) + parseInt(jQuery('.wLightboxInner').css('border-top-width'))) * 2 - heightFooter;
3461
3462    if(/^(\d+)px$/.test(options['width'])){
3463      maxWidthBox = parseInt(RegExp.$1);
3464    }
3465    else if(/^(\d+)%$/.test(options['width'])){
3466      maxWidthBox = parseInt(jQuery(window).width()) * RegExp.$1 / 100;
3467    }
3468
3469
3470    var pageRatio    = maxWidthBox / maxHeightBox;
3471
3472    jQuery('.wLightbox video').on('loadedmetadata', function(event){
3473      videoWidth     = jQuery(this).get(0).videoWidth;
3474      videoHeight    = jQuery(this).get(0).videoHeight;
3475
3476      videoRatio     = videoWidth / videoHeight;
3477      lightboxWidth  = videoWidth;
3478      lightboxHeight = videoHeight;
3479
3480      if(videoWidth > maxWidthBox || videoHeight > maxHeightBox){
3481        if(videoRatio > pageRatio){
3482          lightboxWidth  = maxWidthBox;
3483          lightboxHeight = Math.round(maxWidthBox / videoRatio) + heightFooter;
3484        }
3485        else{
3486          lightboxWidth  = Math.round(maxHeightBox * videoRatio);
3487          lightboxHeight = maxHeightBox + heightFooter;
3488        }
3489      }
3490      else{
3491        lightboxHeight = lightboxHeight + heightFooter;
3492      }
3493
3494      widthAttrib  = String(lightboxWidth)  + 'px';
3495      heightAttrib = String(lightboxHeight) + 'px';
3496
3497      jQuery('.wLightboxOuter').css({'height' : heightAttrib});
3498      jQuery('.wLightboxInner').css({'width' : widthAttrib});
3499
3500      jQuery('.wLightboxPrev').data('entry', positionRel - 2);
3501      jQuery('.wLightboxNext').data('entry', positionRel);
3502
3503      if(boxWasOpened){
3504        jQuery('.wLightboxPrev').attr('class', classPrev);
3505        jQuery('.wLightboxNext').attr('class', classNext);
3506        jQuery('.wLightboxImage').attr('src', src);
3507        jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading');
3508      }
3509      else{
3510        jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading');
3511        jQuery('.wLightboxCloser, .wLightboxBackground').on('click', function(event){
3512          wLightboxClose()
3513        });
3514        jQuery('.wLightboxPrev, .wLightboxNext').on('click', function(event){
3515          jQuery('.wLightbox').removeClass('wLightboxStatusLoaded');
3516          jQuery(elementsRel[jQuery(this).data('entry')]).trigger('click');
3517          event.stopPropagation();
3518        });
3519      }
3520    });
3521    if(typeof(wOnAfterInitLightbox) == 'function'){
3522      wOnAfterInitLightbox();
3523    }
3524  }
3525  else{
3526
3527    var boxWasOpened = true;
3528
3529    if(jQuery('.wLightbox').length == 0){
3530      jQuery('<div id="wLightbox" class="wLightbox wLightbox-iframe ' + lightboxClassName + '" data-src="' + src + '"><div class="wLightboxBackground"></div><div class="wLightboxOuter"><div class="wLightboxInner"><div class="wLightboxCloser"></div><iframe id="wLightboxIframe" class="wLightboxIframe" allowfullscreen="true" src="' + src + '"></iframe><div class="wLightboxTitle"></div></div></div></div>').appendTo('body');
3531      jQuery('.wLightboxCloser, .wLightboxBackground').on('mousedown touchstart', function(){wLightboxClose()});
3532
3533      jQuery(document).on('keydown', function(e){
3534        if(e.keyCode == 27){
3535          wLightboxClose();
3536        }
3537        else if(e.keyCode == 37){
3538          jQuery(elementsRel[parseInt(jQuery('.wLightboxPrev').data('entry'))]).trigger('click');
3539        }
3540        else if(e.keyCode == 39){
3541          jQuery(elementsRel[parseInt(jQuery('.wLightboxNext').data('entry'))]).trigger('click');
3542        }
3543      });
3544
3545      boxWasOpened = false;
3546    }
3547
3548    var heightTitle = 0;
3549
3550    if(elementCurrent && elementCurrent.getAttribute('title') != ''){
3551      jQuery('.wLightboxTitle').show().html(elementCurrent.getAttribute('title'));
3552    }
3553    else{
3554      jQuery('.wLightboxTitle').hide();
3555    }
3556
3557    heightTitle = jQuery('.wLightboxTitle').outerHeight();
3558
3559    var maxWidthBox  = (window.innerWidth ? window.innerWidth : (document.documentElement ? document.documentElement.offsetWidth : document.body.clientWidth))    - (parseInt(jQuery('.wLightboxOuter').css('padding-left')) + parseInt(jQuery('.wLightboxInner').css('border-left-width'))) * 2;
3560    var maxHeightBox = (window.innerHeight ? window.innerHeight : (document.documentElement ? document.documentElement.offsetHeight : document.body.clientHeight)) - (parseInt(jQuery('.wLightboxOuter').css('padding-top')) + parseInt(jQuery('.wLightboxInner').css('border-top-width'))) * 2 - heightTitle;
3561
3562    if(/^(\d+)px$/.test(options['width'])){
3563      maxWidthBox = parseInt(RegExp.$1);
3564    }
3565    else if(/^(\d+)%$/.test(options['width'])){
3566      maxWidthBox = parseInt(jQuery(window).width()) * RegExp.$1 / 100;
3567    }
3568
3569    if(/^(\d+)px$/.test(options['height'])){
3570      maxHeightBox = parseInt(RegExp.$1);
3571    }
3572    else if(/^(\d+)%$/.test(options['height'])){
3573      maxHeightBox = parseInt(jQuery(window).height()) * RegExp.$1 / 100;
3574    }
3575
3576    if(options && options['width'] && /^\d+(.\d+)?$/.test(options['width'])){
3577      contentWidth = options['width'];
3578    }
3579    else{
3580      contentWidth = maxWidthBox;
3581    }
3582
3583    if(options && options['height'] && /^\d+(.\d+)?$/.test(options['height'])){
3584      contentHeight = options['height'];
3585    }
3586    else{
3587      contentHeight = maxHeightBox;
3588    }
3589
3590    var pageRatio    = maxWidthBox / maxHeightBox;
3591    var contentRatio = contentWidth / contentHeight;
3592
3593    var lightboxWidth  = contentWidth;
3594    var lightboxHeight = contentHeight + heightTitle;
3595
3596    if(contentWidth > maxWidthBox || contentHeight > maxHeightBox){
3597      if(contentRatio > pageRatio){
3598        lightboxWidth  = maxWidthBox;
3599        lightboxHeight = Math.round(maxWidthBox / contentRatio) + heightTitle;
3600      }
3601      else{
3602        lightboxWidth  = Math.round(maxHeightBox * contentRatio);
3603        lightboxHeight = maxHeightBox + heightTitle;
3604      }
3605    }
3606
3607    widthAttrib  = String(lightboxWidth) + 'px';
3608    heightAttrib = String(lightboxHeight) + 'px';
3609
3610    jQuery('.wLightboxOuter').css({'height' : heightAttrib});
3611    jQuery('.wLightboxInner').css({'width' : widthAttrib});
3612
3613    jQuery('.wLightboxPrev').data('entry', positionRel - 2);
3614    jQuery('.wLightboxNext').data('entry', positionRel);
3615
3616    if(boxWasOpened){
3617      jQuery('.wLightboxPrev').attr('class', classPrev);
3618      jQuery('.wLightboxNext').attr('class', classNext);
3619      jQuery('.wLightboxImage').attr('src', src);
3620      jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading');
3621    }
3622    else{
3623      jQuery('.wLightbox').addClass('wLightboxStatusLoaded').removeClass('wLightboxStatusLoading');
3624      jQuery('.wLightboxOuter, .wLightboxBackground').on('click', function(){
3625        wLightboxClose()
3626      });
3627      jQuery('.wLightboxPrev, .wLightboxNext').on('click', function(){
3628        jQuery('.wLightbox').removeClass('wLightboxStatusLoaded');
3629        jQuery(elementsRel[jQuery(this).data('entry')]).trigger('click');
3630        event.stopPropagation();
3631      });
3632    }
3633    if(typeof(wOnAfterInitLightbox) == 'function'){
3634      wOnAfterInitLightbox();
3635    }
3636  }
3637  jQuery('body').addClass('wglBox');
3638  return false;
3639};
3640
3641wLightboxClose = function(){
3642  jQuery('.wLightbox').remove();
3643  jQuery('body').removeClass('wglBox');
3644  jQuery(document).off('keydown');
3645};
3646
3647wStartReadingText = function(element, readerPanelEmbed){
3648  
3649  if(readerPanelEmbed && readerPanelEmbed.className.indexOf('wReaderPanelEmbed') != -1){
3650    readerPanelEmbed.className = 'wReaderPanelEmbed isReading';
3651  }  
3652 
3653  var elementToRead = element;  
3654  var textToRead    = (elementToRead.getAttribute('data-readertextpre') ? elementToRead.getAttribute('data-readertextpre') : '') + elementToRead.innerText;
3655
3656  if(window.speechSynthesis){
3657    if(!window.speechSynthesis.speaking){  
3658    
3659      var textToSpeak = new SpeechSynthesisUtterance(textToRead);
3660      window.speechSynthesis.speak(textToSpeak);
3661    }  
3662    else if(window.speechSynthesis.paused){      
3663      window.speechSynthesis.resume();
3664    }  
3665  } 
3666};
3667
3668wPauseReadingText = function(element, readerPanelEmbed){
3669  
3670  if(readerPanelEmbed && readerPanelEmbed.className.indexOf('wReaderPanelEmbed') != -1){
3671    readerPanelEmbed.className = 'wReaderPanelEmbed';
3672  }  
3673  
3674  window.speechSynthesis.pause();
3675
3676};
3677
3678wStopReadingText = function(element, readerPanelEmbed){
3679  
3680  if(readerPanelEmbed && readerPanelEmbed.className.indexOf('wReaderPanelEmbed') != -1){
3681    readerPanelEmbed.className = 'wReaderPanelEmbed';
3682  }  
3683  
3684  if(window.speechSynthesis.speaking){    
3685    window.speechSynthesis.cancel();
3686  }
3687};
3688/*
3689////////////////////////////////////////////////////////////////
3690//
3691// Allgemeine JavaScript Funktionen
3692//
3693// Weblication CMS BASE Classic
3694// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de
3695// erstellt mit Weblication Content Management Server, www.weblication.de
3696//
3697////////////////////////////////////////////////////////////////
3698*/
3699
3700/*
3701////////////////////////////////////////////////////////////////
3702//
3703// Allgemeine JavaScript Funktionen
3704//
3705// Weblication CMS BASE Classic
3706// erstellt durch Scholl Communications AG, 77694 Kehl, www.scholl.de
3707// erstellt mit Weblication Content Management Server, www.weblication.de
3708//
3709////////////////////////////////////////////////////////////////
3710*/
3711
3712wAllowMinimize                          = true;
3713wResetConditionalFormdataOnHide         = true; //Falls beim Ausblenden bedingter Formularfelder die Werte zurückgesetzt werden sollen
3714wHighlightBlockRoot                     = 'blockLeftContentRightInner'; //Wurzelemenent beim Hervorheben über den Highlight-Parameter
3715wCookieNoticeVar                        = ''; //Variante des Datenschutzhinweises. Falls sich dieser geändert hat, kann über einen anderen Wert das erneute Anzeigen erreicht werden.
3716wTrimInputsBeforeValidateOnBlur         = true; //Falls Leerzeichen vor und nach dem Eingeabwert bei der Inline-Validierung gelöscht werden sollen.
3717//wUiTmp['wGlobalProjectPath']            = '/wLayout'; //optionale Angabe des globalen Projektpfades, falls die Variable für den globalen Projektpfad über die ui.js nicht ermittelt werden kann
3718
3719////////////////////////////////////////////////////////////////
3720//
3721// @method void wEmbedNavpoint(id, url, mode)
3722//
3723// @desc Öffnet einen eingebetteten Navigationspunkt als Dropdown bzw. Mega-Menü
3724//
3725// @return void
3726//
3727////////////////////////////////////////////////////////////////
3728
3729function wEmbedNavpoint(id, url, mode){
3730
3731  if(typeof wEditor == 'object'){
3732    return false;
3733  }
3734
3735  if(document.all){
3736    var versionIE = (navigator.appVersion.match(/MSIE (\d+\..)/)[1]).replace(/\..*/, '');
3737    if(versionIE < 8){
3738      return false;
3739    }
3740  }
3741
3742  var clientWidth = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
3743  if(clientWidth < 768){
3744    return false;
3745  }
3746
3747  if(mode == 'embed'){
3748    if(jQuery('#navpoint_' + id).data('hasLoaded') == '1'){
3749    }
3750    else{
3751      url += (url.indexOf('?') == -1 ? '?' : '&') + 'viewmode=embed';
3752      if(typeof(wNavidStandard) != 'undefined' && wNavidStandard != ''){
3753        url += '&navid=' + wNavidStandard;
3754      }
3755      url = url.replace('[URL]', location.pathname + location.search);
3756      jQuery.ajax({
3757        type: "GET",
3758        url: url,
3759        async: true,
3760        success: function(result){
3761          result = result.replace(/\n/g, '_wNL-');
3762          result = result.replace(/\s+id="[^"]+"/gim, '');
3763          result = result.replace(/^.*<!--\s*CONTENT:START\s*-->/im, '');
3764          result = result.replace(/<!--\s*CONTENT:STOP\s*-->.*$/im, '');
3765          result = result.replace(/_wNL-/g, "\n");
3766          jQuery('#navpoint_' + id).data('hasLoaded', '1');
3767          jQuery('#navEmbed_' + id).html(result);
3768
3769          var navpointLeft = jQuery('#navpoint_' + id).offset().left;
3770
3771          if(jQuery('#navEmbed_' + id).parent().children("a").attr('data-megadropdown') != 'load'){
3772          	jQuery('#navEmbed_' + id).fadeIn({'duration' : 200, 'queue' : false});
3773          }
3774          
3775          var layerLeft = jQuery('#navEmbed_' + id).offset().left;
3776
3777          var blockMainRight = jQuery('#blockBeforeLeftContentRightInner').offset().left + jQuery('#blockBeforeLeftContentRightInner').width();
3778
3779          if(layerLeft < navpointLeft){
3780            jQuery('#navEmbed_' + id).css('left', String(navpointLeft - layerLeft - 6) + 'px');
3781          }
3782
3783          var layerRight = jQuery('#navEmbed_' + id).offset().left + jQuery('#navEmbed_' + id).width();
3784
3785          if(layerRight > blockMainRight){
3786            jQuery('#navEmbed_' + id).css('left', String(parseInt(jQuery('#navEmbed_' + id).css('left')) - (layerRight - blockMainRight)) + 'px');
3787          }
3788
3789          var diffWidthNavEmbed = parseInt(jQuery('#navEmbed_' + id).css('padding-left')) + parseInt(jQuery('#navEmbed_' + id).css('padding-right')) + parseInt(jQuery('#navEmbed_' + id).css('border-left-width')) + parseInt(jQuery('#navEmbed_' + id).css('border-right-width'));
3790
3791          jQuery('#navEmbed_' + id).css({'left': 0, 'width' : parseInt(jQuery('#navigationMain').parent().width() - diffWidthNavEmbed)});
3792          /* Abfrage Dropdown-Navigation Start - ueber CSS-Variable $navigationPreviewLink aktivierbar */
3793          if(jQuery('#navEmbed_' + id).parent().children("a").attr("data-clickable")){
3794            jQuery('#navEmbed_' + id).parent().children("a").click(function(event){
3795              if((document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth) < 768){
3796                return false;
3797              }
3798              if(jQuery('#navEmbed_' + id).css('display') == 'none') jQuery('#navEmbed_' + id).css({'opacity':'1'}).fadeIn({'duration' : 0, 'queue' : false});
3799              else jQuery('#navEmbed_' + id).hide({'duration' : 0, 'queue' : false}).css({'opacity':'1'});
3800            });
3801          }
3802          else {
3803            jQuery('#navEmbed_' + id).parent().mouseenter(function(event){
3804              if((document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth) < 768){
3805                return false;
3806              }
3807              jQuery('#navEmbed_' + id).css({'opacity':'1'}).fadeIn({'duration' : 400, 'queue' : false});
3808            });
3809           
3810            jQuery('#navpoint_' + id).parent().mouseleave(function(event){
3811               jQuery('#navEmbed_' + id).hide({'duration' : 0, 'queue' : false}).css({'opacity':'1'});
3812            });
3813          }
3814          /* Abfrage Dropdown-Navigation Ende */   
3815        }
3816      });
3817    }
3818  }
3819  else{
3820    if(jQuery('#navpoint_' + id).data('hasLoaded') == '1'){
3821      jQuery('#navEmbed_' + id).show();
3822    }
3823    else{
3824      url = url.indexOf('?') == -1 ? url + '?parentIframeId=navEmbedIframe_'+id : url + '&parentIframeId=navEmbedIframe_'+id;
3825      url = url.indexOf('dropdown') == -1 ? url + '&viewmode=blank' : url;
3826      url = url.replace('[URL]', location.pathname + location.search);
3827
3828      jQuery('#navpoint_' + id).data('hasLoaded', '1');
3829
3830      var iframeEmbed    = document.createElement('iframe');
3831
3832      iframeEmbed.id          = 'navEmbedIframe_' + id;
3833      iframeEmbed.className   = 'navLevel1Embed';
3834      iframeEmbed.frameBorder = '0';
3835      iframeEmbed.scrolling   = 'no';
3836      iframeEmbed.src         = url;
3837
3838      var embedContainer = document.getElementById('navEmbed_' + id);
3839      embedContainer.appendChild(iframeEmbed);
3840
3841      var navpointLeft = jQuery('#navpoint_' + id).offset().left;
3842
3843      jQuery('#navEmbed_' + id).show();
3844
3845      var layerLeft = jQuery('#navEmbed_' + id).offset().left;
3846
3847      var blockMainRight = jQuery('#blockBeforeLeftContentRightInner').offset().left + jQuery('#blockBeforeLeftContentRightInner').width() - 2;
3848
3849      if(layerLeft < navpointLeft){
3850        jQuery('#navEmbed_' + id).css('left', String(navpointLeft - layerLeft - 6) + 'px');
3851      }
3852
3853      var layerRight = jQuery('#navEmbed_' + id).offset().left + jQuery('#navEmbed_' + id).width();
3854
3855      if(layerRight > blockMainRight){
3856        jQuery('#navEmbed_' + id).css('left', String(parseInt(jQuery('#navEmbed_' + id).css('left')) - (layerRight - blockMainRight)) + 'px');
3857      }
3858
3859      jQuery('#navEmbed_' + id).mouseover(function(){
3860        jQuery('#navEmbed_' + id).css({'opacity':'1'}).show();
3861      });
3862
3863      jQuery('#navpoint_' + id + ', #navEmbed_' + id).mouseout(function(){
3864        jQuery('#navEmbed_' + id).hide().css({'opacity':'1'});
3865      });
3866
3867      //jQuery('.blockContentEmbed').attr('id', 'blockContent');
3868      //jQuery('.blockContentEmbedInner').attr('id', 'blockContentInner');
3869    }
3870  }
3871}
3872
3873////////////////////////////////////////////////////////////////
3874//
3875// Initialisieren der Seite
3876//
3877////////////////////////////////////////////////////////////////
3878
3879jQuery(document).ready(function(){
3880
3881  if(navigator.appVersion.match(/iPhone/i)){
3882    window.scrollTo(0, 1);
3883  }
3884
3885  if(typeof(document.addEventListener) == 'function'){
3886    document.addEventListener('touchstart', function(){}, false);
3887  }
3888
3889  if(document.all){
3890    var versionIE = (navigator.appVersion.match(/MSIE (\d+\..)/)[1]).replace(/\..*/, '');
3891    jQuery('body').addClass('IE' + versionIE);
3892    if(versionIE <= 7){
3893      jQuery('img').css('max-width', 'none');
3894      jQuery('div.elementPicture').css('float', 'none');
3895      jQuery('div.picture, div.pictureLeft, div.pictureRight').each(function(){
3896        jQuery(this).css('width', String(jQuery(this).find('img').width()) + 'px');
3897      });
3898    }
3899    else if(versionIE <= 8){
3900      jQuery('img').css('max-width', 'none');
3901    }
3902  }
3903
3904  if(jQuery('#navigationMain').css('msTouchAction')){
3905    jQuery('#navigationMain').css('msTouchAction', 'none');
3906    jQuery('#navigationMain ul ul a').each(function(){
3907      jQuery(this).on('mouseup', function(){
3908        wOpenURL(jQuery(this).attr('href'), jQuery(this).attr('target'));
3909      });
3910    });
3911  }
3912
3913  if(typeof wInitBrowseEdit == 'function'){
3914    wInitBrowseEdit();
3915  }
3916
3917  if(typeof wEditor == 'undefined'){
3918
3919    var widthFancybox  = '80%';
3920    var heightFancybox = '80%';
3921
3922    if(jQuery(window).width() <= 480){
3923      widthFancybox = '100%';
3924    }
3925    
3926    if(typeof(lightboxType) != 'undefined' && lightboxType == 'wLightbox' && !/MSIE\s*(7|8)/.test(navigator.appVersion)){
3927      //jQuery("a.box, a.boxOnly, a[target*='fancy']").wLightbox({"type": "ajax", "class": "default"});
3928      jQuery("a.box, a.boxOnly, a[target='fancy']").wLightbox({"type": "iframe", "class": "default", "width": widthFancybox, "height": heightFancybox});
3929      jQuery("a[target*='boxVideo'], a[target*='boxVideoOnly']").wLightbox({"type": "video", "class": "default", "width": widthFancybox, "height": heightFancybox});
3930      jQuery("a.boxPicture, a.boxPictureOnly, a[target='fancyPicture']").wLightbox({"type": "image", "class": "default", 'scrollIfToHeight' : false, "width": widthFancybox, "height": heightFancybox});
3931      jQuery("a.box, a.boxOnly, a[target='fancy'], a[target='boxVideo'], a[target='boxVideoOnly']").filter(function(i){return !/^http/.test(jQuery(this).attr('href'))}).wSetViewmode('blank');
3932    }
3933    else if(jQuery.fancybox && jQuery.fancybox.version && parseInt(String(j
3933Query.fancybox.version).replace(/(\d+\.\d+)\.\d+/, '$1')) >= 2){
3934      jQuery("a.box, a.boxOnly, a[target*='fancy'], a[target*='boxVideo'], a[target*='boxVideoOnly']").each(function(){
3935        if(/box\w*\-(\d+)\-(\d+)/.test(jQuery(this).attr('target'))){
3936          widthFancybox  = RegExp.$1 + 'px';
3937          heightFancybox = RegExp.$2 + 'px';
3938          jQuery(this).fancybox({"type": "iframe", "width": widthFancybox, "maxHeight": heightFancybox, "titlePosition": "inside", helpers : {title : {type : 'inside'}, overlay : {css : {'background' : 'rgba(0, 0, 0, 0.2)'}}}});
3939        }
3940        else{
3941          jQuery(this).fancybox({"type": "iframe", "width": widthFancybox, "minHeight": '80%', "titlePosition": "inside", helpers : {title : {type : 'inside'}, overlay : {css : {'background' : 'rgba(0, 0, 0, 0.2)'}}}});
3942        }
3943      });
3944      jQuery("a.box, a.boxOnly, a[target='fancy'], a[target='boxVideo'], a[target='boxVideoOnly']").wSetViewmode('blank');
3945
3946      if(jQuery(window).width() <= 480){
3947        jQuery("a.boxPicture, a.boxPictureOnly").fancybox({"type": "image", "margin" : 15, "padding" : 5, "titlePosition": "inside", helpers : {title : {type : 'inside'}, overlay : {css : {'background' : 'rgba(0, 0, 0, 0.2)'}}}});
3948      }
3949      else{
3950        jQuery("a.boxPicture, a.boxPictureOnly").fancybox({"type": "image", "titlePosition": "inside", helpers : {title : {type : 'inside'}, overlay : {css : {'background' : 'rgba(0, 0, 0, 0.2)'}}}});
3951      }
3952    }
3953    else{
3954      jQuery("a.box, a.boxOnly, a[target*='boxVideo'], a[target*='boxVideoOnly']").each(function(){
3955        if(/box\w*\-(\d+)\-(\d+)/.test(jQuery(this).attr('target'))){
3956          widthFancybox  = RegExp.$1 + 'px';
3957          heightFancybox = RegExp.$2 + 'px';
3958          jQuery(this).fancybox({"type": "iframe", "width": widthFancybox, "height": heightFancybox, "titlePosition": "inside", "transitionIn" : "none", "transitionOut" : "none", "hideOnContentClick": true, "zoomOpacity": true, "zoomSpeedChange": 200, "zoomSpeedIn": 400, "zoomSpeedOut": 400, "overlayShow": false, "overlayOpacity": 0.7});
3959        }
3960        else{
3961         jQuery(this).fancybox({"type": "iframe", "width": widthFancybox, "height": '80%', "titlePosition": "inside", "transitionIn" : "none", "transitionOut" : "none", "hideOnContentClick": true, "zoomOpacity": true, "zoomSpeedChange": 200, "zoomSpeedIn": 400, "zoomSpeedOut": 400, "overlayShow": false, "overlayOpacity": 0.7});
3962        }
3963      });
3964
3965      jQuery("a.box, a.boxOnly, a[target='boxVideo'], a[target='boxVideoOnly']").wSetViewmode('blank');
3966
3967      if(jQuery(window).width() <= 480){
3968        jQuery("a.boxPicture, a.boxPictureOnly").fancybox({"type": "image", "margin" : 15, "padding" : 5, "titlePosition": "inside", "transitionIn" : "none", "transitionOut" : "none", "hideOnContentClick": true, "zoomOpacity": true, "zoomSpeedChange": 200, "zoomSpeedIn": 400, "zoomSpeedOut": 400, "overlayShow": false, "overlayOpacity": 0.7});
3969      }
3970      else{
3971        jQuery("a.boxPicture, a.boxPictureOnly").fancybox({"type": "image", "titlePosition": "inside", "transitionIn" : "none", "transitionOut" : "none", "hideOnContentClick": true, "zoomOpacity": true, "zoomSpeedChange": 200, "zoomSpeedIn": 400, "zoomSpeedOut": 400, "overlayShow": false, "overlayOpacity": 0.7});
3972      }
3973    }
3974
3975    if(typeof(ga) != 'undefined'){
3976      jQuery("a.pdf, a.download").wAddAnalytics();
3977      jQuery("div[data-url*='.pdf']").wAddAnalytics();
3978    }
3979
3980    /* Abfrage Dropdown-Navigation Start - ueber CSS-Variable $navigationPreviewLink aktivierbar */
3981    jQuery('a[data-previewlink]').each(function(){
3982      var id = jQuery(this).attr('id').replace(/navpoint_/, '');
3983      jQuery(this).parent().append('<div class="navLevel1Embed navLevelEmbed" id="navEmbed_' + id + '">&#160;</div>');
3984      if(jQuery(this).attr('data-clickable')){
3985	      jQuery(this).on('click touchstart', function(event){
3986	        var embedMode = jQuery(this).closest('ul[data-embedmode]').attr('data-embedmode');
3987	        wEmbedNavpoint(id, jQuery(this).attr('data-previewlink'), embedMode);
3988	        event.preventDefault();
3989	        if(jQuery(this).attr('data-clicked') != '1' && jQuery('a[data-clicked="1"]')){
3990	          jQuery('a[data-clicked="1"]').click();
3991	          jQuery(this).attr('data-clicked', '1');
3992	        }
3993	        else if (jQuery(this).attr('data-clicked') == '1'){
3994	          jQuery(this).attr('data-clicked', '');  
3995	        }
3996	        else{
3997	          jQuery(this).attr('data-clicked', '1');
3998	        }
3999		    });
4000      }
4001      else{
4002	      jQuery(this).on('mouseover', function(){
4003	        var embedMode = jQuery(this).closest('ul[data-embedmode]').attr('data-embedmode');
4004	        wEmbedNavpoint(id, jQuery(this).attr('data-previewlink'), embedMode);
4005	      });
4006      }
4007      jQuery(this).parent().find('> ul').remove();
4008    });
4009    /* Abfrage Dropdown-Navigation Ende */
4010
4011    jQuery('ul.navLevel1Container').before(function(){if(typeof jQuery(this).data('togglertext') != 'undefined') return '<div id="navigationMainToggler" class="closed">' + jQuery(this).data('togglertext') + '</div>'});
4012    jQuery('#navigationMainToggler').click(function(){
4013      jQuery(this).toggleClass('open').toggleClass('closed');
4014      if(jQuery('#navigationResponsiveAll') && jQuery('#navigationSidebar').length > 0){               
4015        
4016        if(jQuery('#navigationMainToggler').data('hasAddTogglerClick') != 1){
4017          jQuery('#navigationResponsiveAll a.navLevel').each(function(){
4018            jQuery(this).click(function(){
4019              jQuery('#navigationMainToggler').trigger('click');
4020            });
4021          });   
4022        }
4023        jQuery('#navigationMainToggler').data('hasAddTogglerClick', 1);        
4024        
4025        if(jQuery('#blockMainOuter').hasClass('moveWithSidebar')){
4026          if(jQuery('#navigationSidebar').width() < 64){
4027            jQuery("#navigationSidebar").removeClass('navigationSidebarClosed');
4028            jQuery('#navigationSidebar').prepend(jQuery("#navigationMainToggler").clone(true).addClass('open').removeClass('closed').data('innerhtml', jQuery("#navigationMainToggler").html()).html(''));
4029            jQuery('#navigationResponsiveAll').data('widthbeforeexpandnavigationsidebar', jQuery('#blockMainOuter').css('width'))          ;
4030            jQuery('#blockMainOuter').data('marginleftbeforeexpandnavigationsidebar', jQuery('#blockMainOuter').css('margin-left'))
4031            jQuery('#blockMainOuter').data('maxwidthbeforeexpandnavigationsidebar', jQuery('#blockMainOuter').css('max-width'))
4032            jQuery('#blockMainOuter').data('widthbeforeexpandnavigationsidebar', jQuery('#blockMainOuter').width());
4033            jQuery('#blockMainOuter').css({'width' : jQuery('#blockMainOuter').width(), 'max-width' : ''});
4034            jQuery('#navigationResponsiveAll').css({'width' : '200px'});
4035            jQuery('#navigationResponsiveAll').animate({'width' : 'toggle'});
4036
4037            if(jQuery('#navigationSidebar').css('left').replace(/(px|em|pt|%)$/, '') == '0'){
4038              jQuery('#blockMainOuter').animate({'margin-left' : '240px'}, function(){
4039                jQuery("#navigationSidebar").addClass('navigationSidebarOpen').removeClass('navigationSidebarClosed');
4040              });
4041            }
4042            else{
4043              jQuery('#blockMainOuter').animate({'margin-left' : '-240px'}, function(){
4044                jQuery("#navigationSidebar").addClass('navigationSidebarOpen').removeClass('navigationSidebarClosed');
4045              });
4046            }
4047          }
4048          else{
4049            jQuery("#navigationSidebar").removeClass('navigationSidebarOpen');
4050            jQuery("#navigationMainToggler").remove();
4051            jQuery("#navigationMainToggler").addClass('closed').removeClass('open');
4052            jQuery('#navigationResponsiveAll').animate({'width' : 'toggle'});
4053            jQuery('#blockMainOuter').css({'width' : jQuery('#blockMainOuter').data('widthbeforeexpandnavigationsidebar'), 'max-width' : ''});
4054            jQuery('#blockMainOuter').animate({'margin-left' : jQuery('#blockMainOuter').data('marginleftbeforeexpandnavigationsidebar')}, function(){
4055              jQuery('#blockMainOuter').css({'width' : '', 'margin-left' : ''});
4056              jQuery("#navigationSidebar").addClass('navigationSidebarClosed');
4057            });
4058          }
4059        }
4060        else{
4061          jQuery('#navigationResponsiveAll').animate({'width' : 'toggle'});
4062        }
4063      }
4064      else if(jQuery('#navigationResponsiveAll')){
4065        jQuery('#navigationResponsiveAll').animate({'height' : 'toggle'});
4066      }
4067      else{
4068        jQuery(this).next('ul').animate({'height' : 'toggle'});
4069      }
4070    });
4071
4072    var limitNavigationArea = jQuery(window).width();
4073
4074    if(jQuery('#blockTopInner #navigationMain').length > 0){
4075      limitNavigationArea = jQuery('#navigationMain').offset().left + jQuery('#navigationMain').outerWidth();
4076
4077      jQuery('#navigationMain li.navLevel1').mouseover(function(){
4078        var diffLeft = jQuery(this).offset().left + jQuery(this).find('ul.navLevel2Container').outerWidth() - limitNavigationArea;
4079        if(diffLeft > 0){
4080          jQuery(this).addClass('alignNavContainerSubLeft');
4081          jQuery(this).data('alignNavContainerSub', 'left');
4082          jQuery(this).find('ul.navLevel2Container').css({'margin-left' : '-' + String(diffLeft) + 'px'});
4083        }
4084        else{
4085          jQuery(this).data('alignNavContainerSub', '');
4086        }
4087      });
4088
4089      jQuery('#navigationMain li.navLevel2').mouseover(function(){
4090        if(jQuery(this).find('ul.navLevel3Container').length > 0){
4091          var diffLeft = jQuery(this).find('ul.navLevel3Container').offset().left + jQuery(this).find('ul.navLevel3Container').outerWidth() - limitNavigationArea;
4092          if(diffLeft > 0 || jQuery(this).data('alignNavContainerSub') == 'left'){
4093            jQuery(this).data('alignNavContainerSub', 'left');
4094            jQuery(this).addClass('alignNavContainerSubLeft');
4095            jQuery(this).find('ul.navLevel3Container').css({'margin-left' : '-' + String(jQuery(this).find('ul.navLevel3Container').outerWidth()) + 'px'});
4096          }
4097          else{
4098            jQuery(this).data('alignNavContainerSub', '');
4099          }
4100        }
4101      });
4102
4103      jQuery('#navigationMain li.navLevel3').mouseover(function(){
4104        if(jQuery(this).find('ul.navLevel4Container').length > 0){
4105          var diffLeft = jQuery(this).find('ul.navLevel4Container').offset().left + jQuery(this).find('ul.navLevel4Container').outerWidth() - limitNavigationArea;
4106          if(diffLeft > 0 || jQuery(this).data('alignNavContainerSub') == 'left'){
4107            jQuery(this).addClass('alignNavContainerSubLeft');
4108            jQuery(this).data('alignNavContainerSub', 'left');
4109            jQuery(this).find('ul.navLevel4Container').css({'margin-left' : '-' + String(jQuery(this).find('ul.navLevel4Container').outerWidth()) + 'px'});
4110          }
4111          else{
4112            jQuery(this).data('alignNavContainerSub', '');
4113          }
4114        }
4115      });
4116    }
4117  }
4118
4119  if(typeof wEditor === 'undefined'){
4120    if(typeof wUiTmp['wHasWa'] !== 'undefined' && wUiTmp['wHasWa']){
4121      addInteractionTracking();
4122    }
4123  }
4124});
4125
4126wOnAfterAdjustHeight = function(elem){
4127  if(elem.parent().data('onafteradjustheight') == 1){
4128    elem.parent().css('max-height', elem.css('height'));
4129    elem.parent().data('onafteradjustheight', 0);
4130  }
4131};
4132
4133////////////////////////////////////////////////////////////////
4134//
4135// Ergänzt Interaktions-Tracking (nutzbar ab der Version 16)
4136//
4137////////////////////////////////////////////////////////////////
4138
4139addInteractionTracking = function(root){
4140
4141  jQuery('a[href*="http"]').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).attr('href')}, category : 'extern'});
4142  jQuery('a.mail, a.wpst').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).html()}, category : 'mail'});
4143  jQuery('a.phone').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).html()}, category : 'phone'});
4144
4145  jQuery('video').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).attr('src')}, category : 'video'});
4146  
4147  jQuery('.tab').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).children('div').first().html()}, category : 'tab'});
4148  jQuery('.accordionHeader').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).first().text()}, category : 'accordion'}); 
4149  
4150  jQuery('.listBannerSlider .listMoverBack').wAnalyzeEvents({event : 'click', label : 'Back', category : 'bannerSelect'});   
4151  jQuery('.listBannerSlider .listMoverForward').wAnalyzeEvents({event : 'click', label : 'Forward', category : 'bannerSelect'});   
4152  jQuery('.listBannerSlider .listEntriesPreview .listEntry').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).closest('.listBannerSlider').find('.listEntry .listEntryTitle').eq(jQuery(this).index()).text()}, category : 'bannerSelect'}); 
4153  jQuery('.listBannerSlider .listEntry.clickable').wAnalyzeEvents({event : 'click', label : function(){return jQuery(this).find('.listEntryTitle').text()}, category : 'banner'});   
4154};
4155
4156////////////////////////////////////////////////////////////////
4157//
4158// Öffnet den Cookie-, Datenschutzhinweis
4159//
4160////////////////////////////////////////////////////////////////
4161
4162openCookieNotice = function(){
4163  jQuery('#cookieNotice').attr('style', 'display:block !important');
4164};  
4165
4166////////////////////////////////////////////////////////////////
4167//
4168// Schließt den Cookie-, Datenschutzhinweis
4169//
4170////////////////////////////////////////////////////////////////
4171
4172closeCookieNotice = function(){
4173  jQuery('#cookieNotice').attr('style', 'display:none');
4174};
4175
4176////////////////////////////////////////////////////////////////
4177//
4178// Nach dem vollständigen Laden der Seite und der Bilder etc.
4179//
4180////////////////////////////////////////////////////////////////
4181
4182jQuery(window).on('load', function(){
4183  //jQuery("img:not([data-src2x])").removeAttr('height');
4184  
4185  //window.setTimeout(function(){
4186  //  wScrollSmoothToElement('.wglHighlightWord');
4187  //}, 500);
4188  
4189  //Hier werden die embedded Navigationen bereits beim Laden der Seiten via Ajax geladen. 
4190  //Das kann theoretisch auch auf einzelne Links ausgeführt werden. Ggf. um die Ladezeiten der Seite zu verringern.
4191  /*
4192  jQuery('a[data-previewlink]').each(function(){
4193      var id = jQuery(this).attr('id').replace(/navpoint_/, '');
4194      jQuery(this).attr("data-megadropdown", 'load');
4195      var embedMode = jQuery(this).closest('ul[data-embedmode]').attr('data-embedmode');
4196      wEmbedNavpoint(id, jQuery(this).attr('data-previewlink'), embedMode);
4197    
4198  });
4199  */
4200  
4201});
4202
4203////////////////////////////////////////////////////////////////
4204//
4205// Beim Ändern der Fenstergröße
4206//
4207////////////////////////////////////////////////////////////////
4208
4209jQuery(window).on('resize', function(){
4210  //var windowWidth  = jQuery(this).width();
4211  //var windowHeight = jQuery(this).height();
4212  //console.log(windowWidth + ' / ' + windowHeight);
4213});
4214
4215////////////////////////////////////////////////////////////////
4216//
4217// Beim Scrollen
4218//
4219////////////////////////////////////////////////////////////////
4220
4221jQuery(window).on('scroll', function(){
4222  //var scrollTop  = jQuery(this).scrollTop();
4223  //var scrollLeft = jQuery(this).scrollLeft();
4224  //console.log(scrollLeft + ' / ' + scrollTop);
4225  //if(scrollTop > 96){
4226  //  jQuery('#blockMainOuter').css({'margin-top' : '0'})
4227  //  jQuery('#navigationMain').css({'position' : 'fixed', 'z-index' : '100', 'top' : '0'});
4228  //}
4229  //else{
4230  //  jQuery('#navigationMain').css({'position' : 'static'})
4231  //}
4232});
4233
4234////////////////////////////////////////////////////////////////
4235//
4236// Callback, das nach dem Bestätigen und Ablehnen zum Laden externer Komponenten aufgerufen wird
4237//
4238////////////////////////////////////////////////////////////////
4239
4240wOnAfterAcceptExternalRessources = function(){
4241  //console.log('wOnAfterAcceptExternalRessources');
4242  
4243  jQuery.ajax({
4244    type: "GET",
4245    url: '/wLayout/wGlobal/scripts/php/privacyConsentStatus.php?s=acceptExternalRessources',
4246    async: true,
4247    success: function(result){
4248      document.location.reload(true);
4249    }
4250  });
4251};
4252
4253
4254////////////////////////////////////////////////////////////////
4255//
4256// Callback, das nach dem Bestätigen und Erlauben zum Laden externer Komponenten aufgerufen wird
4257//
4258////////////////////////////////////////////////////////////////
4259
4260wOnAfterDeclineExternalRessources = function(){
4261  //console.log('wOnAfterDeclineExternalRessources');
4262  
4263  jQuery.ajax({
4264    type: "GET",
4265    url: '/wLayout/wGlobal/scripts/php/privacyConsentStatus.php?s=declineExternalRessources',
4266    async: true,
4267    success: function(result){
4268    }
4269  });
4270};
4271
4272
4273////////////////////////////////////////////////////////////////
4274//
4275// Beim Aktivieren bzw. Deaktivieren von Media Queries
4276//
4277////////////////////////////////////////////////////////////////
4278
4279mediaquery_max768_onactivate = function(){
4280  //console.log('mediaquery_max768_onactivate');
4281  //jQuery('#blockTop').removeClass('wglKeepInsideTopOnScroll');
4282  
4283  if(jQuery('#navigationSidebar').length > 0 && jQuery('#navigationSidebar #navigationMainToggler').length == 0){
4284    //jQuery('#navigationSidebar').prepend(jQuery("#navigationMainToggler").html(''));
4285  }
4286
4287  if(jQuery('#navigationResponsiveAll').length > 0 || window['hasLoadNavigationResponsiveAll']){
4288    //jQuery('#navigationResponsiveAll').show();
4289  }
4290  else{
4291    window['hasLoadNavigationResponsiveAll'] = true;
4292    jQuery.ajax({
4293      type: "GET",
4294      async: true,
4295      url: '/wLayout/wGlobal/scripts/php/navigationResponsiveAll.php?project=' + wProjectPath + '&navid=' + (typeof(wNavidStandard) != 'undefined' ? wNavidStandard : ''),
4296      success: function(result){
4297        if(jQuery('#navigationSidebar').length > 0){
4298          jQuery('#navigationSidebar').append(result);
4299        }
4300        else{
4301          jQuery('#navigationMain').after(result);
4302        }
4303        jQuery('.navLevelOpener, .navLevelCloser').on('click', function(){
4304          if(jQuery(this).next().css('display') != 'none' || jQuery(this).next().data('isopen') == 1){
4305            jQuery(this).addClass('navLevelOpener').removeClass('navLevelCloser');
4306            jQuery(this).next().slideUp('fast', function(){
4307              jQuery(this).data('isopen', 0);
4308            });
4309          }
4310          else{
4311            jQuery(this).addClass('navLevelCloser').removeClass('navLevelOpener');
4312            console.log(jQuery(this).next().get(0));
4313            jQuery(this).next().slideDown('fast', function(){
4314              jQuery(this).data('isopen', 1);
4315            });
4316          }
4317        });
4318      }
4319    });
4320  }  
4321  
4322  jQuery('#blockTopInner #navigationMeta').addClass('navigationMetaInitSourceTop').insertBefore("#blockBottomInner");  
4323};
4324
4325mediaquery_max768_ondeactivate = function(){
4326  //console.log('mediaquery_max768_ondeactivate');
4327
4328  jQuery('ul.navLevel1Container').css({'display' : ''});
4329  jQuery('#navigationResponsiveAll').hide();
4330  
4331  jQuery('.navigationMetaInitSourceTop').insertBefore("#blockTopInner #navigationMain");  
4332};
4333
4334mediaquery_max540_onactivate = function(){
4335  //console.log('mediaquery_max540_onactivate');
4336  //jQuery('#navigationSub').insertBefore("#blockBottomInner");
4337};
4338
4339mediaquery_max540_ondeactivate = function(){
4340  //console.log('mediaquery_max540_ondeactivate');
4341  //jQuery('#navigationSub').prependTo("#blockLeftInner");
4342};
4343
4344mediaquery_max480_onactivate = function(){
4345  //console.log('mediaquery_max480_onactivate');
4346  //jQuery('#blockTop').removeClass('wglKeepInsideTopOnScroll');
4347};
4348
4349mediaquery_max480_ondeactivate = function(){
4350  //console.log('mediaquery_max480_ondeactivate');
4351
4352  //jQuery('#blockTop').addClass('wglKeepInsideTopOnScroll');
4353
4354  //Falls die Sidebar-Navigation davor geöffnet war
4355  jQuery('#blockMainOuter').css({'width' : '', 'margin-left' : ''});
4356};
4357
4358wAllowMinimize = true;
4359
4360if(typeof(window.bannerSliderObjects) == 'undefined'){
4361  window.bannerSliderObjects = {};
4362}
4363
4364function initBannerSlider(listId, preselectedEntry){
4365
4366  window.bannerSliderObjects[listId] = {};
4367  window.bannerSliderObjects[listId]['numberChanges'] = -1;
4368
4369  var maxWidthImages = 0;
4370
4371  jQuery('#listEntries_' + listId + ' .listEntryImage').each(function(index){
4372    maxWidthImages = jQuery(this).width() > maxWidthImages ? jQuery(this).width() : maxWidthImages;
4373  });
4374
4375  jQuery('#listEntries_' + listId + ' .listEntryImage').each(function(index){
4376    jQuery(this).attr('data-maxwidthifinvisible', maxWidthImages);
4377  });
4378
4379  var fadeTime             = jQuery('#bannerSlider_' + listId).data('fadetime');
4380  var animation            = jQuery('#bannerSlider_' + listId).data('animation');
4381  var animationDuration    = jQuery('#bannerSlider_' + listId).data('animationduration');
4382  var numberEntries        = jQuery('#bannerSlider_' + listId).data('numberentries');
4383  var currentEntry         = jQuery('#bannerSlider_' + listId).data('currententry');
4384  var preventEventsOnTouch = jQuery('#bannerSlider_' + listId).data('preventeventsontouch');
4385  var allowtouch           = jQuery('#bannerSlider_' + listId).data('allowtouch');
4386  var pauseOnMouseover     = jQuery('#bannerSlider_' + listId).data('pauseonmouseover');
4387
4388  onAfterSelectListEntryBannerSlider(listId, 0, true);
4389
4390  if(typeof(fadeTime) != 'undefined' && fadeTime != '' && fadeTime != 0){
4391    jQuery('#bannerSlider_' + listId).data('intervalcount', 1);
4392    window.bannerSliderObjects[listId]['interval'] = window.setInterval(function(){
4393      jQuery('#bannerSlider_' + listId).data('intervalcount', jQuery('#bannerSlider_' + listId).data('intervalcount') + 1);
4394      if(jQuery('#bannerSlider_' + listId).data('intervalcount') >= 128){
4395        window.clearInterval(window.bannerSliderObjects[listId]['interval'])
4396      };
4397      if(typeof(jQuery('#bannerSlider_' + listId + ' .listMoverForward').length > 0 && jQuery('#bannerSlider_' + listId + ' .listMoverForward').click) == 'function'){
4398        jQuery('#bannerSlider_' + listId + ' .listMoverForward').triggerHandler('click');
4399      }
4400      else{
4401        selectListEntryBannerSlider(listId, "+");
4402      }
4403    }, fadeTime * 1000);
4404    jQuery(window).blur(function(){
4405      window.clearInterval(window.bannerSliderObjects[listId]['interval']);
4406    });
4407    if(pauseOnMouseover == 'yes'){
4408	    jQuery('#bannerSlider_' + listId + ' .listEntries').mouseenter(function(event){
4409	      window.clearInterval(window.bannerSliderObjects[listId]['interval']);
4410	      event.preventDefault ? event.preventDefault() : event.returnValue = false;
4411	      event.stopPropagation ? event.stopPropagation() : event.cancelBubble = true;
4412	    });
4413	    jQuery('#bannerSlider_' + listId + ' .listEntries').mouseleave(function(event){
4414		    window.clearInterval(window.bannerSliderObjects[listId]['interval']);
4415        window.bannerSliderObjects[listId]['interval'] = window.setInterval(function(){
4416          jQuery('#bannerSlider_' + listId).data('intervalcount', jQuery('#bannerSlider_' + listId).data('intervalcount') + 1);
4417          if(jQuery('#bannerSlider_' + listId).data('intervalcount') >= 128){
4418            window.clearInterval(window.bannerSliderObjects[listId]['interval'])
4419          };
4420          if(typeof(jQuery('#bannerSlider_' + listId + ' .listMoverForward').length > 0 && jQuery('#bannerSlider_' + listId + ' .listMoverForward').click) == 'function'){
4421            jQuery('#bannerSlider_' + listId + ' .listMoverForward').triggerHandler('click');
4422          }
4423          else{
4424            selectListEntryBannerSlider(listId, "+");
4425          }
4426        }, fadeTime * 1000);
4427	    });
4428    }
4429    jQuery(window).focus(function(){
4430      window.clearInterval(window.bannerSliderObjects[listId]['interval']);
4431      window.bannerSliderObjects[listId]['interval'] = window.setInterval(function(){
4432        jQuery('#bannerSlider_' + listId).data('intervalcount', jQuery('#bannerSlider_' + listId).data('intervalcount') + 1);
4433        if(jQuery('#bannerSlider_' + listId).data('intervalcount') >= 128){
4434          window.clearInterval(window.bannerSliderObjects[listId]['interval'])
4435        };
4436        if(typeof(jQuery('#bannerSlider_' + listId + ' .listMoverForward').length > 0 && jQuery('#bannerSlider_' + listId + ' .listMoverForward').click) == 'function'){
4437          jQuery('#bannerSlider_' + listId + ' .listMoverForward').triggerHandler('click');
4438        }
4439        else{
4440          selectListEntryBannerSlider(listId, "+");
4441        }
4442      }, fadeTime * 1000);
4443    });
4444  }
4445
4446  if(jQuery('#bannerSlider_' + listId + ' .listEntries .listEntry').length > 1 && allowtouch != 'no'){
4447    if(window.name.indexOf('fancy') == -1 && /(slide|scroll)/.test(animation) && ('ontouchstart' in window || !!(navigator.msMaxTouchPoints) || window.DocumentTouch && document instanceof DocumentTouch)){
4448      jQuery('body').on('touchstart', function(event){
4449        if(jQuery(event.target).closest('#bannerSlider_' + listId + ' .listEntries').length != 0){
4450          window.bannerSliderObjects[listId]['mouseStartX'] = event.originalEvent.touches[0].pageX;
4451          window.bannerSliderObjects[listId]['mouseStartY'] = event.originalEvent.touches[0].pageY;
4452          window.bannerSliderObjects[listId]['mouseStartInnerMarginLeft'] = parseInt(jQuery('#listEntries_' + listId).css('margin-left'));
4453          window.bannerSliderObjects[listId]['touchdirection'] = '';
4454        }
4455      });
4456
4457      jQuery('body').on('touchmove', function(event){
4458        if(window.bannerSliderObjects[listId] && window.bannerSliderObjects[listId]['mouseStartX']){
4459          window.bannerSliderObjects[listId]['mouseX'] = event.originalEvent.touches[0].pageX;
4460          window.bannerSliderObjects[listId]['mouseY'] = event.originalEvent.touches[0].pageY;
4461          window.bannerSliderObjects[listId]['divX']   = window.bannerSliderObjects[listId]['mouseX'] - window.bannerSliderObjects[listId]['mouseStartX'];
4462          window.bannerSliderObjects[listId]['divY']   = window.bannerSliderObjects[listId]['mouseY'] - window.bannerSliderObjects[listId]['mouseStartY'];
4463          var diffX = window.bannerSliderObjects[listId]['divX'] > 0 ? window.bannerSliderObjects[listId]['divX'] : - window.bannerSliderObjects[listId]['divX'];
4464          var diffY = window.bannerSliderObjects[listId]['divY'] > 0 ? window.bannerSliderObjects[listId]['divY'] : - window.bannerSliderObjects[listId]['divY'];
4465          if(diffX > 10 && diffX > diffY){
4466            listEntryBannerSliderMove(listId);
4467            window.bannerSliderObjects[listId]['touchdirection'] = 'h';
4468            if(preventEventsOnTouch == '1'){
4469              event.preventDefault();
4470            }
4471          }
4472          else if(window.bannerSliderObjects[listId]['touchdirection'] == ''){
4473            window.bannerSliderObjects[listId]['touchdirection'] = 'v';
4474          }
4475        }
4476      });
4477
4478      jQuery('body').on('touchend', function(event){
4479        if(jQuery(event.target).closest('#bannerSlider_' + listId + ' .listEntries').length != 0){
4480          //event.preventDefault();
4481          if(window.bannerSliderObjects[listId] && window.bannerSliderObjects[listId]['mouseStartX']){
4482            if(window.bannerSliderObjects[listId]['touchdirection'] == 'h'){
4483              bannerSliderMoveEnd(listId);
4484            }
4485          }
4486        }
4487      });
4488    }
4489
4490    jQuery('#bannerSlider_' + listId + ' .listEntries').mousedown(function(event){
4491      window.clearInterval(window.bannerSliderObjects[listId]['interval']);
4492      event.preventDefault ? event.preventDefault() : event.returnValue = false;
4493      event.stopPropagation ? event.stopPropagation() : event.cancelBubble = true;
4494      window.bannerSliderObjects[listId]['mouseStartX'] = event.pageX;
4495      window.bannerSliderObjects[listId]['mouseStartInnerMarginLeft'] = parseInt(jQuery('#listEntries_' + listId).css('margin-left'));
4496    });
4497
4498    jQuery(document).mousemove(function(event){
4499      if(window.bannerSliderObjects[listId] && window.bannerSliderObjects[listId]['mouseStartX']){
4500        window.bannerSliderObjects[listId]['mouseX'] = event.pageX;
4501        window.bannerSliderObjects[listId]['divX'] = window.bannerSliderObjects[listId]['mouseX'] - window.bannerSliderObjects[listId]['mouseStartX'];
4502        listEntryBannerSliderMove(listId);
4503      }
4504    });
4505
4506    jQuery(document).mouseup(function(e){
4507      if(window.bannerSliderObjects[listId] && window.bannerSliderObjects[listId]['mouseStartX']){
4508        bannerSliderMoveEnd(listId);
4509      }
4510    });
4511  }
4512
4513  jQuery('#listEntries_' + listId + ' .listEntryProgress').removeClass('listEntryProgress');
4514
4515  if(animation == 'scrollHorizontal'){
4516    var scrollingElement      = jQuery('#bannerSlider_' + listId).find('.listEntries');
4517    var scrollingElementInner = jQuery('#bannerSlider_' + listId).find('.listEntriesInner');
4518    scrollingElementInner.children('*').each(function(index){
4519      widthTmp = jQuery(this).width();
4520      if(widthTmp > 1){
4521        jQuery(this).css('width', widthTmp);
4522      }
4523    });
4524    var lastElementInner      = scrollingElementInner.children('*:last');
4525    var marginRight           = isNaN(lastElementInner.css('margin-right')) ? 0 : Math.round(lastElementInner.css('margin-right'));
4526    var offsetRightLastElementInner = lastElementInner.get(0).offsetLeft + lastElementInner.outerWidth() + marginRight;
4527    if(offsetRightLastElementInner > 10){
4528      scrollingElementInner.css({'width' : String(offsetRightLastElementInner) + 'px'});
4529    }
4530
4531    var rightNew = - (Math.round(scrollingElement.width()) - (isNaN(parseInt(scrollingElementInner.css('margin-left'))) ? 0 : Math.round(parseFloat(scrollingElementInner.css('margin-left')))) - scrollingElementInner.width());
4532    if(rightNew <= 0){
4533      jQuery('#bannerSlider_' + listId).addClass('lastEntryVisible');
4534      jQuery('#bannerSlider_' + listId).parent('.elementStandard').addClass('lastEntryVisible');
4535    }
4536    else{
4537      jQuery('#bannerSlider_' + listId).removeClass('lastEntryVisible');
4538      jQuery('#bannerSlider_' + listId).parent('.elementStandard').removeClass('lastEntryVisible');
4539    }
4540
4541    jQuery('#bannerSlider_' + listId + ' .listMoverForward').removeAttr('onclick').click(function(){
4542      if(window.bannerSliderObjects[listId]['inmove']){
4543        return;
4544      }
4545      window.bannerSliderObjects[listId]['inmove'] = true;
4546      var scrollingElement      = jQuery(this).parent().parent().find('.listEntries');
4547      var scrollingElementInner = jQuery(this).parent().parent().find('.listEntriesInner');
4548      var movingWidth  = scrollingElement.innerWidth();
4549      var innerWidth   = scrollingElementInner.width();
4550      var right        = - (Math.round(scrollingElement.width()) - (isNaN(parseInt(scrollingElementInner.css('margin-left'))) ? 0 : Math.round(parseFloat(scrollingElementInner.css('margin-left')))) - scrollingElementInner.width());
4551      var rest         = right % movingWidth;
4552
4553      if(right < 20){
4554        movingWidth = 0;
4555      }
4556      else if(right < movingWidth + 20){
4557        movingWidth = right;
4558      }
4559      else if(rest < -20){
4560        movingWidth = rest;
4561      }
4562
4563      var duration = animationDuration;
4564      if(right > 0){
4565        scrollingElementInner.animate({'margin-left' : '-=' + String(movingWidth)}, {'duration' : duration, 'done' : function(){
4566          var leftContainer = parseInt(jQuery('#listEntries_' + listId).css('margin-left'));
4567
4568          var position = 1;
4569          var minLeft  = 1000000;
4570          var curLeft  = 0;
4571
4572          jQuery('#listEntries_' + listId + ' .listEntry').each(function(index){
4573            curLeft = Math.abs(jQuery(this).position().left + leftContainer);
4574            if(curLeft < minLeft){
4575              minLeft = curLeft;
4576              position = index + 1;
4577            }
4578          });
4579          var rightNew = - (Math.round(scrollingElement.width()) 
4579- (isNaN(parseInt(scrollingElementInner.css('margin-left'))) ? 0 : Math.round(parseFloat(scrollingElementInner.css('margin-left')))) - scrollingElementInner.width());
4580          if(rightNew <= 0){
4581            jQuery('#bannerSlider_' + listId).addClass('lastEntryVisible');
4582            jQuery('#bannerSlider_' + listId).parent('.elementStandard').addClass('lastEntryVisible');
4583          }
4584          else{
4585            jQuery('#bannerSlider_' + listId).removeClass('lastEntryVisible');
4586            jQuery('#bannerSlider_' + listId).parent('.elementStandard').removeClass('lastEntryVisible');
4587          }
4588          jQuery('#bannerSlider_' + listId).data('currententry', position);
4589          selectListEntryBannerSliderPreview(listId, position);
4590          onAfterSelectListEntryBannerSlider(listId, position - 1);
4591          window.bannerSliderObjects[listId]['inmove'] = false;
4592        }});
4593      }
4594      else{
4595        window.bannerSliderObjects[listId]['inmove'] = false;
4596      }
4597    });
4598    jQuery('#bannerSlider_' + listId + ' .listMoverBack').removeAttr('onclick').click(function(){
4599      if(window.bannerSliderObjects[listId]['inmove']){
4600        return;
4601      }
4602      window.bannerSliderObjects[listId]['inmove'] = true;
4603      var scrollingElement      = jQuery(this).parent().parent().find('.listEntries');
4604      var scrollingElementInner = jQuery(this).parent().parent().find('.listEntriesInner');
4605      var movingWidth  = scrollingElement.innerWidth();
4606      var innerWidth   = scrollingElementInner.width();
4607      var left         = parseInt(scrollingElementInner.css('margin-left'));
4608      var rest         = left % movingWidth;
4609
4610      if(rest > -20){
4611        movingWidth = movingWidth - rest;
4612      }
4613      else{
4614        movingWidth = rest != 0 ? -rest : movingWidth;
4615      }
4616
4617      jQuery('#bannerSlider_' + listId).removeClass('lastEntryVisible');
4618      jQuery('#bannerSlider_' + listId).parent('.elementStandard').removeClass('lastEntryVisible');
4619
4620      var duration = animationDuration;
4621      if(left < 0){
4622        scrollingElementInner.animate({'margin-left' : '+=' + String(movingWidth)}, {'duration' : duration, 'done' : function(){
4623          var leftContainer = parseInt(jQuery('#listEntries_' + listId).css('margin-left'));
4624          var position = 1;
4625          var minLeft  = 1000000;
4626          var curLeft  = 0;
4627
4628          jQuery('#listEntries_' + listId + ' .listEntry').each(function(index){
4629            curLeft = Math.abs(jQuery(this).position().left + leftContainer);
4630            if(curLeft < minLeft){
4631              minLeft = curLeft;
4632              position = index + 1;
4633            }
4634          });
4635
4636          jQuery('#bannerSlider_' + listId).data('currententry', position);
4637          selectListEntryBannerSliderPreview(listId, position);
4638          onAfterSelectListEntryBannerSlider(listId, position - 1);
4639          window.bannerSliderObjects[listId]['inmove'] = false;
4640        }});
4641      }
4642      else{
4643        window.bannerSliderObjects[listId]['inmove'] = false;
4644      }
4645    });
4646  }
4647
4648  jQuery('#listEntries_' + listId + ' .listEntrySelectedInit').addClass('listEntrySelectedReady');
4649}
4650
4651function listEntryBannerSliderMove(listId){
4652
4653  var numberEntries     = jQuery('#bannerSlider_' + listId).data('numberentries');
4654  var currentEntry      = jQuery('#bannerSlider_' + listId).data('currententry');
4655  var animation         = jQuery('#bannerSlider_' + listId).data('animation');
4656
4657  var positionNext      = currentEntry + 1;
4658  var positionPrev      = currentEntry - 1;
4659  if(positionNext > numberEntries){
4660    positionNext = 1;
4661  }
4662  if(positionPrev < 0){
4663    positionPrev = numberEntries;
4664  }
4665
4666  var slideWidth        = jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').width();
4667  var widthSlideCurrent = jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').innerWidth()
4668
4669  if(animation == 'scrollHorizontal'){
4670    var scrollingElement      = jQuery('#listEntries_' + listId).parent();
4671    var scrollingElementInner = jQuery('#listEntries_' + listId);
4672    var movingWidth  = scrollingElement.innerWidth();
4673    var innerWidth   = scrollingElementInner.width();
4674    var right        = - (Math.round(scrollingElement.width()) - (isNaN(parseInt(scrollingElementInner.css('margin-left'))) ? 0 : Math.round(parseFloat(scrollingElementInner.css('margin-left')))) - scrollingElementInner.width());
4675    var rest         = right % movingWidth;
4676
4677    if(right < 20){
4678      movingWidth = 0;
4679    }
4680    else if(right < movingWidth + 20){
4681      movingWidth = right;
4682    }
4683    else if(rest < -20){
4684      movingWidth = rest;
4685    }
4686
4687    if(window.bannerSliderObjects[listId]['divX'] < 0 && (scrollingElement.width() - scrollingElementInner.width()) < window.bannerSliderObjects[listId]['mouseStartInnerMarginLeft'] + window.bannerSliderObjects[listId]['divX']){
4688      scrollingElementInner.css({'margin-left' : String(window.bannerSliderObjects[listId]['mouseStartInnerMarginLeft'] + window.bannerSliderObjects[listId]['divX']) + 'px'});
4689    }
4690    else if(window.bannerSliderObjects[listId]['divX'] > 0 && window.bannerSliderObjects[listId]['mouseStartInnerMarginLeft'] + window.bannerSliderObjects[listId]['divX'] < 0){
4691      scrollingElementInner.css({'margin-left' : String(window.bannerSliderObjects[listId]['mouseStartInnerMarginLeft'] + window.bannerSliderObjects[listId]['divX']) + 'px'});
4692    }
4693  }
4694  else if(animation == 'slideHorizontal'){
4695    if(window.bannerSliderObjects[listId]['divX'] > 0){
4696      if(typeof jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(positionPrev - 1) + ')').data('position') == 'undefined'){
4697        jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(positionPrev - 1) + ')').data('position', jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(positionPrev - 1) + ')').css('position'));
4698      }
4699      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(positionPrev - 1) + ')').css({position: 'absolute', display: 'block', width: '100%', top: 0, left: String(window.bannerSliderObjects[listId]['divX'] - slideWidth) +  'px'});;
4700      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').css({width: String(widthSlideCurrent) + 'px', display: 'block', 'margin-left' : window.bannerSliderObjects[listId]['divX']});
4701    }
4702    else if(window.bannerSliderObjects[listId]['divX'] < 0){
4703      if(typeof jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(positionNext - 1) + ')').data('position') == 'undefined'){
4704        jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(positionNext - 1) + ')').data('position', jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(positionNext - 1) + ')').css('position'));
4705      }
4706      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(positionNext - 1) + ')').css({position: 'absolute', display: 'block', width: '100%', top: 0, left: String(slideWidth + window.bannerSliderObjects[listId]['divX']) +  'px'});;
4707      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').css({width: String(widthSlideCurrent) + 'px', display: 'block', 'margin-left' : window.bannerSliderObjects[listId]['divX']});
4708    }
4709  }
4710  else if(animation == 'slideFromRight'){
4711    if(window.bannerSliderObjects[listId]['divX'] < 0){
4712      if(typeof jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(positionNext - 1) + ')').data('position') == 'undefined'){
4713        jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(positionNext - 1) + ')').data('position', jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(positionNext - 1) + ')').css('position'));
4714      }
4715      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(positionNext - 1) + ')').css({position: 'absolute', display: 'block', width: '100%', top: 0, left: String(slideWidth + window.bannerSliderObjects[listId]['divX']) +  'px'});;
4716      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').css({width: String(widthSlideCurrent) + 'px', display: 'block', 'margin-left' : window.bannerSliderObjects[listId]['divX']});
4717    }
4718  }
4719}
4720
4721function bannerSliderMoveEnd(listId){
4722
4723  var currentEntry      = jQuery('#bannerSlider_' + listId).data('currententry');
4724  var numberEntries     = jQuery('#bannerSlider_' + listId).data('numberentries');
4725  var animation         = jQuery('#bannerSlider_' + listId).data('animation');
4726  var positionNext      = currentEntry + 1;
4727  var positionPrev      = currentEntry - 1;
4728  if(positionNext > numberEntries){
4729    positionNext = 1;
4730  }
4731  if(positionPrev <= 0){
4732    positionPrev = numberEntries;
4733  }
4734  window.bannerSliderObjects[listId]['mouseStartX'] = null;
4735  window.bannerSliderObjects[listId]['mouseX'] = null;
4736  window.clearInterval(window.bannerSliderObjects[listId]['interval']);
4737
4738  //console.log('divx:' + window.bannerSliderObjects[listId]['divX']);
4739
4740  if(animation == 'scrollHorizontal'){
4741    var scrollingElement      = jQuery('#listEntries_' + listId).parent();
4742    var scrollingElementInner = jQuery('#listEntries_' + listId);
4743    var widthEntry            = scrollingElementInner.find('.listEntry').width();
4744    var marginLeftInner       = parseInt(scrollingElementInner.css('margin-left'));
4745    var positionNew           = Math.round((-marginLeftInner / widthEntry) + 1.1);
4746    selectListEntryBannerSlider(listId, positionNew);
4747  }
4748  else if(animation == 'slideHorizontal'){
4749    if(window.bannerSliderObjects[listId]['divX'] > 0){
4750      selectListEntryBannerSlider(listId, positionPrev, {'directionFrom' : 'left'});
4751    }
4752    else if(window.bannerSliderObjects[listId]['divX'] < 0){
4753      selectListEntryBannerSlider(listId, positionNext, {'directionFrom' : 'right'});
4754    }
4755  }
4756  else if(animation == 'slideFromRight'){
4757    if(window.bannerSliderObjects[listId]['divX'] < 0){
4758      selectListEntryBannerSlider(listId, positionNext, {});
4759    }
4760  }
4761  window.bannerSliderObjects[listId]['divX'] = 0;
4762}
4763
4764function selectListEntryBannerSlider(listId, position, options){
4765
4766  options = options || {};
4767
4768  if(jQuery('#listEntries_' + listId).data('entryactive') == '1'){
4769    return false;
4770  }
4771
4772  if(!window.bannerSliderObjects[listId]){
4773    return false;
4774  }
4775
4776  var fadeTime          = jQuery('#bannerSlider_' + listId).data('fadetime');
4777  var animation         = jQuery('#bannerSlider_' + listId).data('animation');
4778  var animationDuration = jQuery('#bannerSlider_' + listId).data('animationduration');
4779  var previewAnimation  = jQuery('#bannerSlider_' + listId).data('previewanimation');
4780  var numberEntries     = jQuery('#bannerSlider_' + listId).data('numberentries');
4781  var currentEntry      = jQuery('#bannerSlider_' + listId).data('currententry');
4782  var embedType         = jQuery('#bannerSlider_' + listId).data('embedtype');
4783
4784  if(options['animation']){
4785    animation = options['animation'];
4786  }
4787
4788  if(position == '+'){
4789    position = currentEntry < numberEntries ? parseInt(currentEntry) + 1 : 1;
4790  }
4791  else if(position == '-'){
4792    position = currentEntry != 1 ? parseInt(currentEntry) - 1 : numberEntries;
4793  }
4794  else if(position == 'init'){
4795    position = 1;
4796  }
4797
4798  //console.log(position + ' ' + currentEntry);
4799  if(position == currentEntry && animation != 'scrollHorizontal'){
4800    return false;
4801  }
4802
4803  if(typeof(fadeTime) != 'undefined' && fadeTime != '' && fadeTime != 0){
4804    window.clearInterval(window.bannerSliderObjects[listId]['interval']);
4805    window.bannerSliderObjects[listId]['interval'] = window.setInterval(function(){jQuery('#bannerSlider_' + listId).data('intervalcount', jQuery('#bannerSlider_' + listId).data('intervalcount') + 1);if(jQuery('#bannerSlider_' + listId).data('intervalcount') >= 128){window.clearInterval(window.bannerSliderObjects[listId]['interval'])};selectListEntryBannerSlider(listId, "+")}, fadeTime * 1000);
4806  }
4807
4808  jQuery('#bannerSlider_' + listId).data('currententry', position);
4809  jQuery('#listEntries_' + listId).data('entryactive', 1);
4810
4811  //console.log(currentEntry + ' / ' + position);
4812  //console.log(options['directionFrom']);
4813
4814  if(typeof options['directionFrom'] == 'undefined'){
4815    if(position == 1 &&  currentEntry > 2 && currentEntry >= numberEntries){
4816      options['directionFrom'] = 'right';
4817    }
4818    else if(currentEntry == 1 && position > 2 && position >= numberEntries){
4819      options['directionFrom'] = 'left';
4820    }
4821    else if(currentEntry - position < 0){
4822      options['directionFrom'] = 'right';
4823    }
4824    else{
4825      options['directionFrom'] = 'left';
4826    }
4827  }
4828
4829  //console.log(options['directionFrom']);
4830
4831  jQuery('#listEntries_' + listId + ' .listEntrySelectedInit').removeClass('listEntrySelectedInit');
4832  jQuery('#listEntries_' + listId + ' .listEntrySelectedReady').removeClass('listEntrySelectedReady');
4833  jQuery('#listEntries_' + listId + ' .listEntryProgress').removeClass('listEntryProgress');
4834  jQuery('#listEntries_' + listId + ' .listEntryFadingIn').removeClass('listEntryFadingIn');
4835  jQuery('#listEntries_' + listId + ' .listEntryFadingOut').removeClass('listEntryFadingOut');
4836  jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').addClass('listEntryFadingOut');
4837  jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').addClass('listEntryFadingIn');
4838
4839  jQuery('#listEntriesPreview_' + listId + ' .listEntrySelectedInit').removeClass('listEntrySelectedInit');
4840
4841  if(animation == 'slideFromRight' || animation == 'slideHorizontal' && options['directionFrom'] == 'right'){
4842    var slideWidth             = jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').width();
4843    var widthSlideCurrent      = jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').innerWidth();
4844    var marginLeftSlideCurrent = jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').css('marginLeft');
4845    if(typeof jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').data('position') == 'undefined'){
4846      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').data('position', jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').css('position'));
4847    }
4848
4849    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').css({position: 'absolute', display: 'block', width: '100%', zIndex: 1, top: 0, left: String(slideWidth + parseInt(marginLeftSlideCurrent)) +  'px'});
4850    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').css({width: String(widthSlideCurrent) + 'px', display: 'block'});
4851
4852    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').animate({'marginLeft': '-=' + String(slideWidth + parseInt(marginLeftSlideCurrent))}, animationDuration, function(){
4853      jQuery(this).css({display: 'none', marginLeft: 0, zIndex: 0});
4854    });
4855    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').animate({'left': '-=' + String(slideWidth + parseInt(marginLeftSlideCurrent))}, animationDuration, function(){
4856      //console.log(jQuery(this).data('position'));
4857      jQuery(this).css({display: 'block', position: jQuery(this).data('position'), marginLeft: 0, zIndex: 0});
4858      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').hide();
4859      jQuery('#listEntries_' + listId).data('entryactive', '');
4860      jQuery('#listEntries_' + listId + ' .listEntryFadingIn').removeClass('listEntryFadingIn');
4861      jQuery('#listEntries_' + listId + ' .listEntryFadingOut').removeClass('listEntryFadingOut');
4862      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').removeClass('listEntrySelected');
4863      window.setTimeout(function(){
4864        jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').addClass('listEntrySelected');
4865      }, 16);
4866    });
4867  }
4868  else if(animation == 'slideFromLeft' || animation == 'slideHorizontal'){
4869    var slideWidth             = jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').width();
4870    var widthSlideCurrent      = jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').innerWidth();
4871    var marginLeftSlideCurrent = jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').css('marginLeft');
4872    if(typeof jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').data('position') == 'undefined'){
4873      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').data('position', jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').css('position'));
4874    }
4875
4876    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').css({position: 'absolute', display: 'block', width: '100%', zIndex: 1, top: 0, left: String(parseInt(marginLeftSlideCurrent) - slideWidth) +  'px'});
4877    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').css({width: String(widthSlideCurrent) + 'px', display: 'block'});
4878
4879    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').animate({'marginLeft': '+=' + String(slideWidth - parseInt(marginLeftSlideCurrent))}, animationDuration, function(){
4880      jQuery(this).css({display: 'none', marginLeft: 0, zIndex: 0});
4881    });
4882    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').animate({'left': '+=' + String(slideWidth - parseInt(marginLeftSlideCurrent))}, animationDuration, function(){
4883      jQuery(this).css({display: 'block', position: jQuery(this).data('position'), marginLeft: 0, zIndex: 0});
4884      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').hide();
4885      jQuery('#listEntries_' + listId).data('entryactive', '');
4886      jQuery('#listEntries_' + listId + ' .listEntryFadingIn').removeClass('listEntryFadingIn');
4887      jQuery('#listEntries_' + listId + ' .listEntryFadingOut').removeClass('listEntryFadingOut');
4888      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').removeClass('listEntrySelected');
4889      window.setTimeout(function(){
4890        jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').addClass('listEntrySelected');
4891      }, 16);
4892    });
4893  }
4894  else if(animation == 'overlapFromRight'){
4895    var slideWidth = jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').width();
4896    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').css({position: 'absolute', display: 'block', width: '100%', top: 0, left: String(slideWidth) +  'px', zIndex: window.bannerSliderObjects[listId]['numberChanges']});
4897    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').animate({'marginLeft': '-=' + String(slideWidth)}, animationDuration, function(){
4898      jQuery(this).css({display: 'block', position: 'static', marginLeft: 0, zIndex: 0});
4899      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').css({position: 'static', display: 'none'});
4900      jQuery('#listEntries_' + listId).data('entryactive', '');
4901      jQuery('#listEntries_' + listId + ' .listEntryFadingIn').removeClass('listEntryFadingIn');
4902      jQuery('#listEntries_' + listId + ' .listEntryFadingOut').removeClass('listEntryFadingOut');
4903      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').removeClass('listEntrySelected');
4904      window.setTimeout(function(){
4905        jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').addClass('listEntrySelected');
4906      }, 16);
4907    });
4908  }
4909  else if(animation == 'overlapFromTop'){
4910    var slideHeight = jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').height();
4911    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').css({position: 'absolute', display: 'block', width: '100%', top: '-' + String(slideHeight) +  'px', left: 0, zIndex: window.bannerSliderObjects[listId]['numberChanges']});
4912    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').animate({'top': '+=' + String(slideHeight)}, animationDuration, function(){
4913      jQuery(this).css({display: 'block', position: 'static', marginLeft: 0, zIndex: 0});
4914      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').css({position: 'static', display: 'none'});
4915      jQuery('#listEntries_' + listId).data('entryactive', '');
4916      jQuery('#listEntries_' + listId + ' .listEntryFadingIn').removeClass('listEntryFadingIn');
4917      jQuery('#listEntries_' + listId + ' .listEntryFadingOut').removeClass('listEntryFadingOut');
4918      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').removeClass('listEntrySelected');
4919      window.setTimeout(function(){
4920        jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').addClass('listEntrySelected');
4921      }, 16);
4922    });
4923  }
4924  else if(animation == 'scrollHorizontal'){
4925    var leftContainer = parseInt(jQuery('#listEntries_' + listId).css('margin-left'));
4926    var leftEntry     = jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').position().left;
4927    var leftDiff      = leftEntry + leftContainer;
4928
4929    var movingWidth = String(leftDiff) + 'px';
4930    var scrollingElement      = jQuery('#listEntries_' + listId).parent();
4931    var scrollingElementInner = jQuery('#listEntries_' + listId);
4932    scrollingElementInner.animate({'margin-left' : '-=' + String(movingWidth)}, animationDuration, function(){
4933      var rightNew = - (Math.round(scrollingElement.width()) - (isNaN(parseInt(scrollingElementInner.css('margin-left'))) ? 0 : Math.round(parseFloat(scrollingElementInner.css('margin-left')))) - scrollingElementInner.width());
4934      if(rightNew <= 0){
4935        jQuery('#bannerSlider_' + listId).addClass('lastEntryVisible');
4936        jQuery('#bannerSlider_' + listId).parent('.elementStandard').addClass('lastEntryVisible');
4937      }
4938      else{
4939        jQuery('#bannerSlider_' + listId).removeClass('lastEntryVisible');
4940        jQuery('#bannerSlider_' + listId).parent('.elementStandard').removeClass('lastEntryVisible');
4941      }
4942    });
4943    jQuery('#listEntries_' + listId).data('entryactive', '');
4944    jQuery('#listEntries_' + listId + ' .listEntryFadingIn').removeClass('listEntryFadingIn');
4945    jQuery('#listEntries_' + listId + ' .listEntryFadingOut').removeClass('listEntryFadingOut');
4946    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').removeClass('listEntrySelected');
4947    window.setTimeout(function(){
4948      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').addClass('listEntrySelected');
4949    }, 16);
4950  }
4951  else if(animation == 'zooming'){
4952    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').css({position: 'absolute', display: 'block', width: '100%', top: 0, opacity: 0});
4953    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').css({display: 'block', opacity: 1});
4954    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').fadeTo(animationDuration, 0, function(){
4955      jQuery(this).css({display: 'none', opacity: 1});
4956    });
4957    window.setTimeout(function(){
4958      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').addClass('listEntrySelected');
4959    }, 16);
4960    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').fadeTo(animationDuration, 1, function(){
4961      jQuery(this).css({display: 'block', position: 'static'});
4962      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').hide();
4963      jQuery('#listEntries_' + listId).data('entryactive', '');
4964      jQuery('#listEntries_' + listId + ' .listEntryFadingIn').removeClass('listEntryFadingIn');
4965      jQuery('#listEntries_' + listId + ' .listEntryFadingOut').removeClass('listEntryFadingOut');
4966      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').removeClass('listEntrySelected');
4967    });
4968  }
4969  else if(animation == 'none'){
4970    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').css({display: 'block',  opacity: 1});
4971    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').css({display: 'none', opacity: 1});
4972    jQuery('#listEntries_' + listId).data('entryactive', '');
4973    jQuery('#listEntries_' + listId + ' .listEntryFadingIn').removeClass('listEntryFadingIn');
4974    jQuery('#listEntries_' + listId + ' .listEntryFadingOut').removeClass('listEntryFadingOut');
4975    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').removeClass('listEntrySelected');
4976    window.setTimeout(function(){
4977      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').addClass('listEntrySelected');
4978    }, 10);
4979  }
4980  else{
4981    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').css({position: 'absolute', display: 'block', width: '100%', top: 0, opacity: 0});
4982    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').css({display: 'block', opacity: 1});
4983    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').fadeTo(animationDuration, 0, function(){
4984      jQuery(this).css({display: 'none', opacity: 1});
4985    });
4986    jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').fadeTo(animationDuration, 1, function(){
4987      jQuery(this).css({display: 'block', position: 'static'});
4988      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').hide();
4989      jQuery('#listEntries_' + listId).data('entryactive', '');
4990      jQuery('#listEntries_' + listId + ' .listEntryFadingIn').removeClass('listEntryFadingIn');
4991      jQuery('#listEntries_' + listId + ' .listEntryFadingOut').removeClass('listEntryFadingOut');
4992      jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').removeClass('listEntrySelected');
4993      window.setTimeout(function(){
4994        jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').addClass('listEntrySelected');
4995      }, 16);
4996    });
4997  }
4998  selectListEntryBannerSliderPreview(listId, position);
4999  onAfterSelectListEntryBannerSlider(listId, position - 1);
5000}
5001
5002function selectListEntryBannerSliderPreview(listId, position){
5003
5004  var fadeTime          = jQuery('#bannerSlider_' + listId).data('fadetime');
5005  var animation         = jQuery('#bannerSlider_' + listId).data('previewanimation');
5006  var animationDuration = jQuery('#bannerSlider_' + listId).data('animationduration');
5007  var numberEntries     = jQuery('#bannerSlider_' + listId).data('numberentries');
5008  var currentEntry      = jQuery('#bannerSlider_' + listId).data('currententry');
5009
5010  jQuery('#listEntriesPreview_' + listId + ' .listEntry').removeClass('listEntrySelected');
5011  jQuery('#listEntriesPreview_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').addClass('listEntrySelected');
5012  if(fadeTime != ''){
5013    jQuery('#listEntriesPreview_' + listId + ' .listEntry').removeClass('listEntryProgress');
5014    jQuery('#listEntriesPreview_' + listId + ' .listEntry:eq(' + String(position - 1) + ')').addClass('listEntryProgress');
5015  }
5016
5017  if(animation == 'slidehorizontal'){
5018    var widthContainerPreviewEntry = jQuery('#listEntriesPreview_' + listId).parent().width();
5019    var widthOuterPreviewEntry     = jQuery('#listEntriesPreview_' + listId + ' .listEntry').first().outerWidth() + parseInt(j
5019Query('#listEntriesPreview_' + listId + ' .listEntry').first().css('margin-right'));
5020    var numberEntriesVisible       = parseInt(widthContainerPreviewEntry / widthOuterPreviewEntry);
5021    var marginLeft                 = (position - 1 - Math.round(numberEntriesVisible / 2)) * (widthOuterPreviewEntry);
5022
5023    if(marginLeft < 0){
5024      marginLeft = 0;
5025    }
5026
5027    jQuery('#listEntriesPreview_' + listId).animate('listEntrySelected').animate({'marginLeft': '-' + String(marginLeft) + 'px'}, animationDuration);
5028  }
5029  else if(animation == 'slidevertical'){
5030    var heightContainerPreviewEntry = jQuery('#listEntriesPreview_' + listId).parent().height();
5031    var heightOuterPreviewEntry     = jQuery('#listEntriesPreview_' + listId + ' .listEntry').first().outerHeight() + parseInt(jQuery('#listEntriesPreview_' + listId + ' .listEntry').first().css('margin-bottom'));
5032    var numberEntriesVisible        = parseInt(heightContainerPreviewEntry / heightOuterPreviewEntry);
5033    var marginTop                   = (position - 1 - Math.round(numberEntriesVisible / 2)) * (heightOuterPreviewEntry);
5034
5035    if(marginTop < 0){
5036      marginTop = 0;
5037    }
5038
5039    jQuery('#listEntriesPreview_' + listId).animate('listEntrySelected').animate({'marginTop': '-' + String(marginTop) + 'px'}, animationDuration);
5040  }
5041}
5042
5043
5044function onAfterSelectListEntryBannerSlider(listId, currentEntry, init){
5045
5046  var fadeTime          = jQuery('#bannerSlider_' + listId).data('fadetime');
5047  var animation         = jQuery('#bannerSlider_' + listId).data('animation');
5048  var animationZoom     = jQuery('#bannerSlider_' + listId).data('animationzoom');
5049  var animationDuration = jQuery('#bannerSlider_' + listId).data('animationduration');
5050  var numberEntries     = jQuery('#bannerSlider_' + listId).data('numberentries');
5051  var currentEntry      = jQuery('#bannerSlider_' + listId).data('currententry');
5052  var backgroundTarget  = jQuery('#bannerSlider_' + listId).data('background-target');
5053  var backgroundImgSrc  = jQuery('#listEntriesPreview_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').data('src-detail');
5054
5055  var urlEntryOnSelect = jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')').data('urlentryonselect');
5056
5057  //console.log(listId);
5058  //console.log(window.bannerSliderObjects[listId]);
5059  window.bannerSliderObjects[listId]['numberChanges'] += 1;
5060
5061  //console.log(window.bannerSliderObjects[listId]);
5062  //console.log('numberChanges' + window.bannerSliderObjects[listId]['numberChanges']);
5063  jQuery('#bannerSlider_' + listId).get(0).className = jQuery('#bannerSlider_' + listId).get(0).className.replace(/\s+numberChanges-\d+/, '') + ' numberChanges-' + window.bannerSliderObjects[listId]['numberChanges'];
5064
5065  if(currentEntry == 1){
5066    jQuery('#bannerSlider_' + listId).addClass('firstEntrySelected');
5067    jQuery('#bannerSlider_' + listId).parent('.elementStandard').addClass('firstEntrySelected');
5068  }
5069  else{
5070    jQuery('#bannerSlider_' + listId).removeClass('firstEntrySelected');
5071    jQuery('#bannerSlider_' + listId).parent('.elementStandard').removeClass('firstEntrySelected');
5072  }
5073
5074  if(currentEntry == numberEntries){
5075    jQuery('#bannerSlider_' + listId).addClass('lastEntrySelected');
5076    jQuery('#bannerSlider_' + listId).parent('.elementStandard').addClass('lastEntrySelected');
5077  }
5078  else{
5079    jQuery('#bannerSlider_' + listId).removeClass('lastEntrySelected');
5080    jQuery('#bannerSlider_' + listId).parent('.elementStandard').removeClass('lastEntrySelected');
5081  }
5082
5083  if(typeof(urlEntryOnSelect) != 'undefined' && location.href.indexOf('/apps/wEditor') == -1){
5084    if(history.pushState){
5085      history.pushState({page: urlEntryOnSelect}, '', urlEntryOnSelect);
5086    }
5087  }
5088
5089  if(typeof backgroundTarget != 'undefined'){
5090    if(backgroundTarget == 'body'){
5091      if(jQuery('#backgroundImageSliderTmp').length == 0){
5092        jQuery(backgroundTarget).prepend('<div id="backgroundImageSliderTmp" style="position:absolute;z-index:-1;top:0;height:100%;width:100%"></div>');
5093        if(backgroundTarget != 'body'){
5094          jQuery('#backgroundImageSliderTmp').get(0).zIndex = '0';
5095        }
5096        var backgroundRepeatSet = jQuery(backgroundTarget).css('background-repeat');
5097        if(backgroundRepeatSet == 'repeat-x'){backgroundRepeatSet = 'repeat no-repeat';}
5098        else if(backgroundRepeatSet == 'repeat-y'){backgroundRepeatSet = 'no-repeat repeat';}
5099        else if(backgroundRepeatSet == 'repeat'){backgroundRepeatSet = 'repeat';}
5100        jQuery('#backgroundImageSliderTmp').get(0).style.backgroundRepeat     = backgroundRepeatSet;
5101        jQuery('#backgroundImageSliderTmp').get(0).style.backgroundAttachment = jQuery(backgroundTarget).css('background-attachment')
5102        jQuery('#backgroundImageSliderTmp').get(0).style.backgroundSize = jQuery(backgroundTarget).css('background-size');
5103      }
5104      jQuery('#backgroundImageSliderTmp').css({'display': 'none', 'background-image': 'url(' + backgroundImgSrc + ')', 'height': jQuery(backgroundTarget == 'body' ? 'html' : backgroundTarget).height()});
5105      if(init){
5106        jQuery(backgroundTarget).css({'background-image': 'url(' + backgroundImgSrc + ')'});
5107      }
5108      else{
5109        jQuery('#backgroundImageSliderTmp').fadeIn(animationDuration, function(){jQuery(this).hide();jQuery(backgroundTarget).css({'background-image': 'url(' + backgroundImgSrc + ')'})});
5110      }
5111    }
5112    else{
5113      jQuery(backgroundTarget).css({'position': 'relative'});
5114      if(jQuery('#backgroundImageSliderTmp').length == 0){
5115        var heightCurrent = String(jQuery(backgroundTarget).outerHeight()) + 'px';
5116        var widthCurrent  = String(jQuery(backgroundTarget).outerWidth()) + 'px';
5117        var marginTop     = '-' + String(jQuery(backgroundTarget).outerHeight() + parseInt(j
5117Query(backgroundTarget).css('margin-top')) + parseInt(jQuery(backgroundTarget).css('margin-bottom'))) + 'px';
5118        var marginLeft    = parseInt(jQuery(backgroundTarget).css('margin-left')) + 'px';
5119        jQuery(backgroundTarget).css({'height': heightCurrent}).wrapInner('<div id="backgroundImageSliderWrapperInner" style="position:absolute;z-index:1;width:100%;height:100%"/>').after('<div id="backgroundImageSliderTmp" style="position:absolute;z-index:0;margin-top:' + marginTop + ';margin-left:' + marginLeft + ';width:' + widthCurrent + ';height:' + heightCurrent + '"></div>');
5120        var backgroundRepeatSet = jQuery(backgroundTarget).css('background-repeat');
5121        if(backgroundRepeatSet == 'repeat-x'){backgroundRepeatSet = 'repeat no-repeat';}
5122        else if(backgroundRepeatSet == 'repeat-y'){backgroundRepeatSet = 'no-repeat repeat';}
5123        else if(backgroundRepeatSet == 'repeat'){backgroundRepeatSet = 'repeat';}
5124        jQuery('#backgroundImageSliderTmp').get(0).style.backgroundRepeat     = backgroundRepeatSet;
5125        jQuery('#backgroundImageSliderTmp').get(0).style.backgroundAttachment = jQuery(backgroundTarget).css('background-attachment')
5126        jQuery('#backgroundImageSliderTmp').get(0).style.backgroundSize = jQuery(backgroundTarget).css('background-size');
5127      }
5128      jQuery('#backgroundImageSliderTmp').css({'display': 'none', 'background-image': 'url(' + backgroundImgSrc + ')', 'height': jQuery(backgroundTarget == 'body' ? 'html' : backgroundTarget).height()});
5129      if(init){
5130        jQuery(backgroundTarget).css({'background-image': 'url(' + backgroundImgSrc + ')'});
5131      }
5132      else{
5133        jQuery('#backgroundImageSliderTmp').fadeIn(animationDuration, function(){
5134          jQuery(this).hide();
5135          jQuery(backgroundTarget).css({'background-image': 'url(' + backgroundImgSrc + ')'})
5136          jQuery('#backgroundImageSliderWrapperInner').children().unwrap();
5137          jQuery('#backgroundImageSliderTmp').remove();
5138        });
5139      }
5140    }
5141  }
5142
5143  if(animation == 'zooming'){
5144    jQuery.each(jQuery('#listEntries_' + listId + ' .listEntry:eq(' + String(currentEntry - 1) + ')'), function(){
5145
5146      animationZoom = (typeof(animationZoom) == 'number' ? parseFloat(animationZoom) : 1.5);
5147
5148      jQc = jQuery(this);
5149
5150      if(!fadeTime || fadeTime == ''){
5151        fadeTime = 10;
5152      }
5153
5154      fadeTime = Math.round((fadeTime + animationDuration / 1000 - 0.05) * 10) / 10;
5155
5156      jQc.find('.listEntryImage').css({'transition' : 'all 0s linear', 'transform' : 'scale(1) rotate(0)', 'margin' : '0', 'width' : '100%', 'height' : 'auto'});
5157      (function(jQc){
5158        window.setTimeout(function(){
5159          jQc.find('.listEntryImage').css({'transition' : 'all ' + String(fadeTime) + 's linear', 'transform' : 'scale(' + String(animationZoom) + ') rotate(0.1deg)'});}, 32);
5160      })(jQc);
5161    });
5162  }
5163
5164  wOptimizePictureSizes();
5165  
5166  //Event definierbar in design.js nach Welchsel des BannerSliders
5167  if(typeof(onAfterSelectListEntryBannerSliderProject) ==  'function') {
5168    onAfterSelectListEntryBannerSliderProject(listId, currentEntry, init);
5169  }
5170}
5171

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.