if("undefined"==typeof Joomla)var Joomla={};!function(e,a){"use strict";a.setcollapse=function(a,n,o){e.getElementById("collapse-"+n)||(e.getElementById("container-collapse").innerHTML='
')},Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var a=this.length>>>0,n=Number(arguments[1])||0;for(n=0>n?Math.ceil(n):Math.floor(n),0>n&&(n+=a);a>n;n++)if(n in this&&this[n]===e)return n;return-1}),window.jQuery&&function(a){function n(e,n){for(var o,t,i,r,l=!0,d=e.data("showon")||[],f=0,s=d.length;s>f;f++)t=d[f]||{},i=t.field,r=a('[name="'+i+'"], [name="'+i+'[]"]'),t.valid=0,r.each(function(){var e=a(this);if(-1!==["checkbox","radio"].indexOf(e.attr("type"))){if(!e.prop("checked"))return;o=e.val()}else o=e.val(),null==o&&"select"==e.prop("tagName").toLowerCase()&&(o=[]);"object"!=typeof o&&(o=JSON.parse('["'+o+'"]'));for(var n in o)o.propertyIsEnumerable(n)&&("="==d[f].sign&&-1!==d[f].values.indexOf(o[n])&&(d[f].valid=1),"!="==d[f].sign&&-1===d[f].values.indexOf(o[n])&&(d[f].valid=1))}),""===t.op?0===t.valid&&(l=!1):("AND"===t.op&&t.valid+d[f-1].valid<2&&(l=!1),"OR"===t.op&&t.valid+d[f-1].valid>0&&(l=!0));n?l?e.slideDown():e.slideUp():e.toggle(l)}function o(o){o=o||e;for(var t=a(o).find("[data-showon]"),i=0,r=t.length;r>i;i++)!function(){for(var e,o=a(t[i]),r=o.data("showon")||[],l=a(),d=0,f=r.length;f>d;d++)e=r[d].field,l=l.add(a('[name="'+e+'"], [name="'+e+'[]"]'));n(o),l.on("change",function(){n(o,!0)})}()}a(e).ready(function(){o(),a(e).on("subform-row-add",function(e,n){for(var t,i,r=a(n),l=r.find("[data-showon]"),d=r.data("baseName"),f=r.data("group"),s=new RegExp("\\["+d+"\\]\\["+d+"X\\]","g"),c="["+d+"]["+f+"]",u=0,p=l.length;p>u;u++)t=a(l[u]),i=t.attr("data-showon").replace(s,c),t.attr("data-showon",i);o(n)})})}(jQuery)}(document,Joomla);