if("undefined"==typeof Joomla)var Joomla={};!function(a,b){"use strict";b.setcollapse=function(b,c,d){a.getElementById("collapse-"+c)||(a.getElementById("container-collapse").innerHTML='<div class="collapse fade" id="collapse-'+c+'"><iframe class="iframe" src="'+b+'" height="'+d+'" width="100%"></iframe></div>')},Array.prototype.indexOf||(Array.prototype.indexOf=function(a){var b=this.length>>>0,c=Number(arguments[1])||0;for(c=c<0?Math.ceil(c):Math.floor(c),c<0&&(c+=b);c<b;c++)if(c in this&&this[c]===a)return c;return-1}),window.jQuery&&function(b){function c(a,c){for(var f,g,h,i,d=!0,e=a.data("showon")||[],j=0,k=e.length;j<k;j++)g=e[j]||{},h=g.field,i=b('[name="'+h+'"], [name="'+h+'[]"]'),g.valid=0,i.each(function(){var a=b(this);f=["checkbox","radio"].indexOf(a.attr("type"))!==-1?a.prop("checked")?a.val():"":a.val(),"object"!=typeof f&&(f=JSON.parse('["'+f+'"]'));for(var c in f)"="==e[j].sign&&e[j].values.indexOf(f[c])!==-1&&(e[j].valid=1),"!="==e[j].sign&&e[j].values.indexOf(f[c])===-1&&(e[j].valid=1)}),""===g.op?0===g.valid&&(d=!1):("AND"===g.op&&g.valid+e[j-1].valid<2&&(d=!1),"OR"===g.op&&g.valid+e[j-1].valid>0&&(d=!0));c?d?a.slideDown():a.slideUp():a.toggle(d)}function d(d){d=d||a;for(var e=b(d).find("[data-showon]"),f=0,g=e.length;f<g;f++)!function(){for(var g,a=b(e[f]),d=a.data("showon")||[],h=b(),i=0,j=d.length;i<j;i++)g=d[i].field,h=h.add(b('[name="'+g+'"], [name="'+g+'[]"]'));c(a),h.on("change",function(){c(a,!0)})}()}b(a).ready(function(){d(),b(a).on("subform-row-add",function(a,c){for(var k,l,e=b(c),f=e.find("[data-showon]"),g=e.data("baseName"),h=e.data("group"),i=new RegExp("\\["+g+"\\]\\["+g+"X\\]","g"),j="["+g+"]["+h+"]",m=0,n=f.length;m<n;m++)k=b(f[m]),l=k.attr("data-showon").replace(i,j),k.attr("data-showon",l);d(c)})})}(jQuery)}(document,Joomla);
