var ComponentsDropdowns,OpsydCoreJS,Layout;(function(n){"use strict";function u(n,t){return n.toUpperCase().indexOf(t.toUpperCase())>-1}function i(t){return n.each([{re:/[\xC0-\xC6]/g,ch:"A"},{re:/[\xE0-\xE6]/g,ch:"a"},{re:/[\xC8-\xCB]/g,ch:"E"},{re:/[\xE8-\xEB]/g,ch:"e"},{re:/[\xCC-\xCF]/g,ch:"I"},{re:/[\xEC-\xEF]/g,ch:"i"},{re:/[\xD2-\xD6]/g,ch:"O"},{re:/[\xF2-\xF6]/g,ch:"o"},{re:/[\xD9-\xDC]/g,ch:"U"},{re:/[\xF9-\xFC]/g,ch:"u"},{re:/[\xC7-\xE7]/g,ch:"c"},{re:/[\xD1]/g,ch:"N"},{re:/[\xF1]/g,ch:"n"}],function(){t=t.replace(this.re,this.ch)}),t}function r(n){var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},r="(?:"+Object.keys(i).join("|")+")",u=new RegExp(r),f=new RegExp(r,"g"),t=n==null?"":""+n;return u.test(t)?t.replace(f,function(n){return i[n]}):t}function f(i,r){var u=arguments,o=i,i=u[0],r=u[1],f,e;return[].shift.apply(u),typeof i=="undefined"&&(i=o),e=this.each(function(){var s=n(this),e,o,c,h;if(s.is("select")){if(e=s.data("selectpicker"),o=typeof i=="object"&&i,e){if(o)for(h in o)o.hasOwnProperty(h)&&(e.options[h]=o[h])}else c=n.extend({},t.DEFAULTS,n.fn.selectpicker.defaults||{},s.data(),o),s.data("selectpicker",e=new t(this,c,r));typeof i=="string"&&(f=e[i]instanceof Function?e[i].apply(e,u):e.options[i])}}),typeof f!="undefined"?f:e}var t,e;n.expr[":"].icontains=function(t,i,r){return u(n(t).text(),r[3])};n.expr[":"].aicontains=function(t,i,r){return u(n(t).data("normalizedText")||n(t).text(),r[3])};t=function(i,r,u){u&&(u.stopPropagation(),u.preventDefault());this.$element=n(i);this.$newElement=null;this.$button=null;this.$menu=null;this.$lis=null;this.options=r;this.options.title===null&&(this.options.title=this.$element.attr("title"));this.val=t.prototype.val;this.render=t.prototype.render;this.refresh=t.prototype.refresh;this.setStyle=t.prototype.setStyle;this.selectAll=t.prototype.selectAll;this.deselectAll=t.prototype.deselectAll;this.destroy=t.prototype.remove;this.remove=t.prototype.remove;this.show=t.prototype.show;this.hide=t.prototype.hide;this.init()};t.VERSION="1.6.3";t.DEFAULTS={noneSelectedText:"Nothing selected",noneResultsText:"No results match",countSelectedText:function(n){return n==1?"{0} item selected":"{0} items selected"},maxOptionsText:function(n,t){var i=[];return i[0]=n==1?"Limit reached ({n} item max)":"Limit reached ({n} items max)",i[1]=t==1?"Group limit reached ({n} item max)":"Group limit reached ({n} items max)",i},selectAllText:"Select All",deselectAllText:"Deselect All",multipleSeparator:", ",style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",width:!1,container:!1,hideDisabled:!1,showSubtext:!1,showIcon:!0,showContent:!0,dropupAuto:!0,header:!1,liveSearch:!1,actionsBox:!1,iconBase:"glyphicon",tickIcon:"glyphicon-ok",maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,searchAccentInsensitive:!1};t.prototype={constructor:t,init:function(){var i=this,t=this.$element.attr("id");this.$element.hide();this.multiple=this.$element.prop("multiple");this.autofocus=this.$element.prop("autofocus");this.$newElement=this.createView();this.$element.after(this.$newElement);this.$menu=this.$newElement.find("> .dropdown-menu");this.$button=this.$newElement.find("> button");this.$searchbox=this.$newElement.find("input");this.options.dropdownAlignRight&&this.$menu.addClass("dropdown-menu-right");typeof t!="undefined"&&(this.$button.attr("data-id",t),n('label[for="'+t+'"]').click(function(n){n.preventDefault();i.$button.focus()}));this.checkDisabled();this.clickListener();this.options.liveSearch&&this.liveSearchListener();this.render();this.liHeight();this.setStyle();this.setWidth();this.options.container&&this.selectPosition();this.$menu.data("this",this);this.$newElement.data("this",this);this.options.mobile&&this.mobile()},createDropdown:function(){var t=this.multiple?" show-tick":"",i=this.$element.parent().hasClass("input-group")?" input-group-btn":"",r=this.autofocus?" autofocus":"",u=this.$element.parents().hasClass("form-group-lg")?" btn-lg":this.$element.parents().hasClass("form-group-sm")?" btn-sm":"",f=this.options.header?'<div class="popover-title"><button type="button" class="close" aria-hidden="true">&times;<\/button>'+this.options.header+"<\/div>":"",e=this.options.liveSearch?'<div class="bs-searchbox"><input type="text" class="input-block-level form-control" autocomplete="off" /><\/div>':"",o=this.options.actionsBox?'<div class="bs-actionsbox"><div class="btn-group btn-block"><button class="actions-btn bs-select-all btn btn-sm btn-default">'+this.options.selectAllText+'<\/button><button class="actions-btn bs-deselect-all btn btn-sm btn-default">'+this.options.deselectAllText+"<\/button><\/div><\/div>":"",s='<div class="btn-group bootstrap-select'+t+i+'"><button type="button" class="btn dropdown-toggle selectpicker'+u+'" data-toggle="dropdown"'+r+'><span class="filter-option pull-left"><\/span>&nbsp;<span class="caret"><\/span><\/button><div class="dropdown-menu open">'+f+e+o+'<ul class="dropdown-menu inner selectpicker" role="menu"><\/ul><\/div><\/div>';return n(s)},createView:function(){var n=this.createDropdown(),t=this.createLi();return n.find("ul").append(t),n},reloadLi:function(){this.destroyLi();var n=this.createLi();this.$menu.find("ul").append(n)},destroyLi:function(){this.$menu.find("li").remove()},createLi:function(){var f=this,t=[],o=0,u=function(n,t,i){return"<li"+(typeof i!="undefined"?' class="'+i+'"':"")+(typeof t!="undefined"|null===t?' data-original-index="'+t+'"':"")+">"+n+"<\/li>"},e=function(n,t,u,e){var o=i(r(n));return'<a tabindex="0"'+(typeof t!="undefined"?' class="'+t+'"':"")+(typeof u!="undefined"?' style="'+u+'"':"")+(typeof e!="undefined"?'data-optgroup="'+e+'"':"")+' data-normalized-text="'+o+'">'+n+'<span class="'+f.options.iconBase+" "+f.options.tickIcon+' check-mark"><\/span><\/a>'};return this.$element.find("option").each(function(){var i=n(this),c=i.attr("class")||"",l=i.attr("style"),r=i.data("content")?i.data("content"):i.html(),y=typeof i.data("subtext")!="undefined"?'<small class="muted text-muted">'+i.data("subtext")+"<\/small>":"",h=typeof i.data("icon")!="undefined"?'<span class="'+f.options.iconBase+" "+i.data("icon")+'"><\/span> ':"",v=i.is(":disabled")||i.parent().is(":disabled"),s=i[0].index;if(h!==""&&v&&(h="<span>"+h+"<\/span>"),i.data("content")||(r=h+'<span class="text">'+r+y+"<\/span>"),!f.options.hideDisabled||!v)if(i.parent().is("optgroup")&&i.data("divider")!==!0){if(i.index()===0){o+=1;var a=i.parent().attr("label"),p=typeof i.parent().data("subtext")!="undefined"?'<small class="muted text-muted">'+i.parent().data("subtext")+"<\/small>":"",w=i.parent().data("icon")?'<span class="'+f.options.iconBase+" "+i.parent().data("icon")+'"><\/span> ':"";a=w+'<span class="text">'+a+p+"<\/span>";s!==0&&t.length>0&&t.push(u("",null,"divider"));t.push(u(a,null,"dropdown-header"))}t.push(u(e(r,"opt "+c,l,o),s))}else i.data("divider")===!0?t.push(u("",s,"divider")):i.data("hidden")===!0?t.push(u(e(r,c,l),s,"hide is-hidden")):t.push(u(e(r,c,l),s))}),this.multiple||this.$element.find("option:selected").length!==0||this.options.title||this.$element.find("option").eq(0).prop("selected",!0).attr("selected","selected"),n(t.join(""))},findLis:function(){return this.$lis==null&&(this.$lis=this.$menu.find("li")),this.$lis},render:function(t){var i=this,e,s,h;t!==!1&&this.$element.find("option").each(function(t){i.setDisabled(t,n(this).is(":disabled")||n(this).parent().is(":disabled"));i.setSelected(t,n(this).is(":selected"))});this.tabIndex();var o=this.options.hideDisabled?":not([disabled])":"",u=this.$element.find("option:selected"+o).map(function(){var t=n(this),u=t.data("icon")&&i.options.showIcon?'<i class="'+i.options.iconBase+" "+t.data("icon")+'"><\/i> ':"",r;return r=i.options.showSubtext&&t.attr("data-subtext")&&!i.multiple?' <small class="muted text-muted">'+t.data("subtext")+"<\/small>":"",t.data("content")&&i.options.showContent?t.data("content"):typeof t.attr("title")!="undefined"?t.attr("title"):u+t.html()+r}).toArray(),f=this.multiple?u.join(this.options.multipleSeparator):u[0];this.multiple&&this.options.selectedTextFormat.indexOf("count")>-1&&(e=this.options.selectedTextFormat.split(">"),(e.length>1&&u.length>e[1]||e.length==1&&u.length>=2)&&(o=this.options.hideDisabled?", [disabled]":"",s=this.$element.find("option").not('[data-divider="true"], [data-hidden="true"]'+o).length,h=typeof this.options.countSelectedText=="function"?this.options.countSelectedText(u.length,s):this.options.countSelectedText,f=h.replace("{0}",u.length.toString()).replace("{1}",s.toString())));this.options.title=this.$element.attr("title");this.options.selectedTextFormat=="static"&&(f=this.options.title);f||(f=typeof this.options.title!="undefined"?this.options.title:this.options.noneSelectedText);this.$button.attr("title",r(f));this.$newElement.find(".filter-option").html(f)},setStyle:function(n,t){this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|validate\[.*\]/gi,""));var i=n?n:this.options.style;t=="add"?this.$button.addClass(i):t=="remove"?this.$button.removeClass(i):(this.$button.removeClass(this.options.style),this.$button.addClass(i))},liHeight:function(){if(this.options.size!==!1){var t=this.$menu.parent().clone().find("> .dropdown-toggle").prop("autofocus",!1).end().appendTo("body"),n=t.addClass("open").find("> .dropdown-menu"),i=n.find("li").not(".divider").not(".dropdown-header").filter(":visible").children("a").outerHeight(),r=this.options.header?n.find(".popover-title").outerHeight():0,u=this.options.liveSearch?n.find(".bs-searchbox").outerHeight():0,f=this.options.actionsBox?n.find(".bs-actionsbox").outerHeight():0;t.remove();this.$newElement.data("liHeight",i).data("headerHeight",r).data("searchHeight",u).data("actionsHeight",f)}},setSize:function(){var e,b,k;this.findLis();var r=this,t=this.$menu,a=t.find(".inner"),d=this.$newElement.outerHeight(),v=this.$newElement.data("liHeight"),h=this.$newElement.data("headerHeight"),c=this.$newElement.data("searchHeight"),l=this.$newElement.data("actionsHeight"),g=this.$lis.filter(".divider").outerHeight(!0),u=parseInt(t.css("padding-top"))+parseInt(t.css("padding-bottom"))+parseInt(t.css("border-top-width"))+parseInt(t.css("border-bottom-width")),y=this.options.hideDisabled?", .disabled":"",p=n(window),o=u+parseInt(t.css("margin-top"))+parseInt(t.css("margin-bottom"))+2,i,f,s,w=function(){f=r.$newElement.offset().top-p.scrollTop();s=p.height()-f-d};if(w(),this.options.header&&t.css("padding-top",0),this.options.size=="auto"){e=function(){var n,e=r.$lis.not(".hide");w();i=s-o;r.options.dropupAuto&&r.$newElement.toggleClass("dropup",f>s&&i-o<t.height());r.$newElement.hasClass("dropup")&&(i=f-o);n=e.length+e.filter(".dropdown-header").length>3?v*3+o-2:0;t.css({"max-height":i+"px",overflow:"hidden","min-height":n+h+c+l+"px"});a.css({"max-height":i-h-c-l-u+"px","overflow-y":"auto","min-height":Math.max(n-u,0)+"px"})};e();this.$searchbox.off("input.getSize propertychange.getSize").on("input.getSize propertychange.getSize",e);n(window).off("resize.getSize").on("resize.getSize",e);n(window).off("scroll.getSize").on("scroll.getSize",e)}else this.options.size&&this.options.size!="auto"&&t.find("li"+y).length>this.options.size&&(b=this.$lis.not(".divider"+y).find(" > *").slice(0,this.options.size).last().parent().index(),k=this.$lis.slice(0,b+1).filter(".divider").length,i=v*this.options.size+k*g+u,r.options.dropupAuto&&this.$newElement.toggleClass("dropup",f>s&&i<t.height()),t.css({"max-height":i+h+c+l+"px",overflow:"hidden"}),a.css({"max-height":i-u+"px","overflow-y":"auto"}))},setWidth:function(){if(this.options.width=="auto"){this.$menu.css("min-width","0");var n=this.$newElement.clone().appendTo("body"),t=n.find("> .dropdown-menu").css("width"),i=n.css("width","auto").find("> button").css("width");n.remove();this.$newElement.css("width",Math.max(parseInt(t),parseInt(i))+"px")}else this.options.width=="fit"?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width",""));this.$newElement.hasClass("fit-width")&&this.options.width!=="fit"&&this.$newElement.removeClass("fit-width")},selectPosition:function(){var t=this,i=n("<div />"),r,f,u=function(n){i.addClass(n.attr("class").replace(/form-control/gi,"")).toggleClass("dropup",n.hasClass("dropup"));r=n.offset();f=n.hasClass("dropup")?0:n[0].offsetHeight;i.css({top:r.top+f,left:r.left,width:n[0].offsetWidth,position:"absolute"})};this.$newElement.on("click",function(){t.isDisabled()||(u(n(this)),i.appendTo(t.options.container),i.toggleClass("open",!n(this).hasClass("open")),i.append(t.$menu))});n(window).resize(function(){u(t.$newElement)});n(window).on("scroll",function(){u(t.$newElement)});n("html").on("click",function(r){n(r.target).closest(t.$newElement).length<1&&i.removeClass("open")})},setSelected:function(n,t){this.findLis();this.$lis.filter('[data-original-index="'+n+'"]').toggleClass("selected",t)},setDisabled:function(n,t){this.findLis();t?this.$lis.filter('[data-original-index="'+n+'"]').addClass("disabled").find("a").attr("href","#").attr("tabindex",-1):this.$lis.filter('[data-original-index="'+n+'"]').removeClass("disabled").find("a").removeAttr("href").attr("tabindex",0)},isDisabled:function(){return this.$element.is(":disabled")},checkDisabled:function(){var n=this;this.isDisabled()?this.$button.addClass("disabled").attr("tabindex",-1):(this.$button.hasClass("disabled")&&this.$button.removeClass("disabled"),this.$button.attr("tabindex")==-1&&(this.$element.data("tabindex")||this.$button.removeAttr("tabindex")));this.$button.click(function(){return!n.isDisabled()})},tabIndex:function(){this.$element.is("[tabindex]")&&(this.$element.data("tabindex",this.$element.attr("tabindex")),this.$button.attr("tabindex",this.$element.data("tabindex")))},clickListener:function(){var t=this;this.$newElement.on("touchstart.dropdown",".dropdown-menu",function(n){n.stopPropagation()});this.$newElement.on("click",function(){t.setSize();t.options.liveSearch||t.multiple||setTimeout(function(){t.$menu.find(".selected a").focus()},10)});this.$menu.on("click","li a",function(i){var s=n(this),e=s.parent().data("originalIndex"),k=t.$element.val(),d=t.$element.prop("selectedIndex"),a,v,b;if(t.multiple&&i.stopPropagation(),i.preventDefault(),!t.isDisabled()&&!s.parent().hasClass("disabled")){var h=t.$element.find("option"),f=h.eq(e),w=f.prop("selected"),l=f.parent("optgroup"),r=t.options.maxOptions,u=l.data("maxOptions")||!1;if(t.multiple){if(f.prop("selected",!w),t.setSelected(e,!w),s.blur(),(r!==!1||u!==!1)&&(a=r<h.filter(":selected").length,v=u<l.find("option:selected").length,r&&a||u&&v))if(r&&r==1)h.prop("selected",!1),f.prop("selected",!0),t.$menu.find(".selected").removeClass("selected"),t.setSelected(e,!0);else if(u&&u==1)l.find("option:selected").prop("selected",!1),f.prop("selected",!0),b=s.data("optgroup"),t.$menu.find(".selected").has('a[data-optgroup="'+b+'"]').removeClass("selected"),t.setSelected(e,!0);else{var o=typeof t.options.maxOptionsText=="function"?t.options.maxOptionsText(r,u):t.options.maxOptionsText,y=o[0].replace("{n}",r),p=o[1].replace("{n}",u),c=n('<div class="notify"><\/div>');o[2]&&(y=y.replace("{var}",o[2][r>1?0:1]),p=p.replace("{var}",o[2][u>1?0:1]));f.prop("selected",!1);t.$menu.append(c);r&&a&&(c.append(n("<div>"+y+"<\/div>")),t.$element.trigger("maxReached.bs.select"));u&&v&&(c.append(n("<div>"+p+"<\/div>")),t.$element.trigger("maxReachedGrp.bs.select"));setTimeout(function(){t.setSelected(e,!1)},10);c.delay(750).fadeOut(300,function(){n(this).remove()})}}else h.prop("selected",!1),f.prop("selected",!0),t.$menu.find(".selected").removeClass("selected"),t.setSelected(e,!0);t.multiple?t.options.liveSearch&&t.$searchbox.focus():t.$button.focus();(k!=t.$element.val()&&t.multiple||d!=t.$element.prop("selectedIndex")&&!t.multiple)&&t.$element.change()}});this.$menu.on("click","li.disabled a, .popover-title, .popover-title :not(.close)",function(n){n.target==this&&(n.preventDefault(),n.stopPropagation(),t.options.liveSearch?t.$searchbox.focus():t.$button.focus())});this.$menu.on("click","li.divider, li.dropdown-header",function(n){n.preventDefault();n.stopPropagation();t.options.liveSearch?t.$searchbox.focus():t.$button.focus()});this.$menu.on("click",".popover-title .close",function(){t.$button.focus()});this.$searchbox.on("click",function(n){n.stopPropagation()});this.$menu.on("click",".actions-btn",function(i){t.options.liveSearch?t.$searchbox.focus():t.$button.focus();i.preventDefault();i.stopPropagation();n(this).is(".bs-select-all")?t.selectAll():t.deselectAll();t.$element.change()});this.$element.change(function(){t.render(!1)})},liveSearchListener:function(){var t=this,u=n('<li class="no-results"><\/li>');this.$newElement.on("click.dropdown.data-api touchstart.dropdown.data-api",function(){t.$menu.find(".active").removeClass("active");!t.$searchbox.val()||(t.$searchbox.val(""),t.$lis.not(".is-hidden").removeClass("hide"),!u.parent().length||u.remove());t.multiple||t.$menu.find(".selected").addClass("active");setTimeout(function(){t.$searchbox.focus()},10)});this.$searchbox.on("click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api",function(n){n.stopPropagation()});this.$searchbox.on("input propertychange",function(){t.$searchbox.val()?(t.options.searchAccentInsensitive?t.$lis.not(".is-hidden").removeClass("hide").find("a").not(":aicontains("+i(t.$searchbox.val())+")").parent().addClass("hide"):t.$lis.not(".is-hidden").removeClass("hide").find("a").not(":icontains("+t.$searchbox.val()+")").parent().addClass("hide"),t.$menu.find("li").filter(":visible:not(.no-results)").length?!u.parent().length||u.remove():(!u.parent().length||u.remove(),u.html(t.options.noneResultsText+' "'+r(t.$searchbox.val())+'"').show(),t.$menu.find("li").last().after(u))):(t.$lis.not(".is-hidden").removeClass("hide"),!u.parent().length||u.remove());t.$menu.find("li.active").removeClass("active");t.$menu.find("li").filter(":visible:not(.divider)").eq(0).addClass("active").find("a").focus();n(this).focus()})},val:function(n){return typeof n!="undefined"?(this.$element.val(n),this.render(),this.$element):this.$element.val()},selectAll:function(){this.findLis();this.$lis.not(".divider").not(".disabled").not(".selected").filter(":visible").find("a").click()},deselectAll:function(){this.findLis();this.$lis.not(".divider").not(".disabled").filter(".selected").filter(":visible").find("a").click()},keydown:function(t){var e=n(this),c=e.is("input")?e.parent().parent():e.parent(),f,r=c.data("this"),u,h,l,a,y,p,b,s,w={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},v,o,k;(r.options.liveSearch&&(c=e.parent().parent()),r.options.container&&(c=r.$menu),f=n("[role=menu] li a",c),s=r.$menu.parent().hasClass("open"),!s&&/([0-9]|[A-z])/.test(String.fromCharCode(t.keyCode))&&(r.options.container?r.$newElement.trigger("click"):(r.setSize(),r.$menu.parent().addClass("open"),s=!0),r.$searchbox.focus()),r.options.liveSearch&&(/(^9$|27)/.test(t.keyCode.toString(10))&&s&&r.$menu.find(".active").length===0&&(t.preventDefault(),r.$menu.parent().removeClass("open"),r.$button.focus()),f=n("[role=menu] li:not(.divider):not(.dropdown-header):visible",c),e.val()||/(38|40)/.test(t.keyCode.toString(10))||f.filter(".active").length===0&&(f=r.options.searchAccentInsensitive?r.$newElement.find("li").filter(":aicontains("+i(w[t.keyCode])+")"):r.$newElement.find("li").filter(":icontains("+w[t.keyCode]+")"))),f.length)&&(/(38|40)/.test(t.keyCode.toString(10))?(u=f.index(f.filter(":focus")),l=f.parent(":not(.disabled):visible").first().index(),a=f.parent(":not(.disabled):visible").last().index(),h=f.eq(u).parent().nextAll(":not(.disabled):visible").eq(0).index(),y=f.eq(u).parent().prevAll(":not(.disabled):visible").eq(0).index(),p=f.eq(h).parent().prevAll(":not(.disabled):visible").eq(0).index(),r.options.liveSearch&&(f.each(function(t){n(this).is(":not(.disabled)")&&n(this).data("index",t)}),u=f.index(f.filter(".active")),l=f.filter(":not(.disabled):visible").first().data("index"),a=f.filter(":not(.disabled):visible").last().data("index"),h=f.eq(u).nextAll(":not(.disabled):visible").eq(0).data("index"),y=f.eq(u).prevAll(":not(.disabled):visible").eq(0).data("index"),p=f.eq(h).prevAll(":not(.disabled):visible").eq(0).data("index")),b=e.data("prevIndex"),t.keyCode==38&&(r.options.liveSearch&&(u-=1),u!=p&&u>y&&(u=y),u<l&&(u=l),u==b&&(u=a)),t.keyCode==40&&(r.options.liveSearch&&(u+=1),u==-1&&(u=0),u!=p&&u<h&&(u=h),u>a&&(u=a),u==b&&(u=l)),e.data("prevIndex",u),r.options.liveSearch?(t.preventDefault(),e.is(".dropdown-toggle")||(f.removeClass("active"),f.eq(u).addClass("active").find("a").focus(),e.focus())):f.eq(u).focus()):e.is("input")||(v=[],f.each(function(){n(this).parent().is(":not(.disabled)")&&n.trim(n(this).text().toLowerCase()).substring(0,1)==w[t.keyCode]&&v.push(n(this).parent().index())}),o=n(document).data("keycount"),o++,n(document).data("keycount",o),k=n.trim(n(":focus").text().toLowerCase()).substring(0,1),k!=w[t.keyCode]?(o=1,n(document).data("keycount",o)):o>=v.length&&(n(document).data("keycount",0),o>v.length&&(o=1)),f.eq(v[o-1]).focus()),(/(13|32)/.test(t.keyCode.toString(10))||/(^9$)/.test(t.keyCode.toString(10))&&r.options.selectOnTab)&&s&&(/(32)/.test(t.keyCode.toString(10))||t.preventDefault(),r.options.liveSearch?/(32)/.test(t.keyCode.toString(10))||(r.$menu.find(".active a").click(),e.focus()):n(":focus").click(),n(document).data("keycount",0)),(/(^9$|27)/.test(t.keyCode.toString(10))&&s&&(r.multiple||r.options.liveSearch)||/(27)/.test(t.keyCode.toString(10))&&!s)&&(r.$menu.parent().removeClass("open"),r.$button.focus()))},mobile:function(){this.$element.addClass("mobile-device").appendTo(this.$newElement);this.options.container&&this.$menu.hide()},refresh:function(){this.$lis=null;this.reloadLi();this.render();this.setWidth();this.setStyle();this.checkDisabled();this.liHeight()},update:function(){this.reloadLi();this.setWidth();this.setStyle();this.checkDisabled();this.liHeight()},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove();this.$element.remove()}};e=n.fn.selectpicker;n.fn.selectpicker=f;n.fn.selectpicker.Constructor=t;n.fn.selectpicker.noConflict=function(){return n.fn.selectpicker=e,this};n(document).data("keycount",0).on("keydown",".bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=menu], .bs-searchbox input",t.prototype.keydown).on("focusin.modal",".bootstrap-select [data-toggle=dropdown], .bootstrap-select [role=menu], .bs-searchbox input",function(n){n.stopPropagation()});n(window).on("load.bs.select.data-api",function(){n(".selectpicker").each(function(){var t=n(this);f.call(t,t.data())})})})(jQuery);!function(n){"use strict";var t=function(t,i){this.options=i;this.$element=n(t);this.$container=n("<div/>",{"class":"ms-container"});this.$selectableContainer=n("<div/>",{"class":"ms-selectable"});this.$selectionContainer=n("<div/>",{"class":"ms-selection"});this.$selectableUl=n("<ul/>",{"class":"ms-list",tabindex:"-1"});this.$selectionUl=n("<ul/>",{"class":"ms-list",tabindex:"-1"});this.scrollTo=0;this.elemsSelector="li:visible:not(.ms-optgroup-label,.ms-optgroup-container,."+i.disabledClass+")"};t.prototype={constructor:t,init:function(){var t=this,i=this.$element,r,u;if(i.next(".ms-container").length===0){i.css({position:"absolute",left:"-9999px"});i.attr("id",i.attr("id")?i.attr("id"):Math.ceil(Math.random()*1e3)+"multiselect");this.$container.attr("id","ms-"+i.attr("id"));this.$container.addClass(t.options.cssClass);i.find("option").each(function(){t.generateLisFromOption(this)});this.$selectionUl.find(".ms-optgroup-label").hide();t.options.selectableHeader&&t.$selectableContainer.append(t.options.selectableHeader);t.$selectableContainer.append(t.$selectableUl);t.options.selectableFooter&&t.$selectableContainer.append(t.options.selectableFooter);t.options.selectionHeader&&t.$selectionContainer.append(t.options.selectionHeader);t.$selectionContainer.append(t.$selectionUl);t.options.selectionFooter&&t.$selectionContainer.append(t.options.selectionFooter);t.$container.append(t.$selectableContainer);t.$container.append(t.$selectionContainer);i.after(t.$container);t.activeMouse(t.$selectableUl);t.activeKeyboard(t.$selectableUl);r=t.options.dblClick?"dblclick":"click";t.$selectableUl.on(r,".ms-elem-selectable",function(){t.select(n(this).data("ms-value"))});t.$selectionUl.on(r,".ms-elem-selection",function(){t.deselect(n(this).data("ms-value"))});t.activeMouse(t.$selectionUl);t.activeKeyboard(t.$selectionUl);i.on("focus",function(){t.$selectableUl.focus()})}u=i.find("option:selected").map(function(){return n(this).val()}).get();t.select(u,"init");typeof t.options.afterInit=="function"&&t.options.afterInit.call(this,this.$container)},generateLisFromOption:function(t,i){for(var e,s,y,p,r=this,d=r.$element,w="",h=n(t),a=0;a<t.attributes.length;a++)e=t.attributes[a],e.name!=="value"&&e.name!=="disabled"&&(w+=e.name+'="'+e.value+'" ');var o=n("<li "+w+"><span>"+r.escapeHTML(h.text())+"<\/span><\/li>"),c=o.clone(),v=h.val(),b=r.sanitize(v);if(o.data("ms-value",v).addClass("ms-elem-selectable").attr("id",b+"-selectable"),c.data("ms-value",v).addClass("ms-elem-selection").attr("id",b+"-selection").hide(),(h.prop("disabled")||d.prop("disabled"))&&(c.addClass(r.options.disabledClass),o.addClass(r.options.disabledClass)),s=h.parent("optgroup"),s.length>0){var k=s.attr("label"),l=r.sanitize(k),u=r.$selectableUl.find("#optgroup-selectable-"+l),f=r.$selectionUl.find("#optgroup-selection-"+l);if(u.length===0){if(y='<li class="ms-optgroup-container"><\/li>',p='<ul class="ms-optgroup"><li class="ms-optgroup-label"><span>'+k+"<\/span><\/li><\/ul>",u=n(y),f=n(y),u.attr("id","optgroup-selectable-"+l),f.attr("id","optgroup-selection-"+l),u.append(n(p)),f.append(n(p)),r.options.selectableOptgroup){u.find(".ms-optgroup-label").on("click",function(){var t=s.children(":not(:selected, :disabled)").map(function(){return n(this).val()}).get();r.select(t)});f.find(".ms-optgroup-label").on("click",function(){var t=s.children(":selected:not(:disabled)").map(function(){return n(this).val()}).get();r.deselect(t)})}r.$selectableUl.append(u);r.$selectionUl.append(f)}i=i==undefined?u.find("ul").children().length:i+1;o.insertAt(i,u.children());c.insertAt(i,f.children())}else i=i==undefined?r.$selectableUl.children().length:i,o.insertAt(i,r.$selectableUl),c.insertAt(i,r.$selectionUl)},addOption:function(t){var i=this;t.value&&(t=[t]);n.each(t,function(t,r){if(r.value&&i.$element.find("option[value='"+r.value+"']").length===0){var u=n('<option value="'+r.value+'">'+r.text+"<\/option>"),t=parseInt(typeof r.index=="undefined"?i.$element.children().length:r.index),f=r.nested==undefined?i.$element:n("optgroup[label='"+r.nested+"']");u.insertAt(t,f);i.generateLisFromOption(u.get(0),t,r.nested)}})},escapeHTML:function(t){return n("<div>").text(t).html()},activeKeyboard:function(t){var i=this;t.on("focus",function(){n(this).addClass("ms-focus")}).on("blur",function(){n(this).removeClass("ms-focus")}).on("keydown",function(r){switch(r.which){case 40:case 38:r.preventDefault();r.stopPropagation();i.moveHighlight(n(this),r.which===38?-1:1);return;case 37:case 39:r.preventDefault();r.stopPropagation();i.switchList(t);return;case 9:if(i.$element.is("[tabindex]")){r.preventDefault();var u=parseInt(i.$element.attr("tabindex"),10);u=r.shiftKey?u-1:u+1;n('[tabindex="'+u+'"]').focus();return}r.shiftKey&&i.$element.trigger("focus")}if(n.inArray(r.which,i.options.keySelect)>-1){r.preventDefault();r.stopPropagation();i.selectHighlighted(t);return}})},moveHighlight:function(n,t){var r=n.find(this.elemsSelector),f=r.filter(".ms-hover"),i=null,c=r.first().outerHeight(),l=n.height(),a="#"+this.$container.prop("id"),o,u,e,s,h;r.removeClass("ms-hover");t===1?(i=f.nextAll(this.elemsSelector).first(),i.length===0&&(u=f.parent(),u.hasClass("ms-optgroup")?(e=u.parent(),o=e.next(":visible"),i=o.length>0?o.find(this.elemsSelector).first():r.first()):i=r.first())):t===-1&&(i=f.prevAll(this.elemsSelector).first(),i.length===0&&(u=f.parent(),u.hasClass("ms-optgroup")?(e=u.parent(),s=e.prev(":visible"),i=s.length>0?s.find(this.elemsSelector).last():r.last()):i=r.last()));i.length>0&&(i.addClass("ms-hover"),h=n.scrollTop()+i.position().top-l/2+c/2,n.scrollTop(h))},selectHighlighted:function(n){var i=n.find(this.elemsSelector),t=i.filter(".ms-hover").first();t.length>0&&(n.parent().hasClass("ms-selectable")?this.select(t.data("ms-value")):this.deselect(t.data("ms-value")),i.removeClass("ms-hover"))},switchList:function(n){n.blur();this.$container.find(this.elemsSelector).removeClass("ms-hover");n.parent().hasClass("ms-selectable")?this.$selectionUl.focus():this.$selectableUl.focus()},activeMouse:function(){var t=this;n("body").on("mouseenter",t.elemsSelector,function(){n(this).parents(".ms-container").find(t.elemsSelector).removeClass("ms-hover");n(this).addClass("ms-hover")});n("body").on("mouseleave",t.elemsSelector,function(){n(this).parents(".ms-container").find(t.elemsSelector).removeClass("ms-hover")})},refresh:function(){this.destroy();this.$element.multiSelect(this.options)},destroy:function(){n("#ms-"+this.$element.attr("id")).remove();this.$element.css("position","").css("left","");this.$element.removeData("multiselect")},select:function(t,i){var s,c,e;typeof t=="string"&&(t=[t]);var r=this,h=this.$element,u=n.map(t,function(n){return r.sanitize(n)}),o=this.$selectableUl.find("#"+u.join("-selectable, #")+"-selectable").filter(":not(."+r.options.disabledClass+")"),f=this.$selectionUl.find("#"+u.join("-selection, #")+"-selection").filter(":not(."+r.options.disabledClass+")"),l=h.find("option:not(:disabled)").filter(function(){return n.inArray(this.value,t)>-1});i==="init"&&(o=this.$selectableUl.find("#"+u.join("-selectable, #")+"-selectable"),f=this.$selectionUl.find("#"+u.join("-selection, #")+"-selection"));o.length>0&&(o.addClass("ms-selected").hide(),f.addClass("ms-selected").show(),l.prop("selected",!0),r.$container.find(r.elemsSelector).removeClass("ms-hover"),s=r.$selectableUl.children(".ms-optgroup-container"),s.length>0?(s.each(function(){var t=n(this).find(".ms-elem-selectable");t.length===t.filter(".ms-selected").length&&n(this).find(".ms-optgroup-label").hide()}),c=r.$selectionUl.children(".ms-optgroup-container"),c.each(function(){var t=n(this).find(".ms-elem-selection");t.filter(".ms-selected").length>0&&n(this).find(".ms-optgroup-label").show()})):r.options.keepOrder&&i!=="init"&&(e=r.$selectionUl.find(".ms-selected"),e.length>1&&e.last().get(0)!=f.get(0)&&f.insertAfter(e.last())),i!=="init"&&(h.trigger("change"),typeof r.options.afterSelect=="function"&&r.options.afterSelect.call(this,t)))},deselect:function(t){var r,o;typeof t=="string"&&(t=[t]);var i=this,u=this.$element,f=n.map(t,function(n){return i.sanitize(n)}),s=this.$selectableUl.find("#"+f.join("-selectable, #")+"-selectable"),e=this.$selectionUl.find("#"+f.join("-selection, #")+"-selection").filter(".ms-selected").filter(":not(."+i.options.disabledClass+")"),h=u.find("option").filter(function(){return n.inArray(this.value,t)>-1});e.length>0&&(s.removeClass("ms-selected").show(),e.removeClass("ms-selected").hide(),h.prop("selected",!1),i.$container.find(i.elemsSelector).removeClass("ms-hover"),r=i.$selectableUl.children(".ms-optgroup-container"),r.length>0&&(r.each(function(){var t=n(this).find(".ms-elem-selectable");t.filter(":not(.ms-selected)").length>0&&n(this).find(".ms-optgroup-label").show()}),o=i.$selectionUl.children(".ms-optgroup-container"),o.each(function(){var t=n(this).find(".ms-elem-selection");t.filter(".ms-selected").length===0&&n(this).find(".ms-optgroup-label").hide()})),u.trigger("change"),typeof i.options.afterDeselect=="function"&&i.options.afterDeselect.call(this,t))},select_all:function(){var t=this.$element,r=t.val(),i;t.find('option:not(":disabled")').prop("selected",!0);this.$selectableUl.find(".ms-elem-selectable").filter(":not(."+this.options.disabledClass+")").addClass("ms-selected").hide();this.$selectionUl.find(".ms-optgroup-label").show();this.$selectableUl.find(".ms-optgroup-label").hide();this.$selectionUl.find(".ms-elem-selection").filter(":not(."+this.options.disabledClass+")").addClass("ms-selected").show();this.$selectionUl.focus();t.trigger("change");typeof this.options.afterSelect=="function"&&(i=n.grep(t.val(),function(t){return n.inArray(t,r)<0}),this.options.afterSelect.call(this,i))},deselect_all:function(){var n=this.$element,t=n.val();n.find("option").prop("selected",!1);this.$selectableUl.find(".ms-elem-selectable").removeClass("ms-selected").show();this.$selectionUl.find(".ms-optgroup-label").hide();this.$selectableUl.find(".ms-optgroup-label").show();this.$selectionUl.find(".ms-elem-selection").removeClass("ms-selected").hide();this.$selectableUl.focus();n.trigger("change");typeof this.options.afterDeselect=="function"&&this.options.afterDeselect.call(this,t)},sanitize:function(n){var t=0,i,u,r;if(n.length==0)return t;for(r=0,i=0,r=n.length;i<r;i++)u=n.charCodeAt(i),t=(t<<5)-t+u|0;return t}};n.fn.multiSelect=function(){var i=arguments[0],r=arguments;return this.each(function(){var f=n(this),u=f.data("multiselect"),e=n.extend({},n.fn.multiSelect.defaults,f.data(),typeof i=="object"&&i);u||f.data("multiselect",u=new t(this,e));typeof i=="string"?u[i](r[1]):u.init()})};n.fn.multiSelect.defaults={keySelect:[32],selectableOptgroup:!1,disabledClass:"disabled",dblClick:!1,keepOrder:!1,cssClass:""};n.fn.multiSelect.Constructor=t;n.fn.insertAt=function(n,t){return this.each(function(){n===0?t.prepend(this):t.children().eq(n-1).after(this)})}}(window.jQuery);ComponentsDropdowns=function(){var n=function(){function n(n){return n.id?"<img class='flag' src='"+OpsydCoreJS.getGlobalImgPath()+"flags/"+n.id.toLowerCase()+".png'/>&nbsp;&nbsp;"+n.text:n.text}function t(n){var t="<table class='movie-result'><tr>";return n.posters!==undefined&&n.posters.thumbnail!==undefined&&(t+="<td valign='top'><img src='"+n.posters.thumbnail+"'/><\/td>"),t+="<td valign='top'><h5>"+n.title+"<\/h5>",n.critics_consensus!==undefined?t+="<div class='movie-synopsis'>"+n.critics_consensus+"<\/div>":n.synopsis!==undefined&&(t+="<div class='movie-synopsis'>"+n.synopsis+"<\/div>"),t+"<\/td><\/tr><\/table>"}function i(n){return n.title}$("#select2_sample1").select2({placeholder:"Select an option",allowClear:!0});$("#select2_sample2").select2({placeholder:"Select a State",allowClear:!0});$("#select2_sample3").select2({placeholder:"Select...",allowClear:!0,minimumInputLength:1,query:function(n){for(var u={results:[]},r,i,t=1;t<5;t++){for(i="",r=0;r<t;r++)i=i+n.term;u.results.push({id:n.term+t,text:i})}n.callback(u)}});$("#select2_sample4").select2({placeholder:"Select a Country",allowClear:!0,formatResult:n,formatSelection:n,escapeMarkup:function(n){return n}});$("#select2_sample5").select2({tags:["red","green","blue","yellow","pink"]});$("#select2_sample6").select2({placeholder:"Search for a movie",minimumInputLength:1,ajax:{url:"http://api.rottentomatoes.com/api/public/v1.0/movies.json",dataType:"jsonp",data:function(n){return{q:n,page_limit:10,apikey:"ju6z9mjyajq2djue3gbvv26t"}},results:function(n){return{results:n.movies}}},initSelection:function(n,t){var i=$(n).val();i!==""&&$.ajax("http://api.rottentomatoes.com/api/public/v1.0/movies/"+i+".json",{data:{apikey:"ju6z9mjyajq2djue3gbvv26t"},dataType:"jsonp"}).done(function(n){t(n)})},formatResult:t,formatSelection:i,dropdownCssClass:"bigdrop",escapeMarkup:function(n){return n}})},t=function(){function n(n){return n.id?"<img class='flag' src='"+OpsydCoreJS.getGlobalImgPath()+"flags/"+n.id.toLowerCase()+".png'/>&nbsp;&nbsp;"+n.text:n.text}function t(n){var t="<table class='movie-result'><tr>";return n.posters!==undefined&&n.posters.thumbnail!==undefined&&(t+="<td valign='top'><img src='"+n.posters.thumbnail+"'/><\/td>"),t+="<td valign='top'><h5>"+n.title+"<\/h5>",n.critics_consensus!==undefined?t+="<div class='movie-synopsis'>"+n.critics_consensus+"<\/div>":n.synopsis!==undefined&&(t+="<div class='movie-synopsis'>"+n.synopsis+"<\/div>"),t+"<\/td><\/tr><\/table>"}function i(n){return n.title}$("#select2_sample_modal_1").select2({placeholder:"Select an option",allowClear:!0});$("#select2_sample_modal_2").select2({placeholder:"Select a State",allowClear:!0});$("#select2_sample_modal_3").select2({allowClear:!0,minimumInputLength:1,query:function(n){for(var u={results:[]},r,i,t=1;t<5;t++){for(i="",r=0;r<t;r++)i=i+n.term;u.results.push({id:n.term+t,text:i})}n.callback(u)}});$("#select2_sample_modal_4").select2({allowClear:!0,formatResult:n,formatSelection:n,escapeMarkup:function(n){return n}});$("#select2_sample_modal_5").select2({tags:["red","green","blue","yellow","pink"]});$("#select2_sample_modal_6").select2({placeholder:"Search for a movie",minimumInputLength:1,ajax:{url:"http://api.rottentomatoes.com/api/public/v1.0/movies.json",dataType:"jsonp",data:function(n){return{q:n,page_limit:10,apikey:"ju6z9mjyajq2djue3gbvv26t"}},results:function(n){return{results:n.movies}}},initSelection:function(n,t){var i=$(n).val();i!==""&&$.ajax("http://api.rottentomatoes.com/api/public/v1.0/movies/"+i+".json",{data:{apikey:"ju6z9mjyajq2djue3gbvv26t"},dataType:"jsonp"}).done(function(n){t(n)})},formatResult:t,formatSelection:i,dropdownCssClass:"bigdrop",escapeMarkup:function(n){return n}})},i=function(){$(".bs-select").selectpicker({iconBase:"fa",tickIcon:"fa-check"})},r=function(){$("#my_multi_select1").multiSelect();$("#my_multi_select2").multiSelect({selectableOptgroup:!0})};return{init:function(){n();t();r();i()}}}(),function(n,t,i,r){function c(t,i){this.element=n(t);this.settings=n.extend({},l,i);this._defaults=l;this._name=e;this.init()}function o(n){n.element.trigger("change")}function v(t){t.element.find("option").each(function(i,r){var u=n(r);typeof u.data("original-index")=="undefined"&&u.data("original-index",t.elementCount++);typeof u.data("_selected")=="undefined"&&u.data("_selected",!1)})}function y(t,i,r){t.element.find("option").each(function(t,u){var f=n(u);f.data("original-index")===i&&f.prop("selected",r)})}function s(n,t){return n.replace(/\{(\d+)\}/g,function(n,i){return typeof t[i]!="undefined"?t[i]:n})}function p(n){if(n.settings.infoText){var r=n.elements.select1.find("option").length,u=n.elements.select2.find("option").length,t=n.element.find("option").length-n.selectedElements,i=n.selectedElements,f="";f=t===0?n.settings.infoTextEmpty:r===t?s(n.settings.infoText,[r,t]):s(n.settings.infoTextFiltered,[r,t]);n.elements.info1.html(f);n.elements.box1.toggleClass("filtered",!(r===t||t===0));f=i===0?n.settings.infoTextEmpty:u===i?s(n.settings.infoText,[u,i]):s(n.settings.infoTextFiltered,[u,i]);n.elements.info2.html(f);n.elements.box2.toggleClass("filtered",!(u===i||i===0))}}function u(t){t.selectedElements=0;t.elements.select1.empty();t.elements.select2.empty();t.element.find("option").each(function(i,r){var u=n(r);u.prop("selected")?(t.selectedElements++,t.elements.select2.append(u.clone(!0).prop("selected",u.data("_selected")))):t.elements.select1.append(u.clone(!0).prop("selected",u.data("_selected")))});t.settings.showFilterInputs&&(h(t,1),h(t,2));p(t)}function h(t,i){if(t.settings.showFilterInputs){f(t,i);t.elements["select"+i].empty().scrollTop(0);var u=new RegExp(n.trim(t.elements["filterInput"+i].val()),"gi"),r=t.element;r=i===1?r.find("option").not(":selected"):r.find("option:selected");r.each(function(r,f){var e=n(f),o=!0;(f.text.match(u)||t.settings.filterOnValues&&e.attr("value").match(u))&&(o=!1,t.elements["select"+i].append(e.clone(!0).prop("selected",e.data("_selected"))));t.element.find("option").eq(e.data("original-index")).data("filtered"+i,o)});p(t)}}function f(t,i){t.elements["select"+i].find("option").each(function(i,r){var u=n(r);t.element.find("option").eq(u.data("original-index")).data("_selected",u.prop("selected"))})}function w(t){t.find("option").sort(function(t,i){return n(t).data("original-index")>n(i).data("original-index")?1:-1}).appendTo(t)}function d(n){n.elements.select1.find("option").each(function(){n.element.find("option").data("_selected",!1)})}function b(t){t.settings.preserveSelectionOnMove!=="all"||t.settings.moveOnSelect?t.settings.preserveSelectionOnMove!=="moved"||t.settings.moveOnSelect||f(t,1):(f(t,1),f(t,2));t.elements.select1.find("option:selected").each(function(i,r){var u=n(r);u.data("filtered1")||y(t,u.data("original-index"),!0)});u(t);o(t);w(t.elements.select2)}function k(t){t.settings.preserveSelectionOnMove!=="all"||t.settings.moveOnSelect?t.settings.preserveSelectionOnMove!=="moved"||t.settings.moveOnSelect||f(t,2):(f(t,1),f(t,2));t.elements.select2.find("option:selected").each(function(i,r){var u=n(r);u.data("filtered2")||y(t,u.data("original-index"),!1)});u(t);o(t);w(t.elements.select1)}function g(t){t.settings.preserveSelectionOnMove!=="all"||t.settings.moveOnSelect?t.settings.preserveSelectionOnMove!=="moved"||t.settings.moveOnSelect||f(t,1):(f(t,1),f(t,2));t.element.find("option").each(function(t,i){var r=n(i);r.data("filtered1")||r.prop("selected",!0)});u(t);o(t)}function nt(t){t.settings.preserveSelectionOnMove!=="all"||t.settings.moveOnSelect?t.settings.preserveSelectionOnMove!=="moved"||t.settings.moveOnSelect||f(t,2):(f(t,1),f(t,2));t.element.find("option").each(function(t,i){var r=n(i);r.data("filtered2")||r.prop("selected",!1)});u(t);o(t)}function tt(n){n.elements.form.submit(function(t){n.elements.filterInput1.is(":focus")?(t.preventDefault(),n.elements.filterInput1.focusout()):n.elements.filterInput2.is(":focus")&&(t.preventDefault(),n.elements.filterInput2.focusout())});n.element.on("bootstrapDualListbox.refresh",function(t,i){n.refresh(i)});n.elements.filterClear1.on("click",function(){n.setNonSelectedFilter("",!0)});n.elements.filterClear2.on("click",function(){n.setSelectedFilter("",!0)});n.elements.moveButton.on("click",function(){b(n)});n.elements.moveAllButton.on("click",function(){g(n)});n.elements.removeButton.on("click",function(){k(n)});n.elements.removeAllButton.on("click",function(){nt(n)});n.elements.filterInput1.on("change keyup",function(){h(n,1)});n.elements.filterInput2.on("change keyup",function(){h(n,2)})}var e="bootstrapDualListbox",l={bootstrap2Compatible:!1,filterTextClear:"show all",filterPlaceHolder:"Filter",moveSelectedLabel:"Move selected",moveAllLabel:"Move all",removeSelectedLabel:"Remove selected",removeAllLabel:"Remove all",moveOnSelect:!0,preserveSelectionOnMove:!1,selectedListLabel:!1,nonSelectedListLabel:!1,helperSelectNamePostfix:"_helper",selectorMinimalHeight:100,showFilterInputs:!0,nonSelectedFilter:"",selectedFilter:"",infoText:"Showing all {0}",infoTextFiltered:'<span class="label label-warning">Filtered<\/span> {0} from {1}',infoTextEmpty:"Empty list",filterOnValues:!1},a=/android/i.test(navigator.userAgent.toLowerCase());c.prototype={init:function(){this.container=n('<div class="bootstrap-duallistbox-container"> <div class="box1">   <label><\/label>   <span class="info-container">     <span class="info"><\/span>     <button type="button" class="btn clear1 pull-right"><\/button>   <\/span>   <input class="filter" type="text">   <div class="btn-group buttons">     <button type="button" class="btn moveall">       <i><\/i>       <i><\/i>     <\/button>     <button type="button" class="btn move">       <i><\/i>     <\/button>   <\/div>   <select multiple="multiple"><\/select> <\/div> <div class="box2">   <label><\/label>   <span class="info-container">     <span class="info"><\/span>     <button type="button" class="btn clear2 pull-right"><\/button>   <\/span>   <input class="filter" type="text">   <div class="btn-group buttons">     <button type="button" class="btn remove">       <i><\/i>     <\/button>     <button type="button" class="btn removeall">       <i><\/i>       <i><\/i>     <\/button>   <\/div>   <select multiple="multiple"><\/select> <\/div><\/div>').insertBefore(this.element);this.elements={originalSelect:this.element,box1:n(".box1",this.container),box2:n(".box2",this.container),filterInput1:n(".box1 .filter",this.container),filterInput2:n(".box2 .filter",this.container),filterClear1:n(".box1 .clear1",this.container),filterClear2:n(".box2 .clear2",this.container),label1:n(".box1 > label",this.container),label2:n(".box2 > label",this.container),info1:n(".box1 .info",this.container),info2:n(".box2 .info",this.container),select1:n(".box1 select",this.container),select2:n(".box2 select",this.container),moveButton:n(".box1 .move",this.container),removeButton:n(".box2 .remove",this.container),moveAllButton:n(".box1 .moveall",this.container),removeAllButton:n(".box2 .removeall",this.container),form:n(n(".box1 .filter",this.container)[0].form)};this.originalSelectName=this.element.attr("name")||"";var t="bootstrap-duallistbox-nonselected-list_"+this.originalSelectName,i="bootstrap-duallistbox-selected-list_"+this.originalSelectName;return this.elements.select1.attr("id",t),this.elements.select2.attr("id",i),this.elements.label1.attr("for",t),this.elements.label2.attr("for",i),this.selectedElements=0,this.elementCount=0,this.setBootstrap2Compatible(this.settings.bootstrap2Compatible),this.setFilterTextClear(this.settings.filterTextClear),this.setFilterPlaceHolder(this.settings.filterPlaceHolder),this.setMoveSelectedLabel(this.settings.moveSelectedLabel),this.setMoveAllLabel(this.settings.moveAllLabel),this.setRemoveSelectedLabel(this.settings.removeSelectedLabel),this.setRemoveAllLabel(this.settings.removeAllLabel),this.setMoveOnSelect(this.settings.moveOnSelect),this.setPreserveSelectionOnMove(this.settings.preserveSelectionOnMove),this.setSelectedListLabel(this.settings.selectedListLabel),this.setNonSelectedListLabel(this.settings.nonSelectedListLabel),this.setHelperSelectNamePostfix(this.settings.helperSelectNamePostfix),this.setSelectOrMinimalHeight(this.settings.selectorMinimalHeight),v(this),this.setShowFilterInputs(this.settings.showFilterInputs),this.setNonSelectedFilter(this.settings.nonSelectedFilter),this.setSelectedFilter(this.settings.selectedFilter),this.setInfoText(this.settings.infoText),this.setInfoTextFiltered(this.settings.infoTextFiltered),this.setInfoTextEmpty(this.settings.infoTextEmpty),this.setFilterOnValues(this.settings.filterOnValues),this.element.hide(),tt(this),u(this),this.element},setBootstrap2Compatible:function(n,t){return this.settings.bootstrap2Compatible=n,n?(this.container.removeClass("row").addClass("row-fluid bs2compatible"),this.container.find(".box1, .box2").removeClass("col-md-6").addClass("span6"),this.container.find(".clear1, .clear2").removeClass("btn-default btn-xs").addClass("btn-mini"),this.container.find("input, select").removeClass("form-control"),this.container.find(".btn").removeClass("btn-default"),this.container.find(".moveall > i, .move > i").removeClass("glyphicon glyphicon-arrow-right").addClass("icon-arrow-right"),this.container.find(".removeall > i, .remove > i").removeClass("glyphicon glyphicon-arrow-left").addClass("icon-arrow-left")):(this.container.removeClass("row-fluid bs2compatible").addClass("row"),this.container.find(".box1, .box2").removeClass("span6").addClass("col-md-6"),this.container.find(".clear1, .clear2").removeClass("btn-mini").addClass("btn-default btn-xs"),this.container.find("input, select").addClass("form-control"),this.container.find(".btn").addClass("btn-default"),this.container.find(".moveall > i, .move > i").removeClass("icon-arrow-right").addClass("glyphicon glyphicon-arrow-right"),this.container.find(".removeall > i, .remove > i").removeClass("icon-arrow-left").addClass("glyphicon glyphicon-arrow-left")),t&&u(this),this.element},setFilterTextClear:function(n,t){return this.settings.filterTextClear=n,this.elements.filterClear1.html(n),this.elements.filterClear2.html(n),t&&u(this),this.element},setFilterPlaceHolder:function(n,t){return this.settings.filterPlaceHolder=n,this.elements.filterInput1.attr("placeholder",n),this.elements.filterInput2.attr("placeholder",n),t&&u(this),this.element},setMoveSelectedLabel:function(n,t){return this.settings.moveSelectedLabel=n,this.elements.moveButton.attr("title",n),t&&u(this),this.element},setMoveAllLabel:function(n,t){return this.settings.moveAllLabel=n,this.elements.moveAllButton.attr("title",n),t&&u(this),this.element},setRemoveSelectedLabel:function(n,t){return this.settings.removeSelectedLabel=n,this.elements.removeButton.attr("title",n),t&&u(this),this.element},setRemoveAllLabel:function(n,t){return this.settings.removeAllLabel=n,this.elements.removeAllButton.attr("title",n),t&&u(this),this.element},setMoveOnSelect:function(n,t){if(a&&(n=!0),this.settings.moveOnSelect=n,this.settings.moveOnSelect){this.container.addClass("moveonselect");var i=this;this.elements.select1.on("change",function(){b(i)});this.elements.select2.on("change",function(){k(i)})}else this.container.removeClass("moveonselect"),this.elements.select1.off("change"),this.elements.select2.off("change");return t&&u(this),this.element},setPreserveSelectionOnMove:function(n,t){return a&&(n=!1),this.settings.preserveSelectionOnMove=n,t&&u(this),this.element},setSelectedListLabel:function(n,t){return this.settings.selectedListLabel=n,n?this.elements.label2.show().html(n):this.elements.label2.hide().html(n),t&&u(this),this.element},setNonSelectedListLabel:function(n,t){return this.settings.nonSelectedListLabel=n,n?this.elements.label1.show().html(n):this.elements.label1.hide().html(n),t&&u(this),this.element},setHelperSelectNamePostfix:function(n,t){return this.settings.helperSelectNamePostfix=n,n?(this.elements.select1.attr("name",this.originalSelectName+n+"1"),this.elements.select2.attr("name",this.originalSelectName+n+"2")):(this.elements.select1.removeAttr("name"),this.elements.select2.removeAttr("name")),t&&u(this),this.element},setSelectOrMinimalHeight:function(n,t){this.settings.selectorMinimalHeight=n;var i=this.element.height();return this.element.height()<n&&(i=n),this.elements.select1.height(i),this.elements.select2.height(i),t&&u(this),this.element},setShowFilterInputs:function(n,t){return n?(this.elements.filterInput1.show(),this.elements.filterInput2.show()):(this.setNonSelectedFilter(""),this.setSelectedFilter(""),u(this),this.elements.filterInput1.hide(),this.elements.filterInput2.hide()),this.settings.showFilterInputs=n,t&&u(this),this.element},setNonSelectedFilter:function(n,t){if(this.settings.showFilterInputs)return this.settings.nonSelectedFilter=n,this.elements.filterInput1.val(n),t&&u(this),this.element},setSelectedFilter:function(n,t){if(this.settings.showFilterInputs)return this.settings.selectedFilter=n,this.elements.filterInput2.val(n),t&&u(this),this.element},setInfoText:function(n,t){return this.settings.infoText=n,t&&u(this),this.element},setInfoTextFiltered:function(n,t){return this.settings.infoTextFiltered=n,t&&u(this),this.element},setInfoTextEmpty:function(n,t){return this.settings.infoTextEmpty=n,t&&u(this),this.element},setFilterOnValues:function(n,t){return this.settings.filterOnValues=n,t&&u(this),this.element},getContainer:function(){return this.container},refresh:function(n){v(this);n?d(this):(f(this,1),f(this,2));u(this)},destroy:function(){return this.container.remove(),this.element.show(),n.data(this,"plugin_"+e,null),this.element}};n.fn[e]=function(t){var u=arguments,i;return t===r||typeof t=="object"?this.each(function(){n(this).is("select")?n.data(this,"plugin_"+e)||n.data(this,"plugin_"+e,new c(this,t)):n(this).find("select").each(function(i,r){n(r).bootstrapDualListbox(t)})}):typeof t=="string"&&t[0]!=="_"&&t!=="init"?(this.each(function(){var r=n.data(this,"plugin_"+e);r instanceof c&&typeof r[t]=="function"&&(i=r[t].apply(r,Array.prototype.slice.call(u,1)))}),i!==r?i:this):void 0}}(jQuery,window,document);OpsydCoreJS=function(){var r=!1,n=!1,t=!1,u=!1,f=[],i="assets/",h="images/",c="",nt="css/",l={blue:"#89C4F4",red:"#F3565D",green:"#1bbc9b",purple:"#9b59b6",grey:"#95a5a6",yellow:"#F8CB00"},tt=function(){$("body").css("direction")==="rtl"&&(r=!0);n=!!navigator.userAgent.match(/MSIE 8.0/);t=!!navigator.userAgent.match(/MSIE 9.0/);u=!!navigator.userAgent.match(/MSIE 10.0/);u&&$("html").addClass("ie10");(u||t||n)&&$("html").addClass("ie")},e=function(){for(var t,n=0;n<f.length;n++)t=f[n],t.call()},it=function(){var t,i;n?$(window).resize(function(){i!=document.documentElement.clientHeight&&(t&&clearTimeout(t),t=setTimeout(function(){e()},50),i=document.documentElement.clientHeight)}):$(window).resize(function(){t&&clearTimeout(t);t=setTimeout(function(){e()},50)})},rt=function(){$("body").on("click",".portlet > .portlet-title > .tools > a.remove",function(n){n.preventDefault();var t=$(this).closest(".portlet");$("body").hasClass("page-portlet-fullscreen")&&$("body").removeClass("page-portlet-fullscreen");t.find(".portlet-title .fullscreen").tooltip("destroy");t.find(".portlet-title > .tools > .reload").tooltip("destroy");t.find(".portlet-title > .tools > .remove").tooltip("destroy");t.find(".portlet-title > .tools > .config").tooltip("destroy");t.find(".portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand").tooltip("destroy");t.remove()});$("body").on("click",".portlet > .portlet-title .fullscreen",function(n){var t,i;n.preventDefault();t=$(this).closest(".portlet");t.hasClass("portlet-fullscreen")?($(this).removeClass("on"),t.removeClass("portlet-fullscreen"),$("body").removeClass("page-portlet-fullscreen"),t.children(".portlet-body").css("height","auto")):(i=OpsydCoreJS.getViewPort().height-t.children(".portlet-title").outerHeight()-parseInt(t.children(".portlet-body").css("padding-top"))-parseInt(t.children(".portlet-body").css("padding-bottom")),$(this).addClass("on"),t.addClass("portlet-fullscreen"),$("body").addClass("page-portlet-fullscreen"),t.children(".portlet-body").css("height",i))});$("body").on("click",".portlet > .portlet-title > .tools > a.reload",function(n){n.preventDefault();var t=$(this).closest(".portlet").children(".portlet-body"),i=$(this).attr("data-url"),r=$(this).attr("data-error-display");i?(OpsydCoreJS.blockUI({target:t,animate:!0,overlayColor:"none"}),$.ajax({type:"GET",cache:!1,url:i,dataType:"html",success:function(n){OpsydCoreJS.unblockUI(t);t.html(n)},error:function(){OpsydCoreJS.unblockUI(t);var n="Error on reloading the content. Please check your connection and try again.";r=="toastr"&&toastr?toastr.error(n):r=="notific8"&&$.notific8?($.notific8("zindex",11500),$.notific8(n,{theme:"ruby",life:3e3})):alert(n)}})):(OpsydCoreJS.blockUI({target:t,animate:!0,overlayColor:"none"}),window.setTimeout(function(){OpsydCoreJS.unblockUI(t)},1e3))});$('.portlet .portlet-title a.reload[data-load="true"]').click();$("body").on("click",".portlet > .portlet-title > .tools > .collapse, .portlet .portlet-title > .tools > .expand",function(n){n.preventDefault();var t=$(this).closest(".portlet").children(".portlet-body");$(this).hasClass("collapse")?($(this).removeClass("collapse").addClass("expand"),t.slideUp(200)):($(this).removeClass("expand").addClass("collapse"),t.slideDown(200))})},ut=function(){if($().uniform){var n=$("input[type=checkbox]:not(.toggle, .make-switch, .icheck), input[type=radio]:not(.toggle, .star, .make-switch, .icheck)");n.size()>0&&n.each(function(){$(this).parents(".checker").size()===0&&($(this).show(),$(this).uniform())})}},a=function(){$().iCheck&&$(".icheck").each(function(){var n=$(this).attr("data-checkbox")?$(this).attr("data-checkbox"):"icheckbox_minimal-grey",t=$(this).attr("data-radio")?$(this).attr("data-radio"):"iradio_minimal-grey";n.indexOf("_line")>-1||t.indexOf("_line")>-1?$(this).iCheck({checkboxClass:n,radioClass:t,insert:'<div class="icheck_line-icon"><\/div>'+$(this).attr("data-label")}):$(this).iCheck({checkboxClass:n,radioClass:t})})},v=function(){$().bootstrapSwitch&&$(".make-switch").bootstrapSwitch()},y=function(){$().confirmation&&$("[data-toggle=confirmation]").confirmation({container:"body",btnOkClass:"btn-xs btn-success",btnCancelClass:"btn-xs btn-danger"})},p=function(){$("body").on("shown.bs.collapse",".accordion.scrollable",function(n){OpsydCoreJS.scrollTo($(n.target))})},ft=function(){if(location.hash){var n=location.hash.substr(1);$('a[href="#'+n+'"]').parents(".tab-pane:hidden").each(function(){var n=$(this).attr("id");$('a[href="#'+n+'"]').click()});$('a[href="#'+n+'"]').click()}},et=function(){$("body").on("hide.bs.modal",function(){$(".modal:visible").size()>1&&$("html").hasClass("modal-open")===!1?$("html").addClass("modal-open"):$(".modal:visible").size()<=1&&$("html").removeClass("modal-open")});$("body").on("show.bs.modal",".modal",function(){$(this).hasClass("modal-scroll")&&$("body").addClass("modal-open-noscroll")});$("body").on("hide.bs.modal",".modal",function(){$("body").removeClass("modal-open-noscroll")});$("body").on("hidden.bs.modal",".modal:not(.modal-cached)",function(){$(this).removeData("bs.modal")})},w=function(){$(".tooltips").tooltip();$(".portlet > .portlet-title .fullscreen").tooltip({container:"body",title:"Fullscreen"});$(".portlet > .portlet-title > .tools > .reload").tooltip({container:"body",title:"Reload"});$(".portlet > .portlet-title > .tools > .remove").tooltip({container:"body",title:"Remove"});$(".portlet > .portlet-title > .tools > .config").tooltip({container:"body",title:"Settings"});$(".portlet > .portlet-title > .tools > .collapse, .portlet > .portlet-title > .tools > .expand").tooltip({container:"body",title:"Collapse/Expand"})},b=function(){$("body").on("click",".dropdown-menu.hold-on-click",function(n){n.stopPropagation()})},ot=function(){$("body").on("click",'[data-close="alert"]',function(n){$(this).parent(".alert").hide();$(this).closest(".note").hide();n.preventDefault()});$("body").on("click",'[data-close="note"]',function(n){$(this).closest(".note").hide();n.preventDefault()});$("body").on("click",'[data-remove="note"]',function(n){$(this).closest(".note").remove();n.preventDefault()})},st=function(){$('[data-hover="dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover();$(this).addClass("hover-initialized")})},o,k=function(){$(".popovers").popover();$(document).on("click.bs.popover.data-api",function(){o&&o.popover("hide")})},d=function(){OpsydCoreJS.initSlimScroll(".scroller")},s=function(){jQuery.fancybox&&$(".fancybox-button").size()>0&&$(".fancybox-button").fancybox({groupAttr:"data-rel",prevEffect:"none",nextEffect:"none",closeBtn:!0,helpers:{title:{type:"inside"}}})},ht=function(){(n||t)&&$("input[placeholder]:not(.placeholder-no-fix), textarea[placeholder]:not(.placeholder-no-fix)").each(function(){var n=$(this);n.val()===""&&n.attr("placeholder")!==""&&n.addClass("placeholder").val(n.attr("placeholder"));n.focus(function(){n.val()==n.attr("placeholder")&&n.val("")});n.blur(function(){(n.val()===""||n.val()==n.attr("placeholder"))&&n.val(n.attr("placeholder"))})})},g=function(){$().select2&&$(".select2me").select2({placeholder:"Select",allowClear:!0})};return{init:function(){tt();it();a();v();d();s();g();rt();ot();b();ft();w();k();p();et();y();ht()},initAjax:function(){a();v();st();d();g();s();b();w();k();p();y()},initComponents:function(){this.initAjax()},setLastPopedPopover:function(n){o=n},addResizeHandler:function(n){f.push(n)},runResizeHandlers:function(){e()},scrollTo:function(n,t){var i=n&&n.size()>0?n.offset().top:0;n&&($("body").hasClass("page-header-fixed")&&(i=i-$(".page-header").height()),i=i+(t?t:-1*n.height()));$("html,body").animate({scrollTop:i},"slow")},initSlimScroll:function(n){$(n).each(function(){if(!$(this).attr("data-initialized")){var n;n=$(this).attr("data-height")?$(this).attr("data-height"):$(this).css("height");$(this).slimScroll({allowPageScroll:!0,size:"7px",color:$(this).attr("data-handle-color")?$(this).attr("data-handle-color"):"#bbb",wrapperClass:$(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv",railColor:$(this).attr("data-rail-color")?$(this).attr("data-rail-color"):"#eaeaea",position:r?"left":"right",height:n,alwaysVisible:$(this).attr("data-always-visible")=="1"?!0:!1,railVisible:$(this).attr("data-rail-visible")=="1"?!0:!1,disableFadeOut:!0});$(this).attr("data-initialized","1")}})},destroySlimScroll:function(n){$(n).each(function(){var n,t;$(this).attr("data-initialized")==="1"&&($(this).removeAttr("data-initialized"),$(this).removeAttr("style"),n={},$(this).attr("data-handle-color")&&(n["data-handle-color"]=$(this).attr("data-handle-color")),$(this).attr("data-wrapper-class")&&(n["data-wrapper-class"]=$(this).attr("data-wrapper-class")),$(this).attr("data-rail-color")&&(n["data-rail-color"]=$(this).attr("data-rail-color")),$(this).attr("data-always-visible")&&(n["data-always-visible"]=$(this).attr("data-always-visible")),$(this).attr("data-rail-visible")&&(n["data-rail-visible"]=$(this).attr("data-rail-visible")),$(this).slimScroll({wrapperClass:$(this).attr("data-wrapper-class")?$(this).attr("data-wrapper-class"):"slimScrollDiv",destroy:!0}),t=$(this),$.each(n,function(n,i){t.attr(n,i)}))})},scrollTop:function(){OpsydCoreJS.scrollTo()},blockUI:function(n){var t,i;n=$.extend(!0,{},n);t="";t=n.animate?'<div class="loading-message '+(n.boxed?"loading-message-boxed":"")+'"><div class="block-spinner-bar"><div class="bounce1"><\/div><div class="bounce2"><\/div><div class="bounce3"><\/div><\/div><\/div>':n.iconOnly?'<div class="loading-message '+(n.boxed?"loading-message-boxed":"")+'"><img src="'+this.getGlobalImgPath()+'loading-spinner-grey.gif" align=""><\/div>':n.textOnly?'<div class="loading-message '+(n.boxed?"loading-message-boxed":"")+'"><span>&nbsp;&nbsp;'+(n.message?n.message:"LOADING...")+"<\/span><\/div>":'<div class="loading-message '+(n.boxed?"loading-message-boxed":"")+'"><img src="'+this.getGlobalImgPath()+'loading-spinner-grey.gif" align=""><span>&nbsp;&nbsp;'+(n.message?n.message:"LOADING...")+"<\/span><\/div>";n.target?(i=$(n.target),i.height()<=$(window).height()&&(n.cenrerY=!0),i.block({message:t,baseZ:n.zIndex?n.zIndex:1e3,centerY:n.cenrerY!==undefined?n.cenrerY:!1,css:{top:"10%",border:"0",padding:"0",backgroundColor:"none"},overlayCSS:{backgroundColor:n.overlayColor?n.overlayColor:"#555",opacity:n.boxed?.05:.1,cursor:"wait"}})):$.blockUI({message:t,baseZ:n.zIndex?n.zIndex:1e3,css:{border:"0",padding:"0",backgroundColor:"none"},overlayCSS:{backgroundColor:n.overlayColor?n.overlayColor:"#555",opacity:n.boxed?.05:.1,cursor:"wait"}})},unblockUI:function(n){n?$(n).unblock({onUnblock:function(){$(n).css("position","");$(n).css("zoom","")}}):$.unblockUI()},startPageLoading:function(n){n&&n.animate?($(".page-spinner-bar").remove(),$("body").append('<div class="page-spinner-bar"><div class="bounce1"><\/div><div class="bounce2"><\/div><div class="bounce3"><\/div><\/div>')):($(".page-loading").remove(),$("body").append('<div class="page-loading"><img src="'+this.getGlobalImgPath()+'loading-spinner-grey.gif"/>&nbsp;&nbsp;<span>'+(n&&n.message?n.message:"Loading...")+"<\/span><\/div>"))},stopPageLoading:function(){$(".page-loading, .page-spinner-bar").remove()},alert:function(n){n=$.extend(!0,{container:"",place:"append",type:"success",message:"",close:!0,reset:!0,focus:!0,closeInSeconds:0,icon:""},n);var i=OpsydCoreJS.getUniqueID("Opsyd_alert"),t='<div id="'+i+'" class="Opsyd-alerts alert alert-'+n.type+' fade in">'+(n.close?'<button type="button" class="close" data-dismiss="alert" aria-hidden="true"><\/button>':"")+(n.icon!==""?'<i class="fa-lg fa fa-'+n.icon+'"><\/i>  ':"")+n.message+"<\/div>";return n.reset&&$(".Opsyd-alerts").remove(),n.container?n.place=="append"?$(n.container).append(t):$(n.container).prepend(t):$("body").hasClass("page-container-bg-solid")?$(".page-title").after(t):$(".page-bar").size()>0?$(".page-bar").after(t):$(".page-breadcrumb").after(t),n.focus&&OpsydCoreJS.scrollTo($("#"+i)),n.closeInSeconds>0&&setTimeout(function(){$("#"+i).remove()},n.closeInSeconds*1e3),i},initUniform:function(n){n?$(n).each(function(){$(this).parents(".checker").size()===0&&($(this).show(),$(this).uniform())}):ut()},updateUniform:function(n){$.uniform.update(n)},initFancybox:function(){s()},getActualVal:function(n){return(n=$(n),n.val()===n.attr("placeholder"))?"":n.val()},getURLParameter:function(n){for(var u=window.location.search.substring(1),i,r=u.split("&"),t=0;t<r.length;t++)if(i=r[t].split("="),i[0]==n)return unescape(i[1]);return null},isTouchDevice:function(){try{return document.createEvent("TouchEvent"),!0}catch(n){return!1}},getViewPort:function(){var n=window,t="inner";return"innerWidth"in window||(t="client",n=document.documentElement||document.body),{width:n[t+"Width"],height:n[t+"Height"]}},getUniqueID:function(){return"prefix_"+Math.floor(Math.random()*(new Date).getTime())},isIE8:function(){return n},isIE9:function(){return t},isRTL:function(){return r},isAngularJsApp:function(){return typeof angular=="undefined"?!1:!0},getAssetsPath:function(){return i},setAssetsPath:function(n){i=n},setGlobalImgPath:function(n){h=n},getGlobalImgPath:function(){return"../Content/themes/"+h},setGlobalPluginsPath:function(n){c=n},getGlobalPluginsPath:function(){return i+c},getGlobalCssPath:function(){return i+nt},getBrandColor:function(n){return l[n]?l[n]:""},getResponsiveBreakpoint:function(n){var t={xs:480,sm:768,md:992,lg:1200};return t[n]?t[n]:0}}}();Layout=function(){var i="Content/themes/images/",r="Content/themes/css/",n=OpsydCoreJS.getResponsiveBreakpoint("md"),u=function(){$(".page-header").on("click",".search-form",function(){$(this).addClass("open");$(this).find(".form-control").focus();$(".page-header .search-form .form-control").on("blur",function(){$(this).closest(".search-form").removeClass("open");$(this).unbind("blur")})});$(".page-header").on("keypress",".hor-menu .search-form .form-control",function(n){if(n.which==13)return $(this).closest(".search-form").submit(),!1});$(".page-header").on("mousedown",".search-form.open .submit",function(n){n.preventDefault();n.stopPropagation();$(this).closest(".search-form").submit()});$("body").on("click",".page-header-top-fixed .page-header-top .menu-toggler",function(){OpsydCoreJS.scrollTop()})},f=function(){OpsydCoreJS.getViewPort().width>=550?$(".top-menu").css("display","block"):$(".top-menu").css("display","none");$(".page-header .menu-toggler").on("click",function(){if(OpsydCoreJS.getViewPort().width<n){var t=$(".page-header .page-header-menu");t.is(":visible")?t.slideUp(300):t.slideDown(300);$("body").hasClass("page-header-top-fixed")&&OpsydCoreJS.scrollTop()}});$(".hor-menu .dropdown-submenu > a").on("click",function(t){OpsydCoreJS.getViewPort().width<n&&$(this).next().hasClass("dropdown-menu")&&(t.stopPropagation(),$(this).parent().hasClass("open")?($(this).parent().removeClass("open"),$(this).next().hide()):($(this).parent().addClass("open"),$(this).next().show()))});OpsydCoreJS.getViewPort().width>=n&&$('.hor-menu [data-hover="megamenu-dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover();$(this).addClass("hover-initialized")});$(document).on("click",'.hor-menu .menu-dropdown > a[data-hover="megamenu-dropdown"]',function(){OpsydCoreJS.getViewPort().width<n&&OpsydCoreJS.scrollTo($(this))});$(document).on("click",".mega-menu-dropdown .dropdown-menu, .classic-menu-dropdown .dropdown-menu",function(n){n.stopPropagation()});$(window).scroll(function(){var n=75;$("body").hasClass("page-header-menu-fixed")&&($(window).scrollTop()>n?$(".page-header-menu").addClass("fixed"):$(".page-header-menu").removeClass("fixed"));$("body").hasClass("page-header-top-fixed")&&($(window).scrollTop()>n?$(".page-header-top").addClass("fixed"):$(".page-header-top").removeClass("fixed"))})},t=function(n,t){var r=location.hash.toLowerCase(),i=$(".hor-menu");(n==="click"||n==="set"?t=$(t):n==="match"&&i.find("li > a").each(function(){var n=$(this).attr("href");if(!(n===undefined||n===null)&&(n=$(this).attr("href").toLowerCase(),n.length>1&&r.substr(1,n.length-1)==n.substr(1))){t=$(this);return}}),t&&t.size()!=0)&&t.attr("href").toLowerCase()!=="javascript:;"&&t.attr("href").toLowerCase()!=="#"&&(i.find("li.active").removeClass("active"),i.find("li > a > .selected").remove(),i.find("li.open").removeClass("open"),t.parents("li").each(function(){$(this).addClass("active");$(this).parent("ul.navbar-nav").size()===1&&$(this).find("> a").append('<span class="selected"><\/span>')}))},e=function(){var t=OpsydCoreJS.getViewPort().width,i=$(".page-header-menu");t>=550?$(".top-menu").css("display","block"):$(".top-menu").css("display","none");t>=n&&i.data("breakpoint")!=="desktop"?($('.hor-menu [data-toggle="dropdown"].active').removeClass("open"),i.data("breakpoint","desktop"),$('.hor-menu [data-hover="megamenu-dropdown"]').not(".hover-initialized").each(function(){$(this).dropdownHover();$(this).addClass("hover-initialized")}),$(".hor-menu .navbar-nav li.open").removeClass("open"),$(".page-header-menu").css("display","block")):t<n&&i.data("breakpoint")!=="mobile"?($('.hor-menu [data-toggle="dropdown"].active').addClass("open"),i.data("breakpoint","mobile"),$('.hor-menu [data-hover="megamenu-dropdown"].hover-initialized').each(function(){$(this).unbind("hover");$(this).parent().unbind("hover").find(".dropdown-submenu").each(function(){$(this).unbind("hover")});$(this).removeClass("hover-initialized")})):t<n},o=function(){var n;$("body").height()<OpsydCoreJS.getViewPort().height&&(n=OpsydCoreJS.getViewPort().height-$(".page-header").outerHeight()-($(".page-container").outerHeight()-$(".page-content").outerHeight())-$(".page-prefooter").outerHeight()-$(".page-footer").outerHeight(),$(".page-content").css("min-height",n))},s=function(){var t=100,n=500;navigator.userAgent.match(/iPhone|iPad|iPod/i)?$(window).bind("touchend touchcancel touchleave",function(){$(this).scrollTop()>t?$(".scroll-to-top").fadeIn(n):$(".scroll-to-top").fadeOut(n)}):$(window).scroll(function(){$(this).scrollTop()>t?$(".scroll-to-top").fadeIn(n):$(".scroll-to-top").fadeOut(n)});$(".scroll-to-top").click(function(t){return t.preventDefault(),$("html, body").animate({scrollTop:0},n),!1})};return{initHeader:function(){u();f();OpsydCoreJS.addResizeHandler(e);OpsydCoreJS.isAngularJsApp()&&t("match")},initContent:function(){o()},initFooter:function(){s()},init:function(){this.initHeader();this.initContent();this.initFooter()},setMainMenuActiveLink:function(n,i){t(n,i)},closeMainMenu:function(){$(".hor-menu").find("li.open").removeClass("open");OpsydCoreJS.getViewPort().width<n&&$(".page-header-menu").is(":visible")&&$(".page-header .menu-toggler").click()},getLayoutImgPath:function(){return i},getLayoutCssPath:function(){return r}}}()