--- a/src/pyams_skin/resources/js/myams.min.js Mon Sep 11 12:31:44 2017 +0200
+++ b/src/pyams_skin/resources/js/myams.min.js Mon Sep 11 12:39:16 2017 +0200
@@ -1,1 +1,1 @@
-(function(c,b){String.prototype.startsWith=function(g){var e=this.length,f=g.length;if(e<f){return false}return(this.substr(0,f)===g)};String.prototype.endsWith=function(g){var e=this.length,f=g.length;if(e<f){return false}return(this.substr(e-f)===g)};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(f,g){var e=this.length;g=Number(g)||0;g=(g<0)?Math.ceil(g):Math.floor(g);if(g<0){g+=e}for(;g<e;g++){if(g in this&&this[g]===f){return g}}return -1}}c.expr[":"].hasvalue=function(g,e,f){return c(g).val()!==""};c.expr[":"].econtains=function(g,e,f){return(g.textContent||g.innerText||c(g).text()||"").toLowerCase()===f[3].toLowerCase()};c.expr[":"].withtext=function(g,e,f){return(g.textContent||g.innerText||c(g).text()||"")===f[3]};c.expr[":"].parents=function(g,e,f){return c(g).parents(f[3]).length>0};if(c.scrollbarWidth===undefined){c.scrollbarWidth=function(){var f=c('<div style="width:50px; height:50px; overflow:auto"><div/></div>').appendTo("body");var g=f.children();var e=g.innerWidth()-g.height(99).innerWidth();f.remove();return e}}c.fn.extend({exists:function(){return c(this).length>0},objectOrParentWithClass:function(e){if(this.hasClass(e)){return this}else{return this.parents("."+e)}},listattr:function(f){var e=[];this.each(function(){e.push(c(this).attr(f))});return e},style:function(f,i,e){var h=this.get(0);if(typeof(h)==="undefined"){return}var g=this.get(0).style;if(typeof(f)!=="undefined"){if(typeof(i)!=="undefined"){e=typeof(e)!=="undefined"?e:"";g.setProperty(f,i,e);return this}else{return g.getPropertyValue(f)}}else{return g}},removeClassPrefix:function(e){this.each(function(g,h){var f=h.className.split(" ").map(function(i){return i.startsWith(e)?"":i});h.className=c.trim(f.join(" "))});return this},contextMenu:function(f){function e(i,k,h){var j=c(window)[k](),l=c(f.menuSelector)[k](),g=i;if(i+l>j&&l<i){g-=l}return g}return this.each(function(){c("a",c(f.menuSelector)).each(function(){c(this).data("ams-context-menu",true)});c(this).on("contextmenu",function(g){if(g.ctrlKey){return}c(f.menuSelector).data("invokedOn",c(g.target)).show().css({position:"fixed",left:e(g.clientX,"width","scrollLeft")-10,top:e(g.clientY,"height","scrollTop")-10}).off("click").on("click",function(h){c(this).hide();var j=c(this).data("invokedOn");var i=c(h.target);f.menuSelected.call(this,j,i);a.event.stop(h)});return false});c(document).click(function(){c(f.menuSelector).hide()})})},myams_menu:function(e){var g={accordion:true,speed:200,closedSign:'<em class="fa fa-angle-down"></em>',openedSign:'<em class="fa fa-angle-up"></em>'};var f=c.extend({},g,e);var h=c(this);h.find("LI").each(function(){var i=c(this);if(i.find("UL").size()>0){i.find("A:first").append("<b class='collapse-sign'>"+f.closedSign+"</b>");var j=i.find("A:first");if(j.attr("href")==="#"){j.click(function(){return false})}}});h.find("LI.active").each(function(){var i=c(this).parents("UL");var j=i.parent("LI");i.slideDown(f.speed);j.find("b:first").html(f.openedSign);j.addClass("open")});h.find("LI A").on("click",function(){var l=c(this);if(l.hasClass("active")){return}var i=l.attr("href").replace(/^#/,"");var k=l.parent().find("UL");if(f.accordion){var j=l.parent().parents("UL");var m=h.find("UL:visible");m.each(function(o){var q=true;j.each(function(r){if(j[r]===m[o]){q=false;return false}});if(q){if(k!==m[o]){var p=c(m[o]);if(i||!p.hasClass("active")){p.slideUp(f.speed,function(){c(this).parent("LI").removeClass("open").find("B:first").delay(f.speed).html(f.closedSign)})}}}})}var n=l.parent().find("UL:first");if(!i&&n.is(":visible")&&!n.hasClass("active")){n.slideUp(f.speed,function(){l.parent("LI").removeClass("open").find("B:first").delay(f.speed).html(f.closedSign)})}else{n.slideDown(f.speed,function(){l.parent("LI").addClass("open").find("B:first").delay(f.speed).html(f.openedSign)})}})}});c.UTF8={encode:function(f){f=f.replace(/\r\n/g,"\n");var e="";for(var h=0;h<f.length;h++){var g=f.charCodeAt(h);if(g<128){e+=String.fromCharCode(g)}else{if((g>127)&&(g<2048)){e+=String.fromCharCode((g>>6)|192);e+=String.fromCharCode((g&63)|128)}else{e+=String.fromCharCode((g>>12)|224);e+=String.fromCharCode(((g>>6)&63)|128);e+=String.fromCharCode((g&63)|128)}}}return e},decode:function(e){var g="";var j=0,k=0,h=0,f=0;while(j<e.length){k=e.charCodeAt(j);if(k<128){g+=String.fromCharCode(k);j++}else{if((k>191)&&(k<224)){h=e.charCodeAt(j+1);g+=String.fromCharCode(((k&31)<<6)|(h&63));j+=2}else{h=e.charCodeAt(j+1);f=e.charCodeAt(j+2);g+=String.fromCharCode(((k&15)<<12)|((h&63)<<6)|(f&63));j+=3}}}return g}};if(b.MyAMS===undefined){b.MyAMS={devmode:true,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:true,enableWidgets:true,enableMobile:false,enableFastclick:false,warnOnFormChange:false,ismobile:(/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()))}}var d=b.MyAMS;var a=d;d.baseURL=(function(){var e=c('script[src*="/myams.js"], script[src*="/myams.min.js"]');var f=e.attr("src");a.devmode=f.indexOf(".min.js")<0;a.devext=a.devmode?"":".min";return f.substring(0,f.lastIndexOf("/")+1)})();d.log=function(){if(b.console){b.console.log(this,arguments)}};d.getQueryVar=function(g,h){if(g.indexOf("?")<0){return false}if(!g.endsWith("&")){g+="&"}var e=new RegExp(".*?[&\\?]"+h+"=(.*?)&.*");var f=g.replace(e,"$1");return f===g?false:f};d.rgb2hex=function(e){return"#"+c.map(e.match(/\b(\d+)\b/g),function(f){return("0"+parseInt(f).toString(16)).slice(-2)}).join("")};d.generateId=function(){function e(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return e()+e()+e()+e()};d.generateUUID=function(){var f=new Date().getTime();var e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(h){var g=(f+Math.random()*16)%16|0;f=Math.floor(f/16);return(h==="x"?g:(g&3|8)).toString(16)});return e};d.getObject=function(k,g){if(!k){return undefined}if(typeof(k)!=="string"){return k}var h=k.split(".");g=(g===undefined||g===null)?window:g;for(var f=0;f<h.length;f++){try{g=g[h[f]]}catch(j){return undefined}}return g};d.getFunctionByName=function(k,g){if(k===undefined){return undefined}else{if(typeof(k)==="function"){return k}}var j=k.split(".");var h=j.pop();g=(g===undefined||g===null)?window:g;for(var f=0;f<j.length;f++){try{g=g[j[f]]}catch(l){return undefined}}try{return g[h]}catch(l){return undefined}};d.executeFunctionByName=function(h,f){var g=a.getFunctionByName(h,window);if(typeof(g)==="function"){var e=Array.prototype.slice.call(arguments,2);return g.apply(f,e)}};d.isInDOM=function(e){e=c(e);if(!e.exists()){return false}return b.document.body.contains(e[0])};d.getSource=function(e){return e.replace(/{[^{}]*}/g,function(f){return a.getFunctionByName(f.substr(1,f.length-2))})};d.getScript=function(f,i,e){if(typeof(i)==="object"){e=i;i=null}if(e===undefined){e={}}var h={dataType:"script",url:a.getSource(f),success:i,error:a.error.show,cache:!a.devmode,async:e.async===undefined?typeof(i)==="function":e.async};var g=c.extend({},h,e);return c.ajax(g)};d.getCSS=function(e,i){var g=c("HEAD");var f=c('link[data-ams-id="'+i+'"]',g);if(f.length===0){var h=a.getSource(e);if(a.devmode){h+="?_="+new Date().getTime()}c("<link />").attr({rel:"stylesheet",type:"text/css",href:h,"data-ams-id":i}).appendTo(g)}};d.event={stop:function(e){if(!e){e=window.event}if(e){if(e.stopPropagation){e.stopPropagation();e.preventDefault()}else{e.cancelBubble=true;e.returnValue=false}}}};d.browser={getInternetExplorerVersion:function(){var g=-1;if(navigator.appName==="Microsoft Internet Explorer"){var e=navigator.userAgent;var f=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(f.exec(e)!==null){g=parseFloat(RegExp.$1)}}return g},checkVersion:function(){var f="You're not using Windows Internet Explorer.";var e=this.getInternetExplorerVersion();if(e>-1){if(e>=8){f="You're using a recent copy of Windows Internet Explorer."}else{f="You should upgrade your copy of Windows Internet Explorer."}}if(b.alert){b.alert(f)}},isIE8orlower:function(){var f="0";var e=this.getInternetExplorerVersion();if(e>-1){if(e>=9){f=0}else{f=1}}return f},copyToClipboard:function(){return function(){var e=c(this);e.parents(".btn-group").removeClass("open");if(b.prompt){b.prompt(d.i18n.CLIPBOARD_COPY,e.text())}}}};d.error={ajax:function(i,e,h,f){if(e&&e.statusText&&e.statusText.toUpperCase()==="OK"){return}e=a.ajax.getResponse(e);if(e.contentType==="json"){a.ajax.handleJSON(e.data)}else{var j=i.statusText||i.type;var g=e.responseText;a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+j+"</h4><p>"+(g||"")+"</p>",icon:"fa fa-warning animated shake",timeout:10000})}if(b.console){b.console.error(i);b.console.debug(e)}},show:function(h,e,g){if(!g){return}var f=a.ajax.getResponse(h);if(f.contentType==="json"){a.ajax.handleJSON(f.data)}else{a.skin.messageBox("error",{title:a.i18n.ERRORS_OCCURED,content:"<h4>"+e+"</h4><p>"+g+"</p>",icon:"fa fa-warning animated shake",timeout:10000})}if(b.console){b.console.error(g);b.console.debug(h)}}};d.ajax={check:function(f,e,k,m){function j(q,p){if(k===undefined){return}if(!(k instanceof Array)){k=[k]}for(var o=0;o<k.length;o++){var n=a.getFunctionByName(k[o]);if(typeof(n)==="function"){n(q,p)}}}if(!(k instanceof Array)){if(typeof(k)==="object"){m=k;k=undefined}}var h={async:typeof(k)==="function"};var g=c.extend({},h,m);if(f instanceof Array){var l=[];for(var i=0;i<f.length;i++){if(f[i]===undefined){l.push(a.getScript(e[i],{async:true}))}}if(l.length>0){c.when.apply(c,l).then(function(){j(true,m)})}else{j(false,m)}}else{if(f===undefined){if(typeof(e)==="string"){a.getScript(e,function(){j(true,m)},g)}}else{j(false,m)}}},getAddr:function(f){var e=f||c("HTML HEAD BASE").attr("href")||window.location.href;return e.substr(0,e.lastIndexOf("/")+1)},start:function(){c("#ajax-gear").show()},stop:function(){c("#ajax-gear").hide()},progress:function(e){if(!e.lengthComputable){return}if(e.loaded>=e.total){return}if(b.console){b.console.log(parseInt((e.loaded/e.total*100),10)+"%")}},post:function(g,i,f,l){var k;if(g.startsWith(window.location.protocol)){k=g}else{k=this.getAddr()+g}if(typeof(f)==="function"){l=f;f={}}else{if(!f){f={}}}if(typeof(l)==="undefined"){l=f.callback}if(typeof(l)==="string"){l=a.getFunctionByName(l)}delete f.callback;var e;var j={url:k,type:"post",cache:false,async:typeof(l)==="function",data:c.param(i),dataType:"json",success:l||function(m){e=m.result}};var h=c.extend({},j,f);c.ajax(h);return e},getResponse:function(h){var j=h.getResponseHeader("content-type"),g,f;if(j){if(j.startsWith("application/javascript")){g="script";f=h.responseText}else{if(j.startsWith("text/html")){g="html";f=h.responseText}else{if(j.startsWith("text/xml")){g="xml";f=h.responseText}else{f=h.responseJSON;if(f){g="json"}else{try{f=JSON.parse(h.responseText);g="json"}catch(i){f=h.responseText;g="text"}}}}}}else{g="json";f={status:"alert",alert:{title:a.i18n.ERROR_OCCURED,content:a.i18n.NO_SERVER_RESPONSE}}}return{contentType:g,data:f}},handleJSON:function(p,g,k){var i=p.status;var e;switch(i){case"alert":if(b.alert){b.alert(p.alert.title+"\n\n"+p.alert.content)}break;case"error":a.form.showErrors(g,p);break;case"info":case"success":a.form.resetChanged(g);if(p.close_form!==false){a.dialog.close(g)}break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":a.form.resetChanged(g);if(p.close_form!==false){a.dialog.close(g)}break;case"modal":a.dialog.open(p.location);break;case"reload":a.form.resetChanged(g);if(p.close_form!==false){a.dialog.close(g)}e=p.location||window.location.hash;if(e.startsWith("#")){e=e.substr(1)}a.skin.loadURL(e,p.target||k||"#content");break;case"redirect":a.form.resetChanged(g);if(p.close_form===true){a.dialog.close(g)}e=p.location||window.location.href;if(p.window){window.open(e,p.window,p.options)}else{if(window.location.href===e){window.location.reload(true)}else{window.location.href=e}}break;default:if(b.console){b.console.log("Unhandled status: "+i)}}var j;var l;var f;if(p.content){l=p.content;f=c(l.target||k||g||"#content");if(l.raw===true){f.text(l.text)}else{f.html(l.html);a.initContent(f)}if(!l.keep_hidden){f.removeClass("hidden")}}if(p.contents){var h=p.contents;for(j=0;j<h.length;j++){l=h[j];f=c(l.target);if(l.raw===true){f.text(l.text)}else{f.html(l.html);a.initContent(f)}if(!l.keep_hidden){f.removeClass("hidden")}}}var o;if(p.message){o=p.message;if(typeof(o)==="string"){if((i==="info")||(i==="success")){a.skin.smallBox(i,{title:o,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3000})}else{a.skin.alert(c(g||"#content"),i,o)}}else{a.skin.alert(c(o.target||k||g||"#content"),o.status||"success",o.header,o.body,o.subtitle)}}if(p.smallbox){a.skin.smallBox(p.smallbox_status||i,{title:p.smallbox,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3000})}if(p.messagebox){o=p.messagebox;if(typeof(o)==="string"){a.skin.messageBox("info",{title:a.i18n.ERROR_OCCURED,content:o,timeout:10000})}else{var m=o.status||"info";if(m==="error"&&g&&k){a.executeFunctionByName(g.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",g,k)}a.skin.messageBox(m,{title:o.title||a.i18n.ERROR_OCCURED,content:o.content,icon:o.icon,number:o.number,timeout:o.timeout===null?undefined:(o.timeout||10000)})}}if(p.event){g.trigger(p.event,p.event_options)}if(p.callback){a.executeFunctionByName(p.callback,g,p.options)}if(p.callbacks){var n;for(j=0;j<p.callbacks.length;j++){n=p.callbacks[j];a.executeFunctionByName(n,g,n.options)}}}};d.jsonrpc={getAddr:function(g){var e=g||c("HTML HEAD BASE").attr("href")||window.location.href;var f=e.replace(/\+\+skin\+\+\w+\//,"");return f.substr(0,f.lastIndexOf("/")+1)},query:function(f,h,e,g){a.ajax.check(c.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){if(typeof(e)==="function"){g=e;e={}}else{if(!e){e={}}}if(g==="undefined"){g=e.callback}if(typeof(g)==="string"){g=a.getFunctionByName(g)}delete e.callback;var l={};if(typeof(f)==="string"){l.query=f}else{if(typeof(f)==="object"){c.extend(l,f)}}c.extend(l,e);var i;var k={id:new Date().getTime(),params:l,success:g||function(m){i=m},error:a.error.show};var j=c.extend({},k,e);c.jsonRPC.withOptions({endPoint:a.jsonrpc.getAddr(e.url),namespace:e.namespace,cache:false},function(){c.jsonRPC.request(h,j)});return i})},post:function(h,f,e,g){a.ajax.check(c.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){if(typeof(e)==="function"){g=e;e={}}else{if(!e){e={}}}if(typeof(g)==="undefined"){g=e.callback}if(typeof(g)==="string"){g=a.getFunctionByName(g)}delete e.callback;var i;var k={id:new Date().getTime(),params:f,success:g||function(l){i=l},error:a.error.show};var j=c.extend({},k,e);c.jsonRPC.withOptions({endPoint:a.jsonrpc.getAddr(e.url),namespace:e.namespace,cache:false},function(){c.jsonRPC.request(h,j)});return i})}};d.xmlrpc={getAddr:function(g){var e=g||c("HTML HEAD BASE").attr("href")||window.location.href;var f=e.replace(/\+\+skin\+\+\w+\//,"");return f.substr(0,f.lastIndexOf("/")+1)},post:function(f,i,g,e,h){a.ajax.check(c.xmlrpc,a.baseURL+"ext/jquery-xmlrpc"+a.devext+".js",function(){if(typeof(e)==="function"){h=e;e={}}else{if(!e){e={}}}if(typeof(h)==="undefined"){h=e.callback}if(typeof(h)==="string"){h=a.getFunctionByName(h)}delete e.callback;var j;var l={url:a.xmlrpc.getAddr(f),methodName:i,params:g,success:h||function(m){j=m},error:a.error.show};var k=c.extend({},l,e);c.xmlrpc(k);return j})}};d.form={init:function(f){var e;if(a.warnOnFormChange){e=c('FORM[data-ams-warn-on-change!="false"]',f)}else{e=c('FORM[data-ams-warn-on-change="true"]',f)}e.each(function(){var g=c(this);c('INPUT[type="text"], INPUT[type="checkbox"], INPUT[type="radio"], SELECT, TEXTAREA, [data-ams-changed-event]',g).each(function(){var i=c(this);if(i.data("ams-ignore-change")!==true){var h=i.data("ams-changed-event")||"change";i.on(h,function(){a.form.setChanged(c(this).parents("FORM"))})}});g.on("reset",function(){a.form.resetChanged(c(this))})})},setFocus:function(e){var f=c("[data-ams-focus-target]",e).first();if(!f.exists()){f=c("input, select",e).first()}if(f.exists()){if(f.hasClass("select2-input")){f=f.parents(".select2")}if(f.hasClass("select2")){setTimeout(function(){f.select2("focus");if(f.data("ams-focus-open")===true){f.select2("open")}},100)}else{f.focus()}}},checkBeforeUnload:function(){var e=c('FORM[data-ams-form-changed="true"]');if(e.exists()){return a.i18n.FORM_CHANGED_WARNING}},confirmChangedForm:function(g,h,f){if(typeof(g)==="function"){h=g;g=undefined}var e=c('FORM[data-ams-form-changed="true"]',g);if(e.exists()){if(f){if(b.confirm(a.i18n.FORM_CHANGED_WARNING,a.i18n.WARNING)){h.call(g)}else{f.call(g)}}else{a.skin.bigBox({title:a.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i> '+a.i18n.FORM_CHANGED_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(i){if(i===a.i18n.BTN_OK){h.call(g)}})}}else{h.call(g)}},setChanged:function(e){e.attr("data-ams-form-changed",true)},resetChanged:function(e){if(e!==undefined){c(e).removeAttr("data-ams-form-changed")}},submit:function(h,g,f){h=c(h);if(!h.exists()){return false}if(typeof(g)==="object"){f=g;g=undefined}if(h.data("submitted")){if(!h.data("ams-form-hide-submitted")){a.skin.messageBox("warning",{title:a.i18n.WAIT,content:a.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:h.data("ams-form-alert-timeout")||5000})}return false}if(!a.form._checkSubmitValidators(h)){return false}c(".alert-danger, SPAN.state-error",h).not(".persistent").remove();c(".state-error",h).removeClassPrefix("state-");var e=c(h.data("ams-submit-button"));if(e&&!e.data("ams-form-hide-loading")){e.data("ams-progress-content",e.html());e.button("loading")}a.ajax.check(c.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+a.devext+".js",function(){function k(o,s){var m,z,D;var K=o.data();var n=K.amsFormOptions;var C;var q;var u;var t;var l;var H;function p(O,P){var N;function M(){clearInterval(N);a.form.resetAfterSubmit(o,m);m.html(m.data("ams-progress-content"));a.executeFunctionByName(H,o,m);a.form.resetChanged(o)}function L(){a.ajax.post(O,{progress_id:P},{error:M},a.getFunctionByName(l)||function(Q,R){if(R==="success"){if(Q.status==="running"){if(Q.message){m.text(Q.message)}else{var S=m.data("ams-progress-text")||a.i18n.PROGRESS;if(Q.current){S+=": "+Q.current+"/ "+(Q.length||100)}else{S+="..."}m.text(S)}}else{if(Q.status==="finished"){M()}}}else{M()}})}m.button("loading");N=setInterval(L,t)}if(f){q=f.formDataInitCallback}if(q){delete f.formDataInitCallback}else{q=K.amsFormDataInitCallback}if(q){var A={};if(typeof(q)==="function"){C=q.call(o,A)}else{C=a.executeFunctionByName(q,o,A)}if(A.veto){m=o.data("ams-submit-button");if(m){m.button("reset")}a.form.finalizeSubmitFooter.call(o);return false}}else{C=K.amsFormData||{}}m=c(o.data("ams-submit-button"));if(m&&m.exists()){z=m.data();D=z.amsFormSubmitTarget}else{z={}}var v;var I=g||z.amsFormHandler||K.amsFormHandler||"";if(I.startsWith(window.location.protocol)){v=I}else{var B=z.amsFormAction||o.attr("action").replace(/#/,"");if(B.startsWith(window.location.protocol)){v=B}else{v=a.ajax.getAddr()+B}v+=I}u=z.amsProgressHandler||K.amsProgressHandler||"";t=z.amsProgressInterval||K.amsProgressInterval||1000;l=z.amsProgressCallback||K.amsProgressCallback;H=z.amsProgressEndCallback||K.amsProgressEndCallback;var J=null;if(f&&f.initSubmitTarget){a.executeFunctionByName(f.initSubmitTarget,o)}else{if(K.amsFormInitSubmitTarget){J=c(D||K.amsFormSubmitTarget||"#content");a.executeFunctionByName(K.amsFormInitSubmit||"MyAMS.form.initSubmit",o,J)}else{if(!K.amsFormHideSubmitFooter){a.executeFunctionByName(K.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",o)}}}if(f){C=c.extend({},C,f.form_data)}var w;if(u){C.progress_id=a.generateUUID()}else{w=typeof(s.uuid)!=="undefined";if(w){if(v.indexOf("X-Progress-ID")<0){v+="?X-Progress-ID="+s.uuid}delete s.uuid}}var y={url:v,type:"post",cache:false,data:C,dataType:K.amsFormDatatype,beforeSerialize:function(){if(typeof(b.tinyMCE)!=="undefined"){b.tinyMCE.triggerSave()}},beforeSubmit:function(M,L){L.data("submitted",true)},error:function(O,L,M,N){if(J){a.executeFunctionByName(K.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",N,J)}a.form.resetAfterSubmit(N)},iframe:w};var F=(f&&f.downloadTarget)||K.amsFormDownloadTarget;if(F){var x=c('iframe[name="'+F+'"]');if(!x.exists()){x=c("<iframe></iframe>").hide().attr("name",F).appendTo(c("body"))}y=c.extend({},y,{iframe:true,iframeTarget:x,success:function(L,M,Q,P){var O=c(P).parents(".modal-dialog");if(O.exists()){a.dialog.close(P)}else{var R;var N=P.data("ams-submit-button");if(N){R=N.data("ams-form-submit-callback")}if(!R){R=a.getFunctionByName(K.amsFormSubmitCallback)||a.form._submitCallback}try{R.call(P,L,M,Q,P)}finally{a.form.resetAfterSubmit(P);a.form.resetChanged(P)}}}})}else{y=c.extend({},y,{error:function(O,L,M,N){if(J){a.executeFunctionByName(K.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",N,J)}a.form.resetAfterSubmit(N)},success:function(L,M,P,O){var Q;var N=O.data("ams-submit-button");if(N){Q=N.data("ams-form-submit-callback")}if(!Q){Q=a.getFunctionByName(K.amsFormSubmitCallback)||a.form._submitCallback}try{Q.call(O,L,M,P,O)}finally{a.form.resetAfterSubmit(O);a.form.resetChanged(O)}},iframe:w})}var G=c.extend({},y,s,n,f);if(u){p(u,C.progress_id)}c(o).ajaxSubmit(G);if(F){var E=c(o).parents(".modal-dialog");var r=E.exists()&&m.exists()&&m.data("ams-keep-modal");if(E.exists()&&(r!==true)){a.dialog.close(o)}else{if(!u){setTimeout(function(){a.form.resetAfterSubmit(o,m);a.form.resetChanged(o)},m.data("ams-form-reset-timeout")||2000)}}}}var j=(h.data("ams-form-ignore-uploads")!==true)&&(c('INPUT[type="file"]',h).length>0);if(j){a.ajax.check(c.progressBar,a.baseURL+"ext/jquery-progressbar"+a.devext+".js");var i=c.extend({},{uuid:c.progressBar.submit(h)});k(h,i)}else{k(h,{})}});return false},initSubmit:function(g,f){var e=c(this);var h='<i class="fa fa-3x fa-gear fa-spin"></i>';if(!f){f=e.data("ams-form-submit-message")}if(f){h+="<strong>"+f+"</strong>"}c(g).html('<div class="row margin-20"><div class="text-center">'+h+"</div></div>");c(g).parents(".hidden").removeClass("hidden")},resetAfterSubmit:function(f){if(f.is(":visible")){var e=f.data("ams-submit-button");if(e){e.button("reset")}a.form.finalizeSubmitFooter.call(f)}f.data("submitted",false);f.removeData("ams-submit-button")},finalizeSubmitOnError:function(e){c("i",e).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(f){var e=c(this);var h='<i class="fa fa-3x fa-gear fa-spin"></i>';if(!f){f=c(this).data("ams-form-submit-message")}if(f){h+='<strong class="submit-message align-top padding-left-10 margin-top-10">'+f+"</strong>"}var g=c("footer",e);c("button",g).hide();g.append('<div class="row"><div class="text-center">'+h+"</div></div>")},finalizeSubmitFooter:function(){var e=c(this);var f=c("footer",e);if(f){c(".row",f).remove();c("button",f).show()}},_submitCallback:function(o,h,g,e){var j;if(e.is(":visible")){a.form.finalizeSubmitFooter.call(e);j=e.data("ams-submit-button");if(j){j.button("reset")}}var i=e.data();var l;if(i.amsFormDatatype){l=i.amsFormDatatype}else{var f=a.ajax.getResponse(g);l=f.contentType;o=f.data}var k;if(j){k=c(j.data("ams-form-submit-target")||i.amsFormSubmitTarget||"#content")}else{k=c(i.amsFormSubmitTarget||"#content")}switch(l){case"json":a.ajax.handleJSON(o,e,k);break;case"script":break;case"xml":break;case"html":case"text":default:a.form.resetChanged(e);if(j&&(j.data("ams-keep-modal")!==true)){a.dialog.close(e)}if(!k.exists()){k=c("body")}k.parents(".hidden").removeClass("hidden");c(".alert",k.parents(".alerts-container")).remove();k.css({opacity:"0.0"}).html(o).delay(50).animate({opacity:"1.0"},300);a.initContent(k);a.form.setFocus(k)}var m=g.getResponseHeader("X-AMS-Callback");if(m){var n=g.getResponseHeader("X-AMS-Callback-Options");a.executeFunctionByName(m,e,n===undefined?{}:JSON.parse(n),g)}},_getSubmitValidators:function(f){var e=[];var g=f.data("ams-form-validator");if(g){e.push([f,g])}c("[data-ams-form-validator]",f).each(function(){var h=c(this);e.push([h,h.data("ams-form-validator")])});return e},_checkSubmitValidators:function(g){var i=a.form._getSubmitValidators(g);if(!i.length){return true}var h=[];var n=true;for(var k=0;k<i.length;k++){var f=i[k];var e=f[0];var m=f[1];var l=a.executeFunctionByName(m,g,e);if(l===false){n=false}else{if(typeof(l)==="string"){h.push(l)}else{if(n.length&&(n.length>0)){h=h.concat(n)}}}}if(h.length>0){var j=h.length===1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(g,"danger",j,h);return false}else{return n}},showErrors:function(e,l){var i;if(typeof(l)==="string"){a.skin.alert(e,"error",a.i18n.ERROR_OCCURED,l)}else{if(l instanceof Array){i=l.length===1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(e,"error",i,l)}else{c(".state-error",e).removeClass("state-error");i=l.error_header||(l.widgets&&(l.widgets.length>1)?a.i18n.ERRORS_OCCURED:a.i18n.ERROR_OCCURED);var n=[];var k;if(l.messages){for(k=0;k<l.messages.length;k++){var h=l.messages[k];if(h.header){n.push("<strong>"+h.header+"</strong><br />"+h.message)}else{n.push(h.message||h)}}}if(l.widgets){for(k=0;k<l.widgets.length;k++){var m=l.widgets[k];var j=c('[name="'+m.name+'"]',e);j.parents("label:first").removeClassPrefix("state-").addClass("state-error").after('<span for="name" class="state-error">'+m.message+"</span>");if(m.label){n.push(m.label+" : "+m.message)}var g=j.parents(".tab-pane").index()+1;if(g>0){var f=c(".nav-tabs",c(j).parents(".tabforms"));c("li:nth-child("+g+")",f).removeClassPrefix("state-").addClass("state-error");c("li.state-error:first a",e).click()}}}a.skin.alert(c("fieldset:first",e),l.error_level||"error",i,n,l.error_message)}}}};d.dialog={_shown_callbacks:[],registerShownCallback:function(h,f){var e;if(f){e=f.objectOrParentWithClass("modal-dialog")}var g;if(e&&e.exists()){g=e.data("shown-callbacks");if(g===undefined){g=[];e.data("shown-callbacks",g)}}else{g=a.dialog._shown_callbacks}if(g.indexOf(h)<0){g.push(h)}},_hide_callbacks:[],registerHideCallback:function(h,f){var e;if(f){e=f.objectOrParentWithClass("modal-dialog")}var g;if(e&&e.exists()){g=e.data("hide-callbacks");if(g===undefined){g=[];e.data("hide-callbacks",g)}}else{g=a.dialog._hide_callbacks}if(g.indexOf(h)<0){g.push(h)}},open:function(f,e){a.ajax.check(c.fn.modalmanager,a.baseURL+"ext/bootstrap-modalmanager"+a.devext+".js",function(){a.ajax.check(c.fn.modal.defaults,a.baseURL+"ext/bootstrap-modal"+a.devext+".js",function(j){if(j){c(document).off("click.modal");c.fn.modal.defaults.spinner=c.fn.modalmanager.defaults.spinner='<div class="loading-spinner" style="width: 200px; margin-left: -100px;"><div class="progress progress-striped active"><div class="progress-bar" style="width: 100%;"></div></div></div>'}var i;var h;if(typeof(f)==="string"){i={};h=f}else{i=f.data();h=f.attr("href")||i.amsUrl;var g=a.getFunctionByName(h);if(typeof(g)==="function"){h=g.call(f)}}if(!h){return}c("body").modalmanager("loading");if(h.indexOf("#")===0){c(h).modal("show")}else{c.ajax({url:h,type:"get",cache:i.amsAllowCache===undefined?false:i.amsAllowCache,data:e,success:function(o,n,m){c("body").modalmanager("removeLoading");var l=a.ajax.getResponse(m);var s=l.contentType;var u=l.data;switch(s){case"json":a.ajax.handleJSON(u,c(c(f).data("ams-json-target")||"#content"));break;case"script":break;case"xml":break;case"html":case"text":default:var q=c(u);var r=c(".modal-dialog",q.wrap("<div></div>").parent());var p=r.data();var t={backdrop:"static",overflow:p.amsModalOverflow||".modal-viewport",maxHeight:p.amsModalMaxHeight===undefined?function(){return c(window).height()-c(".modal-header",q).outerHeight(true)-c("footer",q).outerHeight(true)-85}:a.getFunctionByName(p.amsModalMaxHeight)};var k=c.extend({},t,p.amsModalOptions);k=a.executeFunctionByName(p.amsModalInitCallback,r,k)||k;c("<div>").addClass("modal fade").append(q).modal(k).on("shown",a.dialog.shown).on("hidden",a.dialog.hidden);a.initContent(q);if(i.amsLogEvent!==false){a.stats.logPageview(h)}}}})}})})},shown:function(m){function l(o){var p=c(".scrollmarker.top",f);var n=f.scrollTop();if(n>0){p.show()}else{p.hide()}var e=c(".scrollmarker.bottom",f);if(j+n>=f.get(0).scrollHeight){e.hide()}else{e.show()}}var k=m.target;var f=c(".modal-viewport",k);if(f.exists()){var j=parseInt(f.css("max-height"));var h=c.scrollbarWidth();if((f.css("overflow")!=="hidden")&&(f.height()===j)){c("<div></div>").addClass("scrollmarker").addClass("top").css("top",0).css("width",f.width()-h).hide().appendTo(f);c("<div></div>").addClass("scrollmarker").addClass("bottom").css("top",j-20).css("width",f.width()-h).appendTo(f);f.scroll(l);f.off("resize").on("resize",l)}else{c(".scrollmarker",f).remove()}}c("[data-ams-shown-callback]",k).each(function(){var e=a.getFunctionByName(c(this).data("ams-shown-callback"));if(e){e.call(k,this)}});var g;var i=c(".modal-dialog",k).data("shown-callbacks");if(i){for(g=0;g<i.length;g++){i[g].call(k)}}i=a.dialog._shown_callbacks;if(i){for(g=0;g<i.length;g++){i[g].call(k)}}a.form.setFocus(k)},close:function(f){if(typeof(f)==="string"){f=c(f)}var g=f.parents(".modal").data("modal");if(g){var e=c("body").data("modalmanager");if(e&&(e.getOpenModals().indexOf(g)>=0)){g.hide()}}},hidden:function(i){var h=i.target;a.skin.cleanContainer(h);c("[data-ams-hidden-callback]",h).each(function(){var e=a.getFunctionByName(c(this).data("ams-hidden-callback"));if(e){e.call(h,this)}});var f;var g=c(".modal-dialog",h).data("hide-callbacks");if(g){for(f=0;f<g.length;f++){g[f].call(h)}}g=a.dialog._hide_callbacks;if(g){for(f=0;f<g.length;f++){g[f].call(h)}}}};d.helpers={select2ClearSelection:function(){var f=c(this);var e=f.parents("label");var g=f.data("ams-select2-target");c('[name="'+g+'"]',e).data("select2").val("")},select2FormatSelection:function(f,e){if(f instanceof Array){c(f).each(function(){if(typeof(this)==="object"){e.append(this.text)}else{e.append(this)}})}else{if(typeof(f)==="object"){e.append(f.text)}else{e.append(f)}}},select2QueryUrlResultsCallback:function(g,f,e){switch(g.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+g.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":c(this).data("select2").dropdown.hide();a.dialog.open(g.location);break;default:return{results:g.results||g,more:g.has_more||false,context:g.context}}},select2QueryMethodSuccessCallback:function(i,g,h){var f=i.result;if(typeof(f)==="string"){try{f=JSON.parse(f)}catch(j){}}switch(f.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+f.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":c(this).data("select2").dropdown.hide();a.dialog.open(f.location);break;default:h.callback({results:f.results||f,more:f.has_more||false,context:f.context})}},contextMenuHandler:function(h,i){var g=i.data();if(g.toggle==="modal"){a.dialog.open(i)}else{var f=i.attr("href")||g.amsUrl;if(!f||f.startsWith("javascript")||i.attr("target")){return}a.event.stop();var e=a.getFunctionByName(f);if(typeof(e)==="function"){f=e.call(i,h)}if(typeof(f)==="function"){f.call(i,h)}else{f=f.replace(/\%23/,"#");h=i.data("ams-target");if(h){a.form.confirmChangedForm(h,function(){a.skin.loadURL(f,h,i.data("ams-link-options"),i.data("ams-link-callback"))})}else{a.form.confirmChangedForm(function(){if(f.startsWith("#")){if(f!==location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=f},150)}else{window.location.hash=f}}}else{window.location=f}})}}}},datetimepickerDialogHiddenCallback:function(){c(".datepicker, .timepicker, .datetimepicker",this).datetimepicker("destroy")}};d.plugins={init:function(l){a.plugins.initData(l);var k=[];c("[data-ams-plugins-disabled]",l).each(function(){var q=c(this).data("ams-plugins-disabled").split(/\s+/);for(var r=0;r<q.length;r++){k.push(q[r])}});var i={};var f;function j(q,s){if(i.hasOwnProperty(q)){var r=i[q];r.css=r.css||s.css;r.callbacks.push({callback:s.callback,context:s.context});if(s.register){r.register=true}if(s.async===false){r.async=false}}else{i[q]={src:s.src,css:s.css,callbacks:[{callback:s.callback,context:s.context}],register:s.register,async:s.async}}if(s.css){a.getCSS(s.css,q+"_css")}}c("[data-ams-plugins]",l).each(function(){var t=c(this);var r=t.data("ams-plugins");if(typeof(r)==="string"){var u=t.data("ams-plugins").split(/\s+/);for(var q=0;q<u.length;q++){f=u[q];var s={src:t.data("ams-plugin-"+f+"-src"),css:t.data("ams-plugin-"+f+"-css"),callback:t.data("ams-plugin-"+f+"-callback"),context:t,register:t.data("ams-plugin-"+f+"-register"),async:t.data("ams-plugin-"+f+"-async")};j(f,s)}}else{for(f in r){if(!r.hasOwnProperty(f)){continue}j(f,r[f])}}});var m;function e(t){var r;var s=m.callbacks,u;if(s&&s.length){for(r=0;r<s.length;r++){u=s[r];u.callback=a.getFunctionByName(u.callback);if(m.register!==false){var q=a.plugins.enabled;if(q.hasOwnProperty(f)){q[f].push(u)}else{q[f]=[u]}}}}else{if(m.register!==false){a.plugins.enabled[f]=null}}if((t!==true)&&s&&s.length&&(m.async!==false)){for(r=0;r<s.length;r++){u=s[r];a.executeFunctionByName(u.callback,l,u.context)}}}function h(){var q=a.plugins.enabled[f];for(n=0;n<q.length;n++){var r=q[n];if(r&&r.context&&!a.isInDOM(r.context)){q[n]=null}}}for(f in i){if(!i.hasOwnProperty(f)){continue}m=i[f];if(a.plugins.enabled[f]===undefined){a.getScript(m.src,e,{async:m.async===undefined?true:m.async})}else{h();e(true)}}for(var n in a.plugins.enabled){if(!a.plugins.enabled.hasOwnProperty(n)){continue}if(k.indexOf(n)>=0){continue}var o=a.plugins.enabled[n];if(o){switch(typeof(o)){case"function":o(l);break;default:for(var g=0;g<o.length;g++){var p=o[g];switch(typeof(p)){case"function":p(l);break;default:if(p&&p.callback){p.callback(p.context)}}}}}}},initData:function(e){c("[data-ams-data]",e).each(function(){var f=c(this);var i=f.data("ams-data");if(i){for(var g in i){if(i.hasOwnProperty(g)){var h=i[g];if(typeof(h)!=="string"){h=JSON.stringify(h)}f.attr("data-"+g,h)}}}})},register:function(f,e,h){if(typeof(e)==="function"){h=e;e=null}e=e||f.name;if(a.plugins.enabled.indexOf(e)>=0){if(b.console){b.console.warn("Plugin "+e+" is already registered!")}return}if(typeof(f)==="object"){var g=f.src;if(g){a.ajax.check(f.callback,g,function(i){if(i){a.plugins.enabled[e]=a.getFunctionByName(f.callback);if(f.css){a.getCSS(f.css,e+"_css")}if(h){a.executeFunctionByName(h)}}})}else{a.plugins.enabled[e]=a.getFunctionByName(f.callback);if(f.css){a.getCSS(f.css,e+"_css")}if(h){a.executeFunctionByName(h)}}}else{if(typeof(f)==="function"){a.plugins.enabled[e]=f;if(h){a.executeFunctionByName(h)}}}},enabled:{hint:function(e){var f=c(".hint:not(:parents(.nohints))",e);if(f.length>0){a.ajax.check(c.fn.tipsy,a.baseURL+"ext/jquery-tipsy"+a.devext+".js",function(){a.getCSS(a.baseURL+"../css/ext/jquery-tipsy"+a.devext+".css","jquery-tipsy");f.each(function(){var j=c(this);var i=j.data();var k={html:i.amsHintHtml,title:a.getFunctionByName(i.amsHintTitleGetter)||function(){var l=c(this);return l.attr("original-title")||l.attr(i.amsHintTitleAttr||"title")||(i.amsHintHtml?l.html():l.text())},opacity:i.amsHintOpacity||0.95,gravity:i.amsHintGravity||"sw",offset:i.amsHintOffset||0};var g=c.extend({},k,i.amsHintOptions);g=a.executeFunctionByName(i.amsHintInitCallback,j,g)||g;var h=j.tipsy(g);a.executeFunctionByName(i.amsHintAfterInitCallback,j,h,g)})})}},contextMenu:function(e){var f=c(".context-menu",e);if(f.length>0){f.each(function(){var j=c(this);var i=j.data();var k={menuSelector:i.amsContextmenuSelector,menuSelected:a.helpers.contextMenuHandler};var g=c.extend({},k,i.amsContextmenuOptions);g=a.executeFunctionByName(i.amsContextmenuInitCallback,j,g)||g;var h=j.contextMenu(g);a.executeFunctionByName(i.amsContextmenuAfterInitCallback,j,h,g)})}},switcher:function(e){c("LEGEND.switcher",e).each(function(){var g=c(this);var f=g.parent("fieldset");var h=g.data();if(!h.amsSwitcher){c('<i class="fa fa-fw"></i>').prependTo(c(this)).addClass(h.amsSwitcherState==="open"?(h.amsSwitcherMinusClass||"fa-minus"):(h.amsSwitcherPlusClass||"fa-plus"));g.on("click",function(j){j.preventDefault();var i={};g.trigger("ams.switcher.before-switch",[g,i]);if(i.veto){return}if(f.hasClass("switched")){f.removeClass("switched");c(".fa",g).removeClass(h.amsSwitcherPlusClass||"fa-plus").addClass(h.amsSwitcherMinusClass||"fa-minus");g.trigger("ams.switcher.opened",[g]);var k=g.attr("id");if(k){c('legend.switcher[data-ams-switcher-sync="'+k+'"]',f).each(function(){var l=c(this);if(l.parents("fieldset").hasClass("switched")){l.click()}})}}else{f.addClass("switched");c(".fa",g).removeClass(h.amsSwitcherMinusClass||"fa-minus").addClass(h.amsSwitcherPlusClass||"fa-plus");g.trigger("ams.switcher.closed",[g])}});if(h.amsSwitcherState!=="open"){f.addClass("switched")}g.data("ams-switcher","on")}})},checker:function(e){c("LEGEND.checker",e).each(function(){var p=c(this);var r=p.parent("fieldset");var h=p.data();if(!h.amsChecker){var f=c('<label class="checkbox"></label>');var k=h.amsCheckerFieldname||("checker_"+a.generateId());var q=k.replace(/\./,"_");var i=h.amsCheckerHiddenPrefix;var j=null;var n=h.amsCheckerHiddenValueOn||"true";var l=h.amsCheckerHiddenValueOff||"false";var g=h.amsCheckerMarker||false;if(i){j=c('<input type="hidden">').attr("name",i+k).val(h.amsCheckerState==="on"?n:l).prependTo(p)}else{if(g){c('<input type="hidden">').attr("name",g).attr("value",1).prependTo(p)}}var o=c('<input type="checkbox">').attr("name",k).attr("id",q).data("ams-checker-hidden-input",j).data("ams-checker-init",true).val(h.amsCheckerValue||true).attr("checked",h.amsCheckerState==="on"?"checked":null);if(h.amsCheckerReadonly){o.attr("disabled","disabled")}else{o.on("change",function(u){u.preventDefault();var s={};var v=c(this).is(":checked");p.trigger("ams.checker.before-switch",[p,s]);if(s.veto){c(this).prop("checked",!v);return}a.executeFunctionByName(h.amsCheckerChangeHandler,p,v);if(!h.amsCheckerCancelDefault){var t=o.data("ams-checker-hidden-input");if(v){if(h.amsCheckerMode==="disable"){r.removeAttr("disabled")}else{r.removeClass("switched")}if(t){t.val(n)}c("[data-required]",r).attr("required","required");p.trigger("ams.checker.opened",[p])}else{if(h.amsCheckerMode==="disable"){r.prop("disabled","disabled")}else{r.addClass("switched")}if(t){t.val(l)}c("[data-required]",r).removeAttr("required");p.trigger("ams.checker.closed",[p])}}})}o.appendTo(f);c(">label",p).attr("for",o.attr("id"));f.append("<i></i>").prependTo(p);var m=c("[required]",r);m.attr("data-required",true);if(h.amsCheckerState==="on"){o.attr("checked",true)}else{if(h.amsCheckerMode==="disable"){r.attr("disabled","disabled")}else{r.addClass("switched")}m.removeAttr("required")}p.data("ams-checker","on")}})},slider:function(e){var f=c(".slider",e);if(f.length>0){a.ajax.check(c.fn.slider,a.baseURL+"ext/bootstrap-slider-2.0.0"+a.devext+".js",function(){f.each(function(){var i=c(this);var j=i.data();var k={};var g=c.extend({},k,i.data.amsSliderOptions);g=a.executeFunctionByName(j.amsSliderInitCallback,i,g)||g;var h=i.slider(g);a.executeFunctionByName(j.amsSliderAfterInitCallback,i,h,g)})})}},draggable:function(f){var e=c(".draggable",f);if(e.length>0){e.each(function(){var g=c(this);var j=g.data();var k={containment:j.amsDraggableContainment,helper:a.getFunctionByName(j.amsDraggableHelper)||j.amsDraggableHelper,start:a.getFunctionByName(j.amsDraggableStart),stop:a.getFunctionByName(j.amsDraggableStop)};var h=c.extend({},k,j.amsDraggableOptions);h=a.executeFunctionByName(j.amsDraggableInitCallback,g,h)||h;var i=g.draggable(h);g.disableSelection();a.executeFunctionByName(j.amsDraggableAfterInitCallback,g,i,h)})}},sortable:function(e){var f=c(".sortable",e);if(f.length>0){f.each(function(){var k=c(this);var i=k.data();var j={items:i.amsSortableItems,handle:i.amsSortableHandle,connectWith:i.amsSortableConnectwith,start:a.getFunctionByName(i.amsSortableStart),over:a.getFunctionByName(i.amsSortableOver),containment:i.amsSortableContainment,placeholder:i.amsSortablePlaceholder,stop:a.getFunctionByName(i.amsSortableStop)};var g=c.extend({},j,i.amsSortableOptions);g=a.executeFunctionByName(i.amsSortableInitCallback,k,g)||g;var h=k.sortable(g);k.disableSelection();a.executeFunctionByName(i.amsSortableAfterInitCallback,k,h,g)})}},resizable:function(f){var e=c(".resizable",f);if(e.length>0){e.each(function(){var g=c(this);var j=g.data();var k={autoHide:j.amsResizableAutohide===false?true:j.amsResizableAutohide,containment:j.amsResizableContainment,grid:j.amsResizableGrid,handles:j.amsResizableHandles,start:a.getFunctionByName(j.amsResizableStart),stop:a.getFunctionByName(j.amsResizableStop)};var h=c.extend({},k,j.amsResizableOptions);h=a.executeFunctionByName(j.amsResizableInitCallback,g,h)||h;var i=g.resizable(h);g.disableSelection();a.executeFunctionByName(j.amsResizableAfterInitCallback,g,i,h)})}},typeahead:function(f){var e=c(".typeahead",f);if(e.length>0){a.ajax.check(c.fn.typeahead,a.baseURL+"ext/jquery-typeahead"+a.devext+".js",function(){e.each(function(){var g=c(this);var j=g.data();var k={};var h=c.extend({},k,j.amsTypeaheadOptions);h=a.executeFunctionByName(j.amsTypeaheadInitCallback,g,h)||h;var i=g.typeahead(h);a.executeFunctionByName(j.amsTypeaheadAfterInitCallback,g,i,h)})})}},select2:function(f){var e=c(".select2",f);if(e.length>0){a.ajax.check(c.fn.select2,a.baseURL+"ext/jquery-select2-3.5.2"+a.devext+".js",function(){e.each(function(){var g=c(this);var k=g.data();var l={placeholder:k.amsSelect2Placeholder,multiple:k.amsSelect2Multiple,minimumInputLength:k.amsSelect2MinimumInputLength||0,maximumSelectionSize:k.amsSelect2MaximumSelectionSize,openOnEnter:k.amsSelect2EnterOpen===undefined?true:k.amsSelect2EnterOpen,allowClear:k.amsSelect2AllowClear===undefined?true:k.amsSelect2AllowClear,width:k.amsSelect2Width||"100%",initSelection:a.getFunctionByName(k.amsSelect2InitSelection),formatSelection:k.amsSelect2FormatSelection===undefined?a.helpers.select2FormatSelection:a.getFunctionByName(k.amsSelect2FormatSelection),formatResult:a.getFunctionByName(k.amsSelect2FormatResult),formatMatches:k.amsSelect2FormatMatches===undefined?function(m){if(m===1){return a.i18n.SELECT2_MATCH}else{return m+a.i18n.SELECT2_MATCHES}}:a.getFunctionByName(k.amsSelect2FormatMatches),formatNoMatches:k.amsSelect2FormatResult===undefined?function(m){return a.i18n.SELECT2_NOMATCHES}:a.getFunctionByName(k.amsSelect2FormatResult),formatInputTooShort:k.amsSelect2FormatInputTooShort===undefined?function(m,o){var p=o-m.length;return a.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,p).replace(/\{1\}/,p===1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(k.amsSelect2FormatInputTooShort),formatInputTooLong:k.amsSelect2FormatInputTooLong===undefined?function(o,m){var p=o.length-m;return a.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,p).replace(/\{1\}/,p===1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(k.amsSelect2FormatInputTooLong),formatSelectionTooBig:k.amsSelect2FormatSelectionTooBig===undefined?function(m){return a.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,m).replace(/\{1\}/,m===1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(k.amsSelect2FormatSelectionTooBig),formatLoadMore:k.amsSelect2FormatLoadMore===undefined?function(m){return a.i18n.SELECT2_LOADMORE}:a.getFunctionByName(k.amsSelect2FormatLoadMore),formatSearching:k.amsSelect2FormatSearching===undefined?function(){return a.i18n.SELECT2_SEARCHING}:a.getFunctionByName(k.amsSelect2FormatSearching),separator:k.amsSelect2Separator||",",tokenSeparators:k.amsSelect2TokensSeparators||[","],tokenizer:a.getFunctionByName(k.amsSelect2Tokenizer)};switch(g.context.type){case"text":case"hidden":if(!l.initSelection){var h=g.data("ams-select2-values");if(h){l.initSelection=function(m,o){var n=[];c(m.val().split(l.separator)).each(function(){n.push({id:this,text:h[this]||this})});o(n)}}}break;default:break}if(g.attr("readonly")){if(g.attr("type")==="hidden"){l.query=function(){return[]}}}else{if(k.amsSelect2Query){l.query=a.getFunctionByName(k.amsSelect2Query);l.minimumInputLength=k.amsSelect2MinimumInputLength||1}else{if(k.amsSelect2QueryUrl){l.ajax={url:k.amsSelect2QueryUrl,quietMillis:k.amsSelect2QuietMillis||200,type:k.amsSelect2QueryType||"POST",dataType:k.amsSelect2QueryDatatype||"json",data:function(o,p,n){var m={};m[k.amsSelect2QueryParamName||"query"]=o;m[k.amsSelect2PageParamName||"page"]=p;m[k.amsSelect2ContextParamName||"context"]=n;return c.extend({},m,k.amsSelect2QueryOptions)},results:a.helpers.select2QueryUrlResultsCallback};l.minimumInputLength=k.amsSelect2MinimumInputLength||1}else{if(k.amsSelect2QueryMethod){l.query=function(m){var n={id:new Date().getTime(),params:k.amsSelect2QueryParams||{},success:function(o){return a.helpers.select2QueryMethodSuccessCallback.call(g,o,"success",m)},error:a.error.show};n.params[k.amsSelect2QueryParamName||"query"]=m.term;n.params[k.amsSelect2PageParamName||"page"]=m.page;n.params[k.amsSelect2ContextParamName||"context"]=m.context;n=c.extend({},n,k.amsSelect2QueryOptions);n=a.executeFunctionByName(k.amsSelect2QueryInitCallback,g,n)||n;a.ajax.check(c.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){c.jsonRPC.withOptions({endPoint:k.amsSelect2MethodTarget||a.jsonrpc.getAddr(),namespace:k.amsSelect2MethodNamespace,cache:false},function(){c.jsonRPC.request(k.amsSelect2QueryMethod,n)})})};l.minimumInputLength=k.amsSelect2MinimumInputLength||1}else{if(k.amsSelect2Tags){l.tags=k.amsSelect2Tags}else{if(k.amsSelect2Data){l.data=k.amsSelect2Data}}}}}}if(k.amsSelect2EnableFreeTags){l.createSearchChoice=function(m){return{id:m,text:(k.amsSelect2FreeTagsPrefix||a.i18n.SELECT2_FREETAG_PREFIX)+m}}}var i=c.extend({},l,k.amsSelect2Options);i=a.executeFunctionByName(k.amsSelect2InitCallback,g,i)||i;var j=g.select2(i);a.executeFunctionByName(k.amsSelect2AfterInitCallback,g,j,i);if(g.hasClass("ordered")){a.ajax.check(c.fn.select2Sortable,a.baseURL+"ext/jquery-select2-sortable"+a.devext+".js",function(){g.select2Sortable({bindOrder:"sortableStop"})})}g.on("change",function(){var m=c(g.get(0).form).data("validator");if(m!==undefined){c(g).valid()}})})})}},maskedit:function(f){var e=c("[data-mask]",f);if(e.length>0){a.ajax.check(c.fn.mask,a.baseURL+"ext/jquery-maskedinput-1.4.1"+a.devext+".js",function(){e.each(function(){var g=c(this);var j=g.data();var k={placeholder:j.amsMaskeditPlaceholder===undefined?"X":j.amsMaskeditPlaceholder,complete:a.getFunctionByName(j.amsMaskeditComplete)};var h=c.extend({},k,j.amsMaskeditOptions);h=a.executeFunctionByName(j.amsMaskeditInitCallback,g,h)||h;var i=g.mask(g.attr("data-mask"),h);a.executeFunctionByName(j.amsMaskeditAfterInitCallback,g,i,h)})})}},inputmask:function(f){var e=c("[data-input-mask]",f);if(e.length>0){a.ajax.check(c.fn.inputmask,a.baseURL+"ext/jquery-inputmask-bundle-3.2.8"+a.devext+".js",function(){e.each(function(){var g=c(this);var j=g.data();var k;if(typeof(j.inputMask)==="object"){k=j.inputMask}else{k={mask:j.inputMask.toString()}}var h=c.extend({},k,j.amsInputmaskOptions);h=a.executeFunctionByName(j.amsInputmaskInitCallback,g,h)||h;var i=g.inputmask(h);a.executeFunctionByName(j.amsInputmaskAfterInitCallback,g,i,h)})})}},datepicker:function(e){var f=c(".datepicker",e);if(f.length>0){a.ajax.check(c.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(g){if(g){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}f.each(function(){var h=c(this);var k=h.data();var l={lang:k.amsDatetimepickerLang||a.lang,format:k.amsDatetimepickerFormat||"d/m/y",datepicker:true,dayOfWeekStart:1,timepicker:false};var i=c.extend({},l,k.amsDatetimepickerOptions);i=a.executeFunctionByName(k.amsDatetimepickerInitCallback,h,i)||i;var j=h.datetimepicker(i);a.executeFunctionByName(k.amsDatetimepickerAfterInitCallback,h,j,i)})})}},datetimepicker:function(f){var e=c(".datetimepicker",f);if(e.length>0){a.ajax.check(c.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(g){if(g){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}e.each(function(){var h=c(this);var k=h.data();var l={lang:k.amsDatetimepickerLang||a.lang,format:k.amsDatetimepickerFormat||"d/m/y H:i",datepicker:true,dayOfWeekStart:1,timepicker:true};var i=c.extend({},l,k.amsDatetimepickerOptions);i=a.executeFunctionByName(k.amsDatetimepickerInitCallback,h,i)||i;var j=h.datetimepicker(i);a.executeFunctionByName(k.amsDatetimepickerAfterInitCallback,h,j,i)})})}},timepicker:function(f){var e=c(".timepicker",f);if(e.length>0){a.ajax.check(c.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(g){if(g){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}e.each(function(){var h=c(this);var k=h.data();var l={lang:k.amsDatetimepickerLang||a.lang,format:k.amsDatetimepickerFormat||"H:i",datepicker:false,timepicker:true};var i=c.extend({},l,k.amsDatetimepickerOptions);i=a.executeFunctionByName(k.amsDatetimepickerInitCallback,h,i)||i;var j=h.datetimepicker(i);a.executeFunctionByName(k.amsDatetimepickerAfterInitCallback,h,j,i)})})}},colorpicker:function(e){var f=c(".colorpicker",e);if(f.length>0){a.ajax.check(c.fn.minicolors,a.baseURL+"ext/jquery-minicolors"+a.devext+".js",function(g){if(g){a.getCSS(a.baseURL+"../css/ext/jquery-minicolors"+a.devext+".css","jquery-minicolors")}f.each(function(){var h=c(this);var k=h.data();var l={position:k.amsColorpickerPosition||h.closest("label.input").data("ams-colorpicker-position")||"bottom left"};var i=c.extend({},l,k.amsColorpickerOptions);i=a.executeFunctionByName(k.amsColorpickerInitCallback,h,i)||i;var j=h.minicolors(i);a.executeFunctionByName(k.amsDatetimepickerAfterInitCallback,h,j,i)})})}},validate:function(f){var e=c("FORM:not([novalidate])",f);if(e.length>0){a.ajax.check(c.fn.validate,a.baseURL+"ext/jquery-validate-1.11.1"+a.devext+".js",function(i){if(i){c.validator.setDefaults({highlight:function(j){c(j).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(j){c(j).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(k,l){var j=l.parents("label:first");if(j.length){k.insertAfter(j)}else{k.insertAfter(l)}}});if(a.plugins.i18n){for(var g in a.plugins.i18n.validate){if(!a.plugins.i18n.validate.hasOwnProperty(g)){continue}var h=a.plugins.i18n.validate[g];if((typeof(h)==="string")&&(h.indexOf("{0}")>-1)){a.plugins.i18n.validate[g]=c.validator.format(h)}}c.extend(c.validator.messages,a.plugins.i18n.validate)}}e.each(function(){var l=c(this);var m=l.data();var n={ignore:null,submitHandler:l.attr("data-async")!==undefined?m.amsFormSubmitHandler===undefined?function(){c(".state-error",l).removeClass("state-error");a.ajax.check(c.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+a.devext+".js");return a.form.submit(l)}:a.getFunctionByName(m.amsFormSubmitHandler):undefined,invalidHandler:l.attr("data-async")!==undefined?m.amsFormInvalidHandler===undefined?function(t,s){c(".state-error",l).removeClass("state-error");for(var r=0;r<s.errorList.length;r++){var q=s.errorList[r];var p=c(q.element).parents(".tab-pane").index()+1;if(p>0){var o=c(".nav-tabs",c(q.element).parents(".tabforms"));c("li:nth-child("+p+")",o).removeClassPrefix("state-").addClass("state-error");c("li.state-error:first a",o).click()}}}:a.getFunctionByName(m.amsFormInvalidHandler):undefined};c("[data-ams-validate-rules]",l).each(function(o){if(o===0){n.rules={}}n.rules[c(this).attr("name")]=c(this).data("ams-validate-rules")});var j=c.extend({},n,m.amsValidateOptions);j=a.executeFunctionByName(m.amsValidateInitCallback,l,j)||j;var k=l.validate(j);a.executeFunctionByName(m.amsValidateAfterInitCallback,l,k,j)})})}},datatable:function(f){var e=c(".datatable",f);if(e.length>0){a.ajax.check(c.fn.dataTable,a.baseURL+"ext/jquery-dataTables-1.9.4"+a.devext+".js",function(g){a.ajax.check(c.fn.dataTableExt.oPagination.bootstrap_full,a.baseURL+"myams-dataTables"+a.devext+".js",function(){c(e).each(function(){var v=c(this);var A=v.data();var x=(A.amsDatatableExtensions||"").split(/\s+/);var n=A.amsDatatableSdom||"W"+((x.indexOf("colreorder")>=0||x.indexOf("colreorderwithresize")>=0)?"R":"")+"<'dt-top-row'"+(x.indexOf("colvis")>=0?"C":"")+((A.amsDatatablePagination===false||A.amsDatatablePaginationSize===false)?"":"L")+(A.amsDatatableGlobalFilter===false?"":"F")+">r<'dt-wrapper't"+(x.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(A.amsDatatableInformation===false?"":"i")+"><'col-sm-6 text-right'p>>";var p;var k=A.amsDatatableSorting;if(typeof(k)==="string"){var y=k.split(";");k=[];for(p=0;p<y.length;p++){var i=y[p].split(",");i[0]=parseInt(i[0]);k.push(i)}}var j=[];var m;var u=c("th",v).listattr("data-ams-datatable-sortable");for(p=0;p<u.length;p++){var l=u[p];if(l!==undefined){m=j[p]||{};m.bSortable=l;j[p]=m}}var r=c("th",v).listattr("data-ams-datatable-stype");for(p=0;p<r.length;p++){var o=r[p];if(o){m=j[p]||{};m.sType=o;j[p]=m}}var s={bJQueryUI:false,bFilter:A.amsDatatableGlobalFilter!==false||x.indexOf("columnfilter")>=0,bPaginate:A.amsDatatablePagination!==false,bInfo:A.amsDatatableInfo!==false,bSort:A.amsDatatableSort!==false,aaSorting:k,aoColumns:j.length>0?j:undefined,bDeferRender:true,bAutoWidth:false,iDisplayLength:A.amsDatatableDisplayLength||25,sPaginationType:A.amsDatatablePaginationType||"bootstrap_full",sDom:n,oLanguage:a.plugins.i18n.datatables,fnInitComplete:function(C,B){c(".ColVis_Button").addClass("btn btn-default btn-sm").html((a.plugins.i18n.datatables.sColumns||"Columns")+' <i class="fa fa-fw fa-caret-down"></i>')}};var w=c.extend({},s,A.amsDatatableOptions);var q=[];var h=[];var z=[];if(x.length>0){for(p=0;p<x.length;p++){switch(x[p]){case"autofill":q.push(c.fn.dataTable.AutoFill);h.push(a.baseURL+"ext/jquery-dataTables-autoFill"+a.devext+".js");break;case"columnfilter":q.push(c.fn.columnFilter);h.push(a.baseURL+"ext/jquery-dataTables-columnFilter"+a.devext+".js");break;case"colreorder":q.push(c.fn.dataTable.ColReorder);h.push(a.baseURL+"ext/jquery-dataTables-colReorder"+a.devext+".js");break;case"colreorderwithresize":q.push(window.ColReorder);h.push(a.baseURL+"ext/jquery-dataTables-colReorderWithResize"+a.devext+".js");break;case"colvis":q.push(c.fn.dataTable.ColVis);h.push(a.baseURL+"ext/jquery-dataTables-colVis"+a.devext+".js");z.push(function(){var B={activate:"click",sAlign:"right"};w.oColVis=c.extend({},B,A.amsDatatableColvisOptions)});break;case"editable":q.push(c.fn.editable);h.push(a.baseURL+"ext/jquery-jeditable"+a.devext+".js");q.push(c.fn.makeEditable);h.push(a.baseURL+"ext/jquery-dataTables-editable"+a.devext+".js");break;case"fixedcolumns":q.push(c.fn.dataTable.FixedColumns);h.push(a.baseURL+"ext/jquery-dataTables-fixedColumns"+a.devext+".js");break;case"fixedheader":q.push(c.fn.dataTable.Fixedheader);h.push(a.baseURL+"ext/jquery-dataTables-fixedHeader"+a.devext+".js");break;case"keytable":q.push(window.keyTable);h.push(a.baseURL+"ext/jquery-dataTables-keyTable"+a.devext+".js");break;case"rowgrouping":q.push(c.fn.rowGrouping());h.push(a.baseURL+"ext/jquery-dataTables-rowGrouping"+a.devext+".js");break;case"rowreordering":q.push(c.fn.rowReordering);h.push(a.baseURL+"ext/jquery-dataTables-rowReordering"+a.devext+".js");break;case"scroller":q.push(c.fn.dataTable.Scroller);h.push(a.baseURL+"ext/jquery-dataTables-scroller"+a.devext+".js");break;default:break}}}function t(){w=a.executeFunctionByName(A.amsDatatableInitCallback,v,w)||w;try{var E=v.dataTable(w);a.executeFunctionByName(A.amsDatatableAfterInitCallback,v,E,w);if(x.length>0){for(p=0;p<x.length;p++){switch(x[p]){case"autofill":var M=c.extend({},A.amsDatatableAutofillOptions,w.autofill);M=a.executeFunctionByName(A.amsDatatableAutofillInitCallback,v,M)||M;v.data("ams-autofill",A.amsDatatableAutofillConstructor===undefined?new c.fn.dataTable.AutoFill(v,M):a.executeFunctionByName(A.amsDatatableAutofillConstructor,v,E,M));break;case"columnfilter":var K={sPlaceHolder:"head:after"};var H=c.extend({},K,A.amsDatatableColumnfilterOptions,w.columnfilter);H=a.executeFunctionByName(A.amsDatatableColumnfilterInitCallback,v,H)||H;v.data("ams-columnfilter",A.amsDatatableColumnfilterConstructor===undefined?E.columnFilter(H):a.executeFunctionByName(A.amsDatatableColumnfilterConstructor,v,E,H));break;case"editable":var I=c.extend({},A.amsDatatableEditableOptions,w.editable);I=a.executeFunctionByName(A.amsDatatableEditableInitCallback,v,I)||I;v.data("ams-editable",A.amsDatatableEditableConstructor===undefined?v.makeEditable(I):a.executeFunctionByName(A.amsDatatableEditableConstructor,v,E,I));break;case"fixedcolumns":var N=c.extend({},A.amsDatatableFixedcolumnsOptions,w.fixedcolumns);N=a.executeFunctionByName(A.amsDatatableFixedcolumnsInitCallback,v,N)||N;v.data("ams-fixedcolumns",A.amsDatatableFixedcolumnsConstructor===undefined?new c.fn.dataTable.FixedColumns(v,N):a.executeFunctionByName(A.amsDatatableFixedcolumnsConstructor,v,E,N));break;case"fixedheader":var J=c.extend({},A.amsDatatableFixedheaderOptions,w.fixedheader);J=a.executeFunctionByName(A.amsDatatableFixedheadeInitCallback,v,J)||J;v.data("ams-fixedheader",A.amsDatatableFixedheaderConstructor===undefined?new c.fn.dataTable.FixedHeader(v,J):a.executeFunctionByName(A.amsDatatableFixedheaderConstructor,v,E,J));break;case"keytable":var L={table:v.get(0),datatable:E};var C=c.extend({},L,A.amsDatatableKeytableOptions,w.keytable);C=a.executeFunctionByName(A.amsDatatableKeytableInitCallback,v,C)||C;v.data("ams-keytable",A.amsDatatableKeytableConstructor===undefined?new KeyTable(C):a.executeFunctionByName(A.amsDatatableKeytableConstructor,v,E,C));break;case"rowgrouping":var D=c.extend({},A.amsDatatableRowgroupingOptions,w.rowgrouping);D=a.executeFunctionByName(A.amsDatatableRowgroupingInitCallback,v,D)||D;v.data("ams-rowgrouping",A.amsDatatableRowgroupingConstructor===undefined?v.rowGrouping(D):a.executeFunctionByName(A.amsDatatableRowgroupingConstructor,v,E,D));break;case"rowreordering":var B=c.extend({},A.amsDatatableRowreorderingOptions,w.rowreordering);B=a.executeFunctionByName(A.amsDatatableRowreorderingInitCallback,v,B)||B;v.data("ams-rowreordering",A.amsDatatableRowreorderingConstructor===undefined?v.rowReordering(B):a.executeFunctionByName(A.amsDatatableRowreorderingConstructor,v,E,B));break;default:break}}}if(A.amsDatatableFinalizeCallback){var G=A.amsDatatableFinalizeCallback.split(/\s+/);if(G.length>0){for(p=0;p<G.length;p++){a.executeFunctionByName(G[p],v,E,w)}}}}catch(F){}}z.push(t);a.ajax.check(q,h,z)})})})}},wizard:function(e){var f=c(".wizard",e);if(f.length>0){a.ajax.check(c,a.baseURL+"ext/bootstrap-wizard-1.4.2"+a.devext+".js",function(g){f.each(function(){var k=c(this);var j=k.data();var l={withVisible:j.amsWizardWithVisible===undefined?true:j.amsWizardWithVisible,tabClass:j.amsWizardTabClass,firstSelector:j.amsWizardFirstSelector,previousSelector:j.amsWizardPreviousSelector,nextSelector:j.amsWizardNextSelector,lastSelector:j.amsWizardLastSelector,finishSelector:j.amsWizardFinishSelector,backSelector:j.amsWizardBackSelector,onInit:a.getFunctionByName(j.amsWizardInit),onShow:a.getFunctionByName(j.amsWizardShow),onNext:a.getFunctionByName(j.amsWizardNext),onPrevious:a.getFunctionByName(j.amsWizardPrevious),onFirst:a.getFunctionByName(j.amsWizardFirst),onLast:a.getFunctionByName(j.amsWizardLast),onBack:a.getFunctionByName(j.amsWizardBack),onFinish:a.getFunctionByName(j.amsWizardFinish),onTabChange:a.getFunctionByName(j.amsWizardTabChange),onTabClick:a.getFunctionByName(j.amsWizardTabClick),onTabShow:a.getFunctionByName(j.amsWizardTabShow)};var h=c.extend({},l,j.amsWizardOptions);h=a.executeFunctionByName(j.amsWizardInitCallback,k,h)||h;var i=k.bootstrapWizard(h);a.executeFunctionByName(j.amsWizardAfterInitCallback,k,i,h)})})}},tablednd:function(f){var e=c(".table-dnd",f);if(e.length>0){a.ajax.check(c.fn.tableDnD,a.baseURL+"ext/jquery-tablednd"+a.devext+".js",function(g){e.each(function(){var j=c(this);var k=j.data();if(k.amsTabledndDragHandle){c("tr",j).addClass("no-drag-handle")}else{c(j).on("mouseover","tr",function(){c(this.cells[0]).addClass("drag-handle")}).on("mouseout","tr",function(){c(this.cells[0]).removeClass("drag-handle")})}var l={onDragClass:k.amsTabledndDragClass||"dragging-row",onDragStart:a.getFunctionByName(k.amsTabledndDragStart),dragHandle:k.amsTabledndDragHandle,scrollAmount:k.amsTabledndScrollAmount,onAllowDrop:k.amsTabledndAllowDrop,onDrop:a.getFunctionByName(k.amsTabledndDrop)||function(p,q){var o=k.amsTabledndDropTarget;if(o){c(q).data("ams-disabled-handlers","click");var m=[];c(p.rows).each(function(){var r=c(this).data("ams-element-name");if(r){m.push(r)}});var n=a.getFunctionByName(o);if(typeof(n)==="function"){n.call(j,p,m)}else{a.ajax.post(o,{names:JSON.stringify(m)})}setTimeout(function(){c(q).removeData("ams-disabled-handlers")},50)}return false}};var h=c.extend({},l,k.amsTabledndOptions);h=a.executeFunctionByName(k.amsTabledndInitCallback,j,h)||h;var i=j.tableDnD(h);a.executeFunctionByName(k.amsTabledndAfterInitCallback,j,i,h)})})}},tinymce:function(e){function h(){c(".tinymce",c(this)).each(function(){var i=tinymce.get(c(this).attr("id"));if(i){i.remove()}})}var f=c(".tinymce",e);if(f.length>0){var g=a.baseURL+"ext/tinymce"+(a.devmode?"/dev":"");a.ajax.check(window.tinymce,g+"/tinymce"+a.devext+".js",function(i){if(i){a.getScript(g+"/jquery.tinymce"+a.devext+".js");tinymce.baseURL=g;tinymce.suffix=a.devext;a.skin.registerCleanCallback(h)}f.each(function(){var m=c(this);var o=m.data();var q={theme:"modern",language:a.lang,plugins:["advlist autosave autolink lists link image charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code","insertdatetime media nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern"],toolbar1:"newdocument undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",toolbar2:"print preview media | forecolor backcolor emoticons | code",content_css:o.amsTinymceContentCss,formats:o.amsTinymceFormats,style_formats:o.amsTinymceStyleFormats,block_formats:o.amsTinymceBlockFormats,valid_classes:o.amsTinymceValidClasses,image_advtab:true,image_list:a.getFunctionByName(o.amsTinymceImageList)||o.amsTinymceImageList,image_class_list:o.amsTinymceImageClassList,link_list:a.getFunctionByName(o.amsTinymceLinkList)||o.amsTinymceLinkList,link_class_list:o.amsTinymceLinkClassList,resize:true};if(o.amsTinymceExternalPlugins){var p=o.amsTinymceExternalPlugins.split(/\s+/);for(var k in p){var j=m.data("ams-tinymce-plugin-"+p[k]);tinymce.PluginManager.load(p[k],a.getSource(j))}}var l=c.extend({},q,o.amsTinymceOptions);l=a.executeFunctionByName(o.amsTinymceInitCallback,m,l)||l;var n=m.tinymce(l);a.executeFunctionByName(o.amsTinymceAfterInitCallback,m,n,l)})})}},imgareaselect:function(f){var e=c(".imgareaselect",f);if(e.length>0){a.ajax.check(c.fn.imgAreaSelect,a.baseURL+"ext/jquery-imgareaselect-0.9.11-rc1"+a.devext+".js",function(g){if(g){a.getCSS(a.baseURL+"../css/ext/jquery-imgareaselect"+a.devext+".css")}e.each(function(){var l=c(this);var k=l.data();var i=k.amsImgareaselectParent?l.parents(k.amsImgareaselectParent):"body";var m={instance:true,handles:true,parent:i,x1:k.amsImgareaselectX1||0,y1:k.amsImgareaselectY1||0,x2:k.amsImgareaselectX2||k.amsImgareaselectImageWidth,y2:k.amsImgareaselectY2||k.amsImgareaselectImageHeight,imageWidth:k.amsImgareaselectImageWidth,imageHeight:k.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:k.amsImgareaselectRatio,onSelectEnd:a.getFunctionByName(k.amsImgareaselectSelectEnd)||function(n,o){var p=k.amsImgareaselectTargetField||"image_";c('input[name="'+p+'x1"]',i).val(o.x1);c('input[name="'+p+'y1"]',i).val(o.y1);c('input[name="'+p+'x2"]',i).val(o.x2);c('input[name="'+p+'y2"]',i).val(o.y2)}};var h=c.extend({},m,k.amsImgareaselectOptions);h=a.executeFunctionByName(k.amsImgareaselectInitCallback,l,h)||h;var j=l.imgAreaSelect(h);a.executeFunctionByName(k.amsImgareaselectAfterInitCallback,l,j,h);setTimeout(function(){j.update()},250)})})}},fancybox:function(e){var f=c(".fancybox",e);if(f.length>0){a.ajax.check(c.fn.fancybox,a.baseURL+"ext/jquery-fancybox-2.1.5"+a.devext+".js",function(g){if(g){a.getCSS(a.baseURL+"../css/ext/jquery-fancybox-2.1.5"+a.devext+".css")}f.each(function(){var h=c(this);var n=h.data();var m=(n.amsFancyboxHelpers||"").split(/\s+/);if(m.length>0){for(var i=0;i<m.length;i++){var l=m[i];switch(l){case"buttons":a.ajax.check(c.fancybox.helpers.buttons,a.baseURL+"ext/fancybox-helpers/fancybox-buttons"+a.devext+".js");break;case"thumbs":a.ajax.check(c.fancybox.helpers.thumbs,a.baseURL+"ext/fancybox-helpers/fancybox-thumbs"+a.devext+".js");break;case"media":a.ajax.check(c.fancybox.helpers.media,a.baseURL+"ext/fancybox-helpers/fancybox-media"+a.devext+".js");break;default:break}}}var o={type:n.amsFancyboxType,padding:n.amsFancyboxPadding||10,margin:n.amsFancyboxMargin||10,beforeLoad:a.getFunctionByName(n.amsFancyboxBeforeLoad)||function(){this.title=a.executeFunctionByName(n.amsFancyboxTitleGetter,this)||c(this.element).attr("original-title")||c(this.element).attr("title")},helpers:{title:{type:"inside"}}};var j=c.extend({},o,n.amsFancyboxOptions);j=a.executeFunctionByName(n.amsFancyboxInitCallback,h,j)||j;var k=h.fancybox(j);a.executeFunctionByName(n.amsFancyboxAfterInitCallback,h,k,j)})})}},chart:function(e){var f=c(".chart",e);if(f.length>0){a.ajax.check(c.fn.plot,a.baseURL+"flot/jquery.flot"+a.devext+".js",function(){f.each(function(){function l(s){for(var r in c.plot.plugins){var q=c.plot.plugins[r];if(q.name==s){return q}}return null}var o=c(this);var j=o.data();var p={};var h=(j.amsChartPlugins||"").split(/\s+/);if(h.length>0){for(var m in h){var n=h[m];if(!l(n)){a.getScript(a.baseURL+"flot/jquery.flot."+n+a.devext+".js")}}}var g=c.extend({},p,j.amsChartOptions);g=a.executeFunctionByName(j.amsChartInitCallback,o,g)||g;var i=j.amsChartData;i=a.executeFunctionByName(j.amsChartInitData,o,i)||i;var k=o.plot(i,g);a.executeFunctionByName(j.amsChartAfterInitCallback,o,k,g)})})}},graphs:function(f){var e=c(".sparkline",f);if(e.length>0){a.ajax.check(a.graphs,a.baseURL+"myams-graphs"+a.devext+".js",function(){a.graphs.init(e)})}},scrollbars:function(e){var f=c(".scrollbar",e);if(f.length>0){a.ajax.check(c.event.special.mousewheel,a.baseURL+"ext/jquery-mousewheel.min.js",function(){a.ajax.check(c.fn.mCustomScrollbar,a.baseURL+"ext/jquery-mCustomScrollbar"+a.devext+".js",function(g){if(g){a.getCSS(a.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar")}f.each(function(){var l=c(this);var j=l.data();var k={theme:j.amsScrollbarTheme||"light"};var h=c.extend({},k,j.amsScrollbarOptions);h=a.executeFunctionByName(j.amsScrollbarInitCallback,l,h)||h;var i=l.mCustomScrollbar(h);a.executeFunctionByName(j.amsScrollbarAfterInitCallback,l,i,h)})})})}}}};d.callbacks={init:function(e){c("[data-ams-callback]",e).each(function(){var f=this;var g=c(f).data();var h=a.getFunctionByName(g.amsCallback);if(h===undefined){if(g.amsCallbackSource){a.getScript(g.amsCallbackSource,function(){a.executeFunctionByName(g.amsCallback,f,g.amsCallbackOptions)})}else{if(b.console){b.console.warn("Undefined callback: "+g.amsCallback)}}}else{h.call(f,g.amsCallbackOptions)}})},alert:function(m){var h=c(this).data();var e=c.extend({},m,h.amsAlertOptions);var k=c(h.amsAlertParent||e.parent||this);var g=h.amsAlertStatus||e.status||"info";var i=h.amsAlertHeader||e.header;var l=h.amsAlertMessage||e.message;var j=h.amsAlertSubtitle||e.subtitle;var f=h.amsAlertMargin===undefined?(e.margin===undefined?false:e.margin):h.amsAlertMargin;a.skin.alert(k,g,i,l,j,f)},messageBox:function(f){var h=c(this).data();var j=c.extend({},f,h.amsMessageboxOptions);var g=c.extend({},j,{title:h.amsMessageboxTitle||j.title||"",content:h.amsMessageboxContent||j.content||"",icon:h.amsMessageboxIcon||j.icon,number:h.amsMessageboxNumber||j.number,timeout:h.amsMessageboxTimeout||j.timeout});var e=h.amsMessageboxStatus||j.status||"info";var i=a.getFunctionByName(h.amsMessageboxCallback||j.callback);a.skin.messageBox(e,g,i)},smallBox:function(f){var h=c(this).data();var j=c.extend({},f,h.amsSmallboxOptions);var g=c.extend({},j,{title:h.amsSmallboxTitle||j.title||"",content:h.amsSmallboxContent||j.content||"",icon:h.amsSmallboxIcon||j.icon,iconSmall:h.amsSmallboxIconSmall||j.iconSmall,timeout:h.amsSmallboxTimeout||j.timeout});var e=h.amsSmallboxStatus||j.status||"info";var i=a.getFunctionByName(h.amsSmallboxCallback||j.callback);a.skin.smallBox(e,g,i)}};d.events={init:function(e){c("[data-ams-events-handlers]",e).each(function(){var g=c(this);var f=g.data("ams-events-handlers");if(f){for(var h in f){if(f.hasOwnProperty(h)){g.on(h,a.getFunctionByName(f[h]))}}}})}};d.container={changeOrder:function(f,g){var e=c('input[name="'+c(this).data("ams-input-name")+'"]',c(this));e.val(g.join(";"))},deleteElement:function(e){return function(){var f=c(this);d.skin.bigBox({title:a.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i> '+a.i18n.DELETE_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(i){if(i===a.i18n.BTN_OK){var j=f.parents("table");var g=j.data("ams-location")||"";var k=f.parents("tr");var h=k.data("ams-delete-target")||j.data("ams-delete-target")||"delete-element.json";var l=k.data("ams-element-name");d.ajax.post(g+"/"+h,{object_name:l},function(m,n){if(m.status==="success"){if(j.hasClass("datatable")){j.dataTable().fnDeleteRow(k[0])}else{k.remove()}}else{d.ajax.handleJSON(m)}})}})}}};d.skin={_setPageHeight:function(){var e=c("#main").height();var g=a.leftPanel.height();var f=c(window).height()-a.navbarHeight;if(e>f){a.root.css("min-height",e+a.navbarHeight)}else{a.root.css("min-height",f)}a.leftPanel.css("min-height",f);a.leftPanel.css("max-height",f)},_checkMobileWidth:function(){if(c(window).width()<979){a.root.addClass("mobile-view-activated")}else{if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("mobile-view-activated")}}},_showShortcutButtons:function(){a.shortcuts.animate({height:"show"},200,"easeOutCirc");a.root.addClass("shortcut-on")},_hideShortcutButtons:function(){a.shortcuts.animate({height:"hide"},300,"easeOutCirc");a.root.removeClass("shortcut-on")},checkNotification:function(){var e=c(".badge","#user-activity >span");if(parseInt(e.text())>0){e.removeClass("hidden").addClass("bg-color-red bounceIn animated")}else{e.addClass("hidden").removeClass("bg-color-red bounceIn animated")}},refreshNotificationsPanel:function(g){var f=c(this);f.addClass("disabled");c("i",f).addClass("fa-spin");c('input[name="activity"]:checked',"#user-activity").change();c("i",f).removeClass("fa-spin");f.removeClass("disabled")},_initDesktopWidgets:function(e){if(a.enableWidgets){var f=c(".ams-widget",e);if(f.length>0){a.ajax.check(c.fn.MyAMSWidget,a.baseURL+"myams-widgets"+a.devext+".js",function(){f.each(function(){var i=c(this);var h=i.data();var j={deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"};var g=c.extend({},j,h.amsWidgetOptions);g=a.executeFunctionByName(h.amsWidgetInitcallback,i,g)||g;i.MyAMSWidget(g)});b.MyAMSWidget.initWidgetsGrid(c(".ams-widget-grid",e))})}}},_initMobileWidgets:function(e){if(a.enableMobile&&a.enableWidgets){a.skin._initDesktopWidgets(e)}},alert:function(l,f,g,m,k,e){if(f==="error"){f="danger"}c(".alert-"+f,l).remove();var i='<div class="'+(e?"margin-10":"")+" alert alert-block alert-"+f+' padding-5 fade in"><a class="close" data-dismiss="alert"><i class="fa fa-check"></i></a><h4 class="alert-heading"><i class="fa fa-fw fa-warning"></i> '+g+"</h4>"+(k?("<p>"+k+"</p>"):"");if(typeof(m)==="string"){i+="<ul><li>"+m+"</li></ul>"}else{if(m){i+="<ul>";for(var h in m){if(!c.isNumeric(h)){continue}i+="<li>"+m[h]+"</li>"}i+="</ul>"}}i+="</div>";var j=c(i).prependTo(l);if(l.exists){a.ajax.check(c.scrollTo,a.baseURL+"ext/jquery-scrollTo.min.js",function(){c.scrollTo(l,{offset:{top:-50}})})}},bigBox:function(e,f){a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){a.notify.messageBox(e,f)})},messageBox:function(e,f,g){if(typeof(e)==="object"){g=f;f=e||{};e="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){switch(e){case"error":case"danger":f.color="#C46A69";break;case"warning":f.color="#C79121";break;case"success":f.color="#739E73";break;default:f.color=f.color||"#3276B1"}f.sound=false;a.notify.bigBox(f,g)})},smallBox:function(e,f,g){if(typeof(e)==="object"){g=f;f=e||{};e="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){switch(e){case"error":case"danger":f.color="#C46A69";break;case"warning":f.color="#C79121";break;case"success":f.color="#739E73";break;default:f.color=f.color||"#3276B1"}f.sound=false;a.notify.smallBox(f,g)})},_drawBreadCrumb:function(){var e=c("OL.breadcrumb","#ribbon");c("li",e).not(".parent").remove();if(!c("li",e).exists()){e.append(c("<li></li>").append(c("<a></a>").text(a.i18n.HOME).addClass("padding-right-5").attr("href",c('nav a[href!="#"]:first').attr("href"))))}c("LI.active >A","nav").each(function(){var h=c(this);var f=c.trim(h.clone().children(".badge").remove().end().text());var g=c("<li></li>").append(h.attr("href").replace(/^#/,"")?c("<a></a>").html(f).attr("href",h.attr("href")):f);e.append(g)})},checkURL:function(){function e(l){c(".active",j).removeClass("active");l.addClass("open").addClass("active");l.parents("li").addClass("open active").children("ul").addClass("active").show();l.parents("li:first").removeClass("open");l.parents("ul").addClass(l.attr("href").replace(/^#/,"")?"active":"").show()}var k;var j=c("nav");var h=location.hash;var g=h.replace(/^#/,"");if(g){var f=c("#content");if(!f.exists()){f=c("body")}k=c('A[href="'+h+'"]',j);if(k.exists()){e(k)}a.skin.loadURL(g,f,{afterLoadCallback:function(){var l=c("html head title").data("ams-title-prefix");document.title=(l?l+" > ":"")+(c("[data-ams-page-title]:first",f).data("ams-page-title")||k.attr("title")||document.title)}})}else{var i=c("[data-ams-active-menu]").data("ams-active-menu");if(i){k=c('A[href="'+i+'"]',j)}else{k=c('>UL >LI >A[href!="#"]',j).first()}if(k.exists()){e(k);if(i){a.skin._drawBreadCrumb()}else{window.location.hash=k.attr("href")}}}},_clean_callbacks:[],registerCleanCallback:function(f){var e=a.skin._clean_callbacks;if(e.indexOf(f)<0){e.push(f)}},unregisterCleanCallback:function(g){var f=a.skin._clean_callbacks;var e=f.indexOf(g);if(e>=0){f.splice(e,1)}},cleanContainer:function(e){var g=a.skin._clean_callbacks;for(var f=0;f<g.length;f++){g[f].call(e)}},loadURL:function(g,e,f,j){if(g.startsWith("#")){g=g.substr(1)}if(typeof(f)==="function"){j=f;f={}}else{if(f===undefined){f={}}}e=c(e);var i={type:"GET",url:g,dataType:"html",cache:false,beforeSend:function(){a.skin.cleanContainer(e);e.html('<h1 class="loading"><i class="fa fa-cog fa-spin"></i> '+a.i18n.LOADING+" </h1>");if(e[0]===c("#content")[0]){a.skin._drawBreadCrumb();var k=c("html head title").data("ams-title-prefix");document.title=(k?k+" > ":"")+c(".breadcrumb LI:last-child").text();c("html, body").animate({scrollTop:0},"fast")}else{e.animate({scrollTop:0},"fast")}},success:function(p,l,o){if(j){a.executeFunctionByName(j,this,p,l,o,f)}else{var n=a.ajax.getResponse(o);var m=n.contentType;var k=n.data;c(".loading",e).remove();switch(m){case"json":a.ajax.handleJSON(k,e);break;case"script":break;case"xml":break;case"html":case"text":default:e.parents(".hidden").removeClass("hidden");c(".alert",e.parents(".alerts-container")).remove();e.css({opacity:"0.0"}).html(p).removeClass("hidden").delay(50).animate({opacity:"1.0"},300);a.initContent(e);a.form.setFocus(e)}if(f&&f.afterLoadCallback){a.executeFunctionByName(f.afterLoadCallback,this)}a.stats.logPageview()}},error:function(m,l,k){e.html('<h3 class="error"><i class="fa fa-warning txt-color-orangeDark"></i> '+a.i18n.ERROR+k+"</h3>"+m.responseText)},async:f.async===undefined?true:f.async};var h=c.extend({},i,f);c.ajax(h)},setLanguage:function(f){var h=f.lang;var g=f.handler_type||"json";switch(g){case"json":var i=f.method||"setUserLanguage";a.jsonrpc.post(i,{lang:h},function(){window.location.reload(true)});break;case"ajax":var e=f.href||"setUserLanguage";a.ajax.post(e,{lang:h},function(){window.location.reload(true)});break}},logout:function(){window.location=a.loginURL}};d.stats={logPageview:function(f){if(typeof(b._gaq)==="undefined"){return}var e=b.window.location;b._gaq.push(["_trackPageview",f||e.pathname+e.hash])},logEvent:function(f,g,e){if(typeof(b._gaq)==="undefined"){return}if(typeof(f)==="object"){g=f.action;e=f.label;f=f.category}b._gaq.push(["_trackEvent",f,g,e])}};d.initPage=function(){var e=c("body");a.root=e;a.leftPanel=c("#left-panel");a.shortcuts=c("#shortcuts");a.plugins.initData(e);var g=c.ajaxSettings.xhr;c.ajaxSetup({progress:a.ajax.progress,progressUpload:a.ajax.progress,xhr:function(){var i=g();if(i&&(typeof(i.addEventListener)==="function")){var h=this;i.addEventListener("progress",function(j){h.progress(j)},false)}return i}});c(document).ajaxStart(a.ajax.start);c(document).ajaxStop(a.ajax.stop);c(document).ajaxError(a.error.ajax);if(!a.isMobile){a.root.addClass("desktop-detected");a.device="desktop"}else{a.root.addClass("mobile-detected");a.device="mobile";if(a.enableFastclick){a.ajax.check(c.fn.noClickDelay,a.baseURL+"/ext/jquery-smartclick"+a.devext+".js",function(){c("NAV UL A").noClickDelay();c("A","#hide-menu").noClickDelay()})}}c("#hide-menu >:first-child > A").click(function(h){e.toggleClass("hidden-menu");h.preventDefault()});c("#show-shortcuts").click(function(h){if(a.shortcuts.is(":visible")){a.skin._hideShortcutButtons()}else{a.skin._showShortcutButtons()}h.preventDefault()});a.shortcuts.click(function(h){a.skin._hideShortcutButtons()});c(document).mouseup(function(h){if(!a.shortcuts.is(h.target)&&a.shortcuts.has(h.target).length===0){a.skin._hideShortcutButtons()}});c("#search-mobile").click(function(){a.root.addClass("search-mobile")});c("#cancel-search-js").click(function(){a.root.removeClass("search-mobile")});c(".activity-button","#user-activity").click(function(i){var h=c("#user-activity");var j=c(".ajax-dropdown",h);if(!j.is(":visible")){j.css("left",-j.innerWidth()+h.innerWidth()).fadeIn(150);h.addClass("active")}else{j.fadeOut(150);h.removeClass("active")}i.preventDefault()});a.skin.checkNotification();c(document).mouseup(function(h){var i=c(".ajax-dropdown");if(!i.is(h.target)&&i.has(h.target).length===0){i.fadeOut(150).prev().removeClass("active")}});c('input[name="activity"]').change(function(k){var j=c(this).data("ams-url");if(j){k.preventDefault();k.stopPropagation();var i=a.getFunctionByName(j);if(typeof(i)==="function"){j=i.call(this)}if(typeof(j)==="function"){j.call(this)}else{var h=c(".ajax-notifications");a.skin.loadURL(j,h)}}});c("a","#user-menu LI.logout").click(function(h){h.preventDefault();h.stopPropagation();a.loginURL=c(this).attr("href");a.skin.bigBox({title:"<i class='fa fa-sign-out txt-color-orangeDark'></i> "+a.i18n.LOGOUT+" <span class='txt-color-orangeDark'><strong>"+c("#show-shortcut").text()+"</strong></span> ?",content:a.i18n.LOGOUT_COMMENT,buttons:"["+a.i18n.BTN_NO+"]["+a.i18n.BTN_YES+"]"},function(i){if(i===a.i18n.BTN_YES){a.root.addClass("animated fadeOutUp");setTimeout(a.skin.logout,1000)}})});var f=c("nav");c("UL",f).myams_menu({accordion:f.data("ams-menu-accordion")!==false,speed:a.menuSpeed});c(".minifyme").click(function(h){c("BODY").toggleClass("minified");c(this).effect("highlight",{},500);h.preventDefault()});c("#refresh").click(function(h){a.skin.bigBox({title:"<i class='fa fa-refresh' style='color: green'></i> "+a.i18n.CLEAR_STORAGE_TITLE,content:a.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+a.i18n.BTN_CANCEL+"]["+a.i18n.BTN_OK+"]"},function(i){if(i===a.i18n.BTN_OK&&localStorage){localStorage.clear();location.reload()}});h.preventDefault()});e.on("click",function(i){var h=c(this);if(!h.is(i.target)&&h.has(i.target).length===0&&c(".popover").has(i.target).length===0){h.popover("hide")}});a.ajax.check(c.resize,a.baseURL+"ext/jquery-resize"+a.devext+".js",function(){c("#main").resize(function(){a.skin._setPageHeight();a.skin._checkMobileWidth()});f.resize(function(){a.skin._setPageHeight()})});if(a.ajaxNav){c(document).on("click",'a[href="#"]',function(h){h.preventDefault()});c(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(m){var k=c(m.currentTarget);var j=k.data("ams-disabled-handlers");if((j===true)||(j==="click")||(j==="all")){return}var i=k.attr("href")||k.data("ams-url");if(!i||i.startsWith("javascript")||k.attr("target")||(k.data("ams-context-menu")===true)){return}m.preventDefault();m.stopPropagation();var h=a.getFunctionByName(i);if(typeof(h)==="function"){i=h.call(k)}if(typeof(i)==="function"){i.call(k)}else{i=i.replace(/\%23/,"#");var l=k.data("ams-target");if(l){a.form.confirmChangedForm(l,function(){a.skin.loadURL(i,l,k.data("ams-link-options"),k.data("ams-link-callback"))})}else{a.form.confirmChangedForm(function(){if(i.startsWith("#")){if(i!==location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=i},50)}else{window.location.hash=i}}}else{window.location=i}})}}});c(document).on("click",'a[target="_blank"]',function(i){i.preventDefault();var h=c(i.currentTarget);window.open(h.attr("href"));a.stats.logEvent(h.data("ams-stats-category")||"Navigation",h.data("ams-stats-action")||"External",h.data("ams-stats-label")||h.attr("href"))});c(document).on("click",'a[target="_top"]',function(h){h.preventDefault();a.form.confirmChangedForm(function(){window.location=c(h.currentTarget).attr("href")})});c(window).on("hashchange",a.skin.checkURL)}c(document).off("click.modal").on("click",'[data-toggle="modal"]',function(j){var i=c(this);var h=i.data("ams-disabled-handlers");if((h===true)||(h==="click")||(h==="all")){return}if(i.data("ams-context-menu")===true){return}if(i.data("ams-stop-propagation")===true){j.stopPropagation()}j.preventDefault();a.dialog.open(i);if(i.parents("#shortcut").exists()){setTimeout(a.skin._hideShortcutButtons,300)}});c(document).on("click",'button[type="submit"], button.submit',function(){var h=c(this);c(h.get(0).form).data("ams-submit-button",h)});c(document).on("click",'input[type="checkbox"][readonly]',function(){return false});c(document).on("click","[data-ams-click-handler]",function(k){var j=c(this);var h=j.data("ams-disabled-handlers");if((h===true)||(h==="click")||(h==="all")){return}var i=j.data();if(i.amsClickHandler){if((i.amsStopPropagation===true)||(i.amsClickStopPropagation===true)){k.stopPropagation()}if(i.amsClickKeepDefault!==true){k.preventDefault()}var l=a.getFunctionByName(i.amsClickHandler);if(l!==undefined){l.call(j,i.amsClickHandlerOptions)}}});c(document).on("change","[data-ams-change-handler]",function(k){var j=c(this);if(j.prop("readonly")){return}var h=j.data("ams-disabled-handlers");if((h===true)||(h==="change")||(h==="all")){return}var i=j.data();if(i.amsChangeHandler){if(i.amsChangeKeepDefault!==true){k.preventDefault()}var l=a.getFunctionByName(i.amsChangeHandler);if(l!==undefined){l.call(j,i.amsChangeHandlerOptions)}}});c(document).on("reset","form",function(i){var h=c(this);setTimeout(function(){h.find(".select2").trigger("change");c("[data-ams-reset-callback]",h).each(function(){var j=c(this);var k=j.data();var l=a.getFunctionByName(k.amsResetCallback);if(l!==undefined){l.call(h,j,k.amsResetCallbackOptions)}})},10);a.form.setFocus(h)});c(document).on("reset","[data-ams-reset-handler]",function(j){var h=c(this);var i=h.data();if(i.amsResetHandler){if(i.amsResetKeepDefault!==true){j.preventDefault()}var k=a.getFunctionByName(i.amsResetHandler);if(k!==undefined){k.call(h,i.amsResetHandlerOptions)}}});c(document).on("change",'input[type="file"]',function(j){j.preventDefault();var h=c(this);var i=h.parent(".button");if(i.exists()&&i.parent().hasClass("input-file")){i.next('input[type="text"]').val(h.val())}});c(document).on("focusin",function(h){if(c(h.target).closest(".mce-window").length){h.stopImmediatePropagation()}});c("a[data-toggle=tab]",".nav-tabs").on("click",function(h){if(c(this).parent("li").hasClass("disabled")){h.preventDefault();return false}});c(document).on("show.bs.tab",function(j){var h=c(j.target);var i=h.data();if(i.amsUrl){if(i.amsTabLoaded){return}try{h.append('<i class="fa fa-spin fa-cog margin-left-5"></i>');a.skin.loadURL(i.amsUrl,h.attr("href"),{afterLoadCallback:function(){if(i.amsTabLoadOnce){h.data("ams-tab-loaded",true)}}})}finally{c("i",h).remove()}}});c(document).on("hide.bs.modal",function(i){var h=c(i.target);a.form.confirmChangedForm(h,function(){h.data("modal").isShown=true;return true},function(){i.preventDefault();return false})});a.initContent(document);if(a.ajaxNav&&f.exists()){a.skin.checkURL()}a.form.setFocus(document);c(window).on("beforeunload",a.form.checkBeforeUnload)};d.initContent=function(e){c(".tipsy").remove();c("[rel=tooltip]",e).tooltip();c("[rel=popover]",e).popover();c("[rel=popover-hover]",e).popover({trigger:"hover"});a.plugins.init(e);a.callbacks.init(e);a.events.init(e);a.form.init(e);if(a.device==="desktop"){a.skin._initDesktopWidgets(e)}else{a.skin._initMobileWidgets(e)}a.skin._setPageHeight()};d.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",LOADING:"Loading...",PROGRESS:"Processing",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",NO_SERVER_RESPONSE:"No response from server!",ERROR_OCCURED:"An error occured!",ERRORS_OCCURED:"Some errors occured!",BAD_LOGIN_TITLE:"Bad login!",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirm",CONFIRM_REMOVE:"Removing this content can't be undone. Do you confirm?",CLEAR_STORAGE_TITLE:"Clear Local Storage",CLEAR_STORAGE_CONTENT:"Would you like to RESET all your saved widgets and clear LocalStorage?",BTN_OK:"OK",BTN_CANCEL:"Cancel",BTN_OK_CANCEL:"[OK][Cancel]",BTN_YES:"Yes",BTN_NO:"No",BTN_YES_NO:"[Yes][No]",CLIPBOARD_COPY:"Copy to clipboard with Ctrl+C, and Enter",FORM_CHANGED_WARNING:"Some changes were not saved. These updates will be lost if you leave this page.",DELETE_WARNING:"This change can't be undone. Are you sure that you want to delete this element?",NO_UPDATE:"No changes were applied.",DATA_UPDATED:"Data successfully updated.",HOME:"Home",LOGOUT:"Logout?",LOGOUT_COMMENT:"You can improve your security further after logging out by closing this opened browser",SELECT2_PLURAL:"s",SELECT2_MATCH:"One result is available, press enter to select it.",SELECT2_MATCHES:" results are available, use up and down arrow keys to navigate.",SELECT2_NOMATCHES:"No matches found",SELECT2_SEARCHING:"Searching...",SELECT2_LOADMORE:"Loading more results...",SELECT2_INPUT_TOOSHORT:"Please enter {0} more character{1}",SELECT2_INPUT_TOOLONG:"Please delete {0} character{1}",SELECT2_SELECTION_TOOBIG:"You can only select {0} item{1}",SELECT2_FREETAG_PREFIX:"Free text: ",DT_COLUMNS:"Columns"};c(document).ready(function(){c=jQuery.noConflict();var e=c("HTML");var f=e.attr("lang")||e.attr("xml:lang");if(f&&!f.startsWith("en")){d.lang=f;d.getScript(d.baseURL+"i18n/myams_"+f.substr(0,2)+".js",function(){d.initPage()})}else{d.initPage()}})})(jQuery,this);
\ No newline at end of file
+(function(d,c){var b=c.console;String.prototype.startsWith=function(h){var f=this.length,g=h.length;if(f<g){return false}return(this.substr(0,g)===h)};String.prototype.endsWith=function(h){var f=this.length,g=h.length;if(f<g){return false}return(this.substr(f-g)===h)};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(g,h){var f=this.length;h=Number(h)||0;h=(h<0)?Math.ceil(h):Math.floor(h);if(h<0){h+=f}for(;h<f;h++){if(h in this&&this[h]===g){return h}}return -1}}d.expr[":"].hasvalue=function(h,f,g){return d(h).val()!==""};d.expr[":"].econtains=function(h,f,g){return(h.textContent||h.innerText||d(h).text()||"").toLowerCase()===g[3].toLowerCase()};d.expr[":"].withtext=function(h,f,g){return(h.textContent||h.innerText||d(h).text()||"")===g[3]};d.expr[":"].parents=function(h,f,g){return d(h).parents(g[3]).length>0};if(d.scrollbarWidth===undefined){d.scrollbarWidth=function(){var g=d('<div style="width:50px; height:50px; overflow:auto"><div/></div>').appendTo("body");var h=g.children();var f=h.innerWidth()-h.height(99).innerWidth();g.remove();return f}}d.fn.extend({exists:function(){return d(this).length>0},objectOrParentWithClass:function(f){if(this.hasClass(f)){return this}else{return this.parents("."+f)}},listattr:function(g){var f=[];this.each(function(){f.push(d(this).attr(g))});return f},style:function(g,j,f){var i=this.get(0);if(typeof(i)==="undefined"){return}var h=this.get(0).style;if(typeof(g)!=="undefined"){if(typeof(j)!=="undefined"){f=typeof(f)!=="undefined"?f:"";h.setProperty(g,j,f);return this}else{return h.getPropertyValue(g)}}else{return h}},removeClassPrefix:function(f){this.each(function(h,j){var g=j.className.split(" ").map(function(i){return i.startsWith(f)?"":i});j.className=d.trim(g.join(" "))});return this},contextMenu:function(g){function f(j,l,i){var k=d(window)[l](),m=d(g.menuSelector)[l](),h=j;if(j+m>k&&m<j){h-=m}return h}return this.each(function(){d("a",d(g.menuSelector)).each(function(){d(this).data("ams-context-menu",true)});d(this).on("contextmenu",function(h){if(h.ctrlKey){return}d(g.menuSelector).data("invokedOn",d(h.target)).show().css({position:"fixed",left:f(h.clientX,"width","scrollLeft")-10,top:f(h.clientY,"height","scrollTop")-10}).off("click").on("click",function(i){d(this).hide();var k=d(this).data("invokedOn");var j=d(i.target);g.menuSelected.call(this,k,j);a.event.stop(i)});return false});d(document).click(function(){d(g.menuSelector).hide()})})},myams_menu:function(f){var h={accordion:true,speed:200,closedSign:'<em class="fa fa-angle-down"></em>',openedSign:'<em class="fa fa-angle-up"></em>'};var g=d.extend({},h,f);var i=d(this);i.find("LI").each(function(){var j=d(this);if(j.find("UL").size()>0){j.find("A:first").append("<b class='collapse-sign'>"+g.closedSign+"</b>");var k=j.find("A:first");if(k.attr("href")==="#"){k.click(function(){return false})}}});i.find("LI.active").each(function(){var j=d(this).parents("UL");var k=j.parent("LI");j.slideDown(g.speed);k.find("b:first").html(g.openedSign);k.addClass("open")});i.find("LI A").on("click",function(){var m=d(this);if(m.hasClass("active")){return}var j=m.attr("href").replace(/^#/,"");var l=m.parent().find("UL");if(g.accordion){var k=m.parent().parents("UL");var n=i.find("UL:visible");n.each(function(p){var r=true;k.each(function(s){if(k[s]===n[p]){r=false;return false}});if(r){if(l!==n[p]){var q=d(n[p]);if(j||!q.hasClass("active")){q.slideUp(g.speed,function(){d(this).parent("LI").removeClass("open").find("B:first").delay(g.speed).html(g.closedSign)})}}}})}var o=m.parent().find("UL:first");if(!j&&o.is(":visible")&&!o.hasClass("active")){o.slideUp(g.speed,function(){m.parent("LI").removeClass("open").find("B:first").delay(g.speed).html(g.closedSign)})}else{o.slideDown(g.speed,function(){m.parent("LI").addClass("open").find("B:first").delay(g.speed).html(g.openedSign)})}})}});d.UTF8={encode:function(g){g=g.replace(/\r\n/g,"\n");var f="";for(var i=0;i<g.length;i++){var h=g.charCodeAt(i);if(h<128){f+=String.fromCharCode(h)}else{if((h>127)&&(h<2048)){f+=String.fromCharCode((h>>6)|192);f+=String.fromCharCode((h&63)|128)}else{f+=String.fromCharCode((h>>12)|224);f+=String.fromCharCode(((h>>6)&63)|128);f+=String.fromCharCode((h&63)|128)}}}return f},decode:function(f){var h="";var k=0,l=0,j=0,g=0;while(k<f.length){l=f.charCodeAt(k);if(l<128){h+=String.fromCharCode(l);k++}else{if((l>191)&&(l<224)){j=f.charCodeAt(k+1);h+=String.fromCharCode(((l&31)<<6)|(j&63));k+=2}else{j=f.charCodeAt(k+1);g=f.charCodeAt(k+2);h+=String.fromCharCode(((l&15)<<12)|((j&63)<<6)|(g&63));k+=3}}}return h}};if(c.MyAMS===undefined){c.MyAMS={devmode:true,devext:"",lang:"en",throttleDelay:350,menuSpeed:235,navbarHeight:49,ajaxNav:true,enableWidgets:true,enableMobile:false,enableFastclick:false,warnOnFormChange:false,ismobile:(/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()))}}var e=c.MyAMS;var a=e;e.baseURL=(function(){var f=d('script[src*="/myams.js"], script[src*="/myams.min.js"]');var g=f.attr("src");a.devmode=g.indexOf(".min.js")<0;a.devext=a.devmode?"":".min";return g.substring(0,g.lastIndexOf("/")+1)})();e.log=function(){if(b){b.log&&b.log(this,arguments)}};e.getQueryVar=function(h,i){if(h.indexOf("?")<0){return false}if(!h.endsWith("&")){h+="&"}var f=new RegExp(".*?[&\\?]"+i+"=(.*?)&.*");var g=h.replace(f,"$1");return g===h?false:g};e.rgb2hex=function(f){return"#"+d.map(f.match(/\b(\d+)\b/g),function(g){return("0"+parseInt(g).toString(16)).slice(-2)}).join("")};e.generateId=function(){function f(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return f()+f()+f()+f()};e.generateUUID=function(){var g=new Date().getTime();var f="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var h=(g+Math.random()*16)%16|0;g=Math.floor(g/16);return(i==="x"?h:(h&3|8)).toString(16)});return f};e.getObject=function(k,g){if(!k){return undefined}if(typeof(k)!=="string"){return k}var h=k.split(".");g=(g===undefined||g===null)?window:g;for(var f=0;f<h.length;f++){try{g=g[h[f]]}catch(j){return undefined}}return g};e.getFunctionByName=function(k,g){if(k===undefined){return undefined}else{if(typeof(k)==="function"){return k}}var j=k.split(".");var h=j.pop();g=(g===undefined||g===null)?window:g;for(var f=0;f<j.length;f++){try{g=g[j[f]]}catch(l){return undefined}}try{return g[h]}catch(l){return undefined}};e.executeFunctionByName=function(i,g){var h=a.getFunctionByName(i,window);if(typeof(h)==="function"){var f=Array.prototype.slice.call(arguments,2);return h.apply(g,f)}};e.isInDOM=function(f){f=d(f);if(!f.exists()){return false}return c.document.body.contains(f[0])};e.getSource=function(f){return f.replace(/{[^{}]*}/g,function(g){return a.getFunctionByName(g.substr(1,g.length-2))})};e.getScript=function(g,j,f){if(typeof(j)==="object"){f=j;j=null}if(f===undefined){f={}}var i={dataType:"script",url:a.getSource(g),success:j,error:a.error.show,cache:!a.devmode,async:f.async===undefined?typeof(j)==="function":f.async};var h=d.extend({},i,f);return d.ajax(h)};e.getCSS=function(f,j){var h=d("HEAD");var g=d('link[data-ams-id="'+j+'"]',h);if(g.length===0){var i=a.getSource(f);if(a.devmode){i+="?_="+new Date().getTime()}d("<link />").attr({rel:"stylesheet",type:"text/css",href:i,"data-ams-id":j}).appendTo(h)}};e.event={stop:function(f){if(!f){f=window.event}if(f){if(f.stopPropagation){f.stopPropagation();f.preventDefault()}else{f.cancelBubble=true;f.returnValue=false}}}};e.browser={getInternetExplorerVersion:function(){var h=-1;if(navigator.appName==="Microsoft Internet Explorer"){var f=navigator.userAgent;var g=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(g.exec(f)!==null){h=parseFloat(RegExp.$1)}}return h},checkVersion:function(){var g="You're not using Windows Internet Explorer.";var f=this.getInternetExplorerVersion();if(f>-1){if(f>=8){g="You're using a recent copy of Windows Internet Explorer."}else{g="You should upgrade your copy of Windows Internet Explorer."}}if(c.alert){c.alert(g)}},isIE8orlower:function(){var g="0";var f=this.getInternetExplorerVersion();if(f>-1){if(f>=9){g=0}else{g=1}}return g},copyToClipboard:function(g){function f(k){var i=false;if(window.clipboardData&&window.clipboardData.setData){i=clipboardData.setData("Text",k)}else{if(document.queryCommandSupported&&document.queryCommandSupported("copy")){var h=d("<textarea>");h.val(k);h.css("position","fixed");h.appendTo(d("body"));h.get(0).select();try{document.execCommand("copy");i=true}catch(j){if(b){b.warn&&b.warn("Copy to clipboard failed.",j)}}finally{h.remove()}}}if(i){a.skin.smallBox("success",{title:a.i18n.CLIPBOARD_COPY_OK,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:1000})}else{if(c.prompt){c.prompt(e.i18n.CLIPBOARD_COPY,k)}}}if(g===undefined){return function(){var h=d(this);var i=h.text();h.parents(".btn-group").removeClass("open");f(i)}}else{f(g)}}};e.error={ajax:function(j,f,i,g){if(g==="abort"){return}if(f&&f.statusText&&f.statusText.toUpperCase()==="OK"){return}f=a.ajax.getResponse(f);if(f.contentType==="json"){a.ajax.handleJSON(f.data)}else{var k=j.statusText||j.type;var h=f.responseText;a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+k+"</h4><p>"+(h||"")+"</p>",icon:"fa fa-warning animated shake",timeout:10000})}if(b){b.error&&b.error(j);b.debug&&b.debug(f)}},show:function(i,f,h){if(!h){return}var g=a.ajax.getResponse(i);if(g.contentType==="json"){a.ajax.handleJSON(g.data)}else{a.skin.messageBox("error",{title:a.i18n.ERRORS_OCCURED,content:"<h4>"+f+"</h4><p>"+h+"</p>",icon:"fa fa-warning animated shake",timeout:10000})}if(b){b.error&&b.error(h);b.debug&&b.debug(i)}}};e.ajax={check:function(g,f,l,n){function k(r,q){if(l===undefined){return}if(!(l instanceof Array)){l=[l]}for(var p=0;p<l.length;p++){var o=a.getFunctionByName(l[p]);if(typeof(o)==="function"){o(r,q)}}}if(!(l instanceof Array)){if(typeof(l)==="object"){n=l;l=undefined}}var i={async:typeof(l)==="function"};var h=d.extend({},i,n);if(g instanceof Array){var m=[];for(var j=0;j<g.length;j++){if(g[j]===undefined){m.push(a.getScript(f[j],{async:true}))}}if(m.length>0){d.when.apply(d,m).then(function(){k(true,n)})}else{k(false,n)}}else{if(g===undefined){if(typeof(f)==="string"){a.getScript(f,function(){k(true,n)},h)}}else{k(false,n)}}},getAddr:function(g){var f=g||d("HTML HEAD BASE").attr("href")||window.location.href;return f.substr(0,f.lastIndexOf("/")+1)},start:function(){d("#ajax-gear").show()},stop:function(){d("#ajax-gear").hide()},progress:function(f){if(!f.lengthComputable){return}if(f.loaded>=f.total){return}if(b){b.log&&b.log(parseInt((f.loaded/f.total*100),10)+"%")}},post:function(h,j,g,m){var l;if(h.startsWith(window.location.protocol)){l=h}else{l=this.getAddr()+h}if(typeof(g)==="function"){m=g;g={}}else{if(!g){g={}}}if(typeof(m)==="undefined"){m=g.callback}if(typeof(m)==="string"){m=a.getFunctionByName(m)}delete g.callback;var f;var k={url:l,type:"post",cache:false,async:typeof(m)==="function",data:d.param(j),dataType:"json",success:m||function(n){f=n.result}};var i=d.extend({},k,g);d.ajax(i);return f},getResponse:function(h){var j=h.getResponseHeader("content-type"),g,f;if(j){if(j.startsWith("application/javascript")){g="script";f=h.responseText}else{if(j.startsWith("text/html")){g="html";f=h.responseText}else{if(j.startsWith("text/xml")){g="xml";f=h.responseText}else{f=h.responseJSON;if(f){g="json"}else{try{f=JSON.parse(h.responseText);g="json"}catch(i){f=h.responseText;g="text"}}}}}}else{g="json";f={status:"alert",alert:{title:a.i18n.ERROR_OCCURED,content:a.i18n.NO_SERVER_RESPONSE}}}return{contentType:g,data:f}},handleJSON:function(r,i,m){var k=r.status;var g;switch(k){case"alert":if(c.alert){c.alert(r.alert.title+"\n\n"+r.alert.content)}break;case"error":a.form.showErrors(i,r);break;case"info":case"success":a.form.resetChanged(i);if(r.close_form!==false){a.dialog.close(i)}break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":a.form.resetChanged(i);if(r.close_form!==false){a.dialog.close(i)}break;case"modal":a.dialog.open(r.location);break;case"reload":a.form.resetChanged(i);if(r.close_form!==false){a.dialog.close(i)}g=r.location||window.location.hash;if(g.startsWith("#")){g=g.substr(1)}a.skin.loadURL(g,r.target||m||"#content");break;case"redirect":a.form.resetChanged(i);if(r.close_form===true){a.dialog.close(i)}g=r.location||window.location.href;if(r.window){window.open(g,r.window,r.options)}else{if(window.location.href===g){window.location.reload(true)}else{window.location.href=g}}break;default:if(b){b.log&&b.log("Unhandled status: "+k)}}var l;var n;var h;if(r.content){n=r.content;h=d(n.target||m||i||"#content");if(n.raw===true){h.text(n.text)}else{h.html(n.html);a.initContent(h)}if(!n.keep_hidden){h.removeClass("hidden")}}if(r.contents){var j=r.contents;for(l=0;l<j.length;l++){n=j[l];h=d(n.target);if(n.raw===true){h.text(n.text)}else{h.html(n.html);a.initContent(h)}if(!n.keep_hidden){h.removeClass("hidden")}}}var q;if(r.message){q=r.message;if(typeof(q)==="string"){if((k==="info")||(k==="success")){a.skin.smallBox(k,{title:q,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3000})}else{a.skin.alert(d(i||"#content"),k,q)}}else{a.skin.alert(d(q.target||m||i||"#content"),q.status||"success",q.header,q.body,q.subtitle)}}if(r.smallbox){a.skin.smallBox(r.smallbox_status||k,{title:r.smallbox,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3000})}if(r.messagebox){q=r.messagebox;if(typeof(q)==="string"){a.skin.messageBox("info",{title:a.i18n.ERROR_OCCURED,content:q,timeout:10000})}else{var o=q.status||"info";if(o==="error"&&i&&m){a.executeFunctionByName(i.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",i,m)}a.skin.messageBox(o,{title:q.title||a.i18n.ERROR_OCCURED,content:q.content,icon:q.icon,number:q.number,timeout:q.timeout===null?undefined:(q.timeout||10000)})}}if(r.event){i.trigger(r.event,r.event_options)}if(r.events){var f;for(l=0;l<r.events.length;l++){f=r.events[l];if(typeof(f)==="string"){i.trigger(f,r.events_options)}else{i.trigger(f.event,f.options)}}}if(r.callback){a.executeFunctionByName(r.callback,i,r.options)}if(r.callbacks){var p;for(l=0;l<r.callbacks.length;l++){p=r.callbacks[l];if(typeof(p)==="function"){a.executeFunctionByName(p,i,p.options)}else{a.executeFunctionByName(p.callback,i,p.options)}}}}};e.jsonrpc={getAddr:function(h){var f=h||d("HTML HEAD BASE").attr("href")||window.location.href;var g=f.replace(/\+\+skin\+\+\w+\//,"");return g.substr(0,g.lastIndexOf("/")+1)},query:function(g,i,f,h){a.ajax.check(d.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){if(typeof(f)==="function"){h=f;f={}}else{if(!f){f={}}}if(h==="undefined"){h=f.callback}if(typeof(h)==="string"){h=a.getFunctionByName(h)}delete f.callback;var m={};if(typeof(g)==="string"){m.query=g}else{if(typeof(g)==="object"){d.extend(m,g)}}d.extend(m,f);var j;var l={id:new Date().getTime(),params:m,success:h||function(n){j=n},error:a.error.show};var k=d.extend({},l,f);d.jsonRPC.withOptions({endPoint:a.jsonrpc.getAddr(f.url),namespace:f.namespace,cache:false},function(){d.jsonRPC.request(i,k)});return j})},post:function(i,g,f,h){a.ajax.check(d.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){if(typeof(f)==="function"){h=f;f={}}else{if(!f){f={}}}if(typeof(h)==="undefined"){h=f.callback}if(typeof(h)==="string"){h=a.getFunctionByName(h)}delete f.callback;var j;var l={id:new Date().getTime(),params:g,success:h||function(m){j=m},error:a.error.show};var k=d.extend({},l,f);d.jsonRPC.withOptions({endPoint:a.jsonrpc.getAddr(f.url),namespace:f.namespace,cache:false},function(){d.jsonRPC.request(i,k)});return j})}};e.xmlrpc={getAddr:function(h){var f=h||d("HTML HEAD BASE").attr("href")||window.location.href;var g=f.replace(/\+\+skin\+\+\w+\//,"");return g.substr(0,g.lastIndexOf("/")+1)},post:function(g,j,h,f,i){a.ajax.check(d.xmlrpc,a.baseURL+"ext/jquery-xmlrpc"+a.devext+".js",function(){if(typeof(f)==="function"){i=f;f={}}else{if(!f){f={}}}if(typeof(i)==="undefined"){i=f.callback}if(typeof(i)==="string"){i=a.getFunctionByName(i)}delete f.callback;var k;var m={url:a.xmlrpc.getAddr(g),methodName:j,params:h,success:i||function(n){k=n},error:a.error.show};var l=d.extend({},m,f);d.xmlrpc(l);return k})}};e.form={init:function(g){d("FORM",g).each(function(){var h=d(this);d('INPUT.select2[type="hidden"]',h).each(function(){var i=d(this);i.data("ams-select2-input-value",i.val())})});var f;if(a.warnOnFormChange){f=d('FORM[data-ams-warn-on-change!="false"]',g)}else{f=d('FORM[data-ams-warn-on-change="true"]',g)}f.each(function(){var h=d(this);d('INPUT[type="text"], INPUT[type="checkbox"], INPUT[type="radio"], SELECT, TEXTAREA, [data-ams-changed-event]',h).each(function(){var j=d(this);if(j.data("ams-ignore-change")!==true){var i=j.data("ams-changed-event")||"change";j.on(i,function(){a.form.setChanged(d(this).parents("FORM"))})}});h.on("reset",function(){a.form.resetChanged(d(this))})})},setFocus:function(f){var g=d("[data-ams-focus-target]",f).first();if(!g.exists()){g=d("input, select",f).first()}if(g.exists()){if(g.hasClass("select2-input")){g=g.parents(".select2")}if(g.hasClass("select2")){setTimeout(function(){g.select2("focus");if(g.data("ams-focus-open")===true){g.select2("open")}},100)}else{g.focus()}}},checkBeforeUnload:function(){var f=d('FORM[data-ams-form-changed="true"]');if(f.exists()){return a.i18n.FORM_CHANGED_WARNING}},confirmChangedForm:function(h,i,g){if(typeof(h)==="function"){i=h;h=undefined}var f=d('FORM[data-ams-form-changed="true"]',h);if(f.exists()){if(g){if(c.confirm(a.i18n.FORM_CHANGED_WARNING,a.i18n.WARNING)){i.call(h)}else{g.call(h)}}else{a.skin.bigBox({title:a.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i> '+a.i18n.FORM_CHANGED_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(j){if(j===a.i18n.BTN_OK){i.call(h)}})}}else{i.call(h)}},setChanged:function(f){f.attr("data-ams-form-changed",true)},resetChanged:function(f){if(f!==undefined){d(f).removeAttr("data-ams-form-changed")}},submit:function(i,h,g){i=d(i);if(!i.exists()){return false}if(typeof(h)==="object"){g=h;h=undefined}if(i.data("submitted")){if(!i.data("ams-form-hide-submitted")){a.skin.messageBox("warning",{title:a.i18n.WAIT,content:a.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:i.data("ams-form-alert-timeout")||5000})}return false}if(!a.form._checkSubmitValidators(i)){return false}d(".alert-danger, SPAN.state-error",i).not(".persistent").remove();d(".state-error",i).removeClassPrefix("state-");var f=d(i.data("ams-submit-button"));if(f&&!f.data("ams-form-hide-loading")){f.data("ams-progress-content",f.html());f.button("loading")}a.ajax.check(d.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+a.devext+".js",function(){function l(p,t){var n,A,E;var L=p.data();var o=L.amsFormOptions;var D;var r;var v;var u;var m;var I;function q(P,Q){var O;function N(){clearInterval(O);a.form.resetAfterSubmit(p,n);n.html(n.data("ams-progress-content"));a.executeFunctionByName(I,p,n);a.form.resetChanged(p)}function M(){a.ajax.post(P,{progress_id:Q},{error:N},a.getFunctionByName(m)||function(R,S){if(S==="success"){if(R.status==="running"){if(R.message){n.text(R.message)}else{var T=n.data("ams-progress-text")||a.i18n.PROGRESS;if(R.current){T+=": "+R.current+"/ "+(R.length||100)}else{T+="..."}n.text(T)}}else{if(R.status==="finished"){N()}}}else{N()}})}n.button("loading");O=setInterval(M,u)}if(g){r=g.formDataInitCallback}if(r){delete g.formDataInitCallback}else{r=L.amsFormDataInitCallback}if(r){var B={};if(typeof(r)==="function"){D=r.call(p,B)}else{D=a.executeFunctionByName(r,p,B)}if(B.veto){n=p.data("ams-submit-button");if(n){n.button("reset")}a.form.finalizeSubmitFooter.call(p);return false}}else{D=L.amsFormData||{}}n=d(p.data("ams-submit-button"));if(n&&n.exists()){A=n.data();E=A.amsFormSubmitTarget}else{A={}}var w;var J=h||A.amsFormHandler||L.amsFormHandler||"";if(J.startsWith(window.location.protocol)){w=J}else{var C=A.amsFormAction||p.attr("action").replace(/#/,"");if(C.startsWith(window.location.protocol)){w=C}else{w=a.ajax.getAddr()+C}w+=J}v=A.amsProgressHandler||L.amsProgressHandler||"";u=A.amsProgressInterval||L.amsProgressInterval||1000;m=A.amsProgressCallback||L.amsProgressCallback;I=A.amsProgressEndCallback||L.amsProgressEndCallback;var K=null;if(g&&g.initSubmitTarget){a.executeFunctionByName(g.initSubmitTarget,p)}else{if(L.amsFormInitSubmitTarget){K=d(E||L.amsFormSubmitTarget||"#content");a.executeFunctionByName(L.amsFormInitSubmit||"MyAMS.form.initSubmit",p,K)}else{if(!L.amsFormHideSubmitFooter){a.executeFunctionByName(L.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",p)}}}if(g){D=d.extend({},D,g.form_data)}var x;if(v){D.progress_id=a.generateUUID()}else{x=typeof(t.uuid)!=="undefined";if(x){if(w.indexOf("X-Progress-ID")<0){w+="?X-Progress-ID="+t.uuid}delete t.uuid}}var z={url:w,type:"post",cache:false,data:D,dataType:L.amsFormDatatype,beforeSerialize:function(){if(typeof(c.tinyMCE)!=="undefined"){c.tinyMCE.triggerSave()}},beforeSubmit:function(N,M){M.data("submitted",true)},error:function(P,M,N,O){if(K){a.executeFunctionByName(L.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",O,K)}a.form.resetAfterSubmit(O)},iframe:x};var G=(g&&g.downloadTarget)||L.amsFormDownloadTarget;if(G){var y=d('iframe[name="'+G+'"]');if(!y.exists()){y=d("<iframe></iframe>").hide().attr("name",G).appendTo(d("body"))}z=d.extend({},z,{iframe:true,iframeTarget:y,success:function(M,N,R,Q){var P=d(Q).parents(".modal-dialog");if(P.exists()){a.dialog.close(Q)}else{var S;var O=Q.data("ams-submit-button");if(O){S=O.data("ams-form-submit-callback")}if(!S){S=a.getFunctionByName(L.amsFormSubmitCallback)||a.form._submitCallback}try{S.call(Q,M,N,R,Q)}finally{a.form.resetAfterSubmit(Q);a.form.resetChanged(Q)}}}})}else{z=d.extend({},z,{error:function(P,M,N,O){if(K){a.executeFunctionByName(L.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",O,K)}a.form.resetAfterSubmit(O)},success:function(M,N,Q,P){var R;var O=P.data("ams-submit-button");if(O){R=O.data("ams-form-submit-callback")}if(!R){R=a.getFunctionByName(L.amsFormSubmitCallback)||a.form._submitCallback}try{R.call(P,M,N,Q,P)}finally{a.form.resetAfterSubmit(P);a.form.resetChanged(P)}},iframe:x})}var H=d.extend({},z,t,o,g);if(v){q(v,D.progress_id)}d(p).ajaxSubmit(H);if(G){var F=d(p).parents(".modal-dialog");var s=F.exists()&&n.exists()&&n.data("ams-keep-modal");if(F.exists()&&(s!==true)){a.dialog.close(p)}else{if(!v){setTimeout(function(){a.form.resetAfterSubmit(p,n);a.form.resetChanged(p)},n.data("ams-form-reset-timeout")||2000)}}}}var k=(i.data("ams-form-ignore-uploads")!==true)&&(d('INPUT[type="file"]',i).length>0);if(k){a.ajax.check(d.progressBar,a.baseURL+"ext/jquery-progressbar"+a.devext+".js");var j=d.extend({},{uuid:d.progressBar.submit(i)});l(i,j)}else{l(i,{})}});return false},initSubmit:function(h,g){var f=d(this);var i='<i class="fa fa-3x fa-gear fa-spin"></i>';if(!g){g=f.data("ams-form-submit-message")}if(g){i+="<strong>"+g+"</strong>"}d(h).html('<div class="row margin-20"><div class="text-center">'+i+"</div></div>");d(h).parents(".hidden").removeClass("hidden")},resetAfterSubmit:function(g){if(g.is(":visible")){var f=g.data("ams-submit-button");if(f){f.button("reset")}a.form.finalizeSubmitFooter.call(g)}g.data("submitted",false);g.removeData("ams-submit-button")},finalizeSubmitOnError:function(f){d("i",f).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(g){var f=d(this);var i='<i class="fa fa-3x fa-gear fa-spin"></i>';if(!g){g=d(this).data("ams-form-submit-message")}if(g){i+='<strong class="submit-message align-top padding-left-10 margin-top-10">'+g+"</strong>"}var h=d("footer",f);d("button",h).hide();h.append('<div class="row"><div class="text-center">'+i+"</div></div>")},finalizeSubmitFooter:function(){var f=d(this);var g=d("footer",f);if(g){d(".row",g).remove();d("button",g).show()}},_submitCallback:function(p,i,h,f){var k;if(f.is(":visible")){a.form.finalizeSubmitFooter.call(f);k=f.data("ams-submit-button");if(k){k.button("reset")}}var j=f.data();var m;if(j.amsFormDatatype){m=j.amsFormDatatype}else{var g=a.ajax.getResponse(h);m=g.contentType;p=g.data}var l;if(k){l=d(k.data("ams-form-submit-target")||j.amsFormSubmitTarget||"#content")}else{l=d(j.amsFormSubmitTarget||"#content")}switch(m){case"json":a.ajax.handleJSON(p,f,l);break;case"script":break;case"xml":break;case"html":case"text":default:a.form.resetChanged(f);if(k&&(k.data("ams-keep-modal")!==true)){a.dialog.close(f)}if(!l.exists()){l=d("body")}l.parents(".hidden").removeClass("hidden");d(".alert",l.parents(".alerts-container")).remove();l.css({opacity:"0.0"}).html(p).delay(50).animate({opacity:"1.0"},300);a.initContent(l);a.form.setFocus(l)}var n=h.getResponseHeader("X-AMS-Callback");if(n){var o=h.getResponseHeader("X-AMS-Callback-Options");a.executeFunctionByName(n,f,o===undefined?{}:JSON.parse(o),h)}},_getSubmitValidators:function(g){var f=[];var h=g.data("ams-form-validator");if(h){f.push([g,h])}d("[data-ams-form-validator]",g).each(function(){var i=d(this);f.push([i,i.data("ams-form-validator")])});return f},_checkSubmitValidators:function(h){var j=a.form._getSubmitValidators(h);if(!j.length){return true}var i=[];var o=true;for(var l=0;l<j.length;l++){var g=j[l];var f=g[0];var n=g[1];var m=a.executeFunctionByName(n,h,f);if(m===false){o=false}else{if(typeof(m)==="string"){i.push(m)}else{if(o.length&&(o.length>0)){i=i.concat(o)}}}}if(i.length>0){var k=i.length===1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(h,"danger",k,i);return false}else{return o}},showErrors:function(f,m){var j;if(typeof(m)==="string"){a.skin.alert(f,"error",a.i18n.ERROR_OCCURED,m)}else{if(m instanceof Array){j=m.length===1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(f,"error",j,m)}else{d(".state-error",f).removeClass("state-error");j=m.error_header||(m.widgets&&(m.widgets.length>1)?a.i18n.ERRORS_OCCURED:a.i18n.ERROR_OCCURED);var o=[];var l;if(m.messages){for(l=0;l<m.messages.length;l++){var i=m.messages[l];if(i.header){o.push("<strong>"+i.header+"</strong><br />"+i.message)}else{o.push(i.message||i)}}}if(m.widgets){for(l=0;l<m.widgets.length;l++){var n=m.widgets[l];var k=d('[name="'+n.name+'"]',f);k.parents("label:first").removeClassPrefix("state-").addClass("state-error").after('<span for="name" class="state-error">'+n.message+"</span>");if(n.label){o.push(n.label+" : "+n.message)}var h=k.parents(".tab-pane").index()+1;if(h>0){var g=d(".nav-tabs",d(k).parents(".tabforms"));d("li:nth-child("+h+")",g).removeClassPrefix("state-").addClass("state-error");d("li.state-error:first a",f).click()}}}a.skin.alert(d("fieldset:first",f),m.error_level||"error",j,o,m.error_message)}}}};e.dialog={_shown_callbacks:[],registerShownCallback:function(i,g){var f;if(g){f=g.objectOrParentWithClass("modal-dialog")}var h;if(f&&f.exists()){h=f.data("shown-callbacks");if(h===undefined){h=[];f.data("shown-callbacks",h)}}else{h=a.dialog._shown_callbacks}if(h.indexOf(i)<0){h.push(i)}},_hide_callbacks:[],registerHideCallback:function(i,g){var f;if(g){f=g.objectOrParentWithClass("modal-dialog")}var h;if(f&&f.exists()){h=f.data("hide-callbacks");if(h===undefined){h=[];f.data("hide-callbacks",h)}}else{h=a.dialog._hide_callbacks}if(h.indexOf(i)<0){h.push(i)}},open:function(g,f){a.ajax.check(d.fn.modalmanager,a.baseURL+"ext/bootstrap-modalmanager"+a.devext+".js",function(){a.ajax.check(d.fn.modal.defaults,a.baseURL+"ext/bootstrap-modal"+a.devext+".js",function(k){if(k){d(document).off("click.modal");d.fn.modal.defaults.spinner=d.fn.modalmanager.defaults.spinner='<div class="loading-spinner" style="width: 200px; margin-left: -100px;"><div class="progress progress-striped active"><div class="progress-bar" style="width: 100%;"></div></div></div>'}var j;var i;if(typeof(g)==="string"){j={};i=g}else{j=g.data();i=g.attr("href")||j.amsUrl;var h=a.getFunctionByName(i);if(typeof(h)==="function"){i=h.call(g)}}if(!i){return}d("body").modalmanager("loading");if(i.indexOf("#")===0){d(i).modal("show")}else{d.ajax({url:i,type:"get",cache:j.amsAllowCache===undefined?false:j.amsAllowCache,data:f,success:function(p,o,n){d("body").modalmanager("removeLoading");var m=a.ajax.getResponse(n);var t=m.contentType;var v=m.data;switch(t){case"json":a.ajax.handleJSON(v,d(d(g).data("ams-json-target")||"#content"));break;case"script":break;case"xml":break;case"html":case"text":default:var r=d(v);var s=d(".modal-dialog",r.wrap("<div></div>").parent());var q=s.data();var u={backdrop:"static",overflow:q.amsModalOverflow||".modal-viewport",maxHeight:q.amsModalMaxHeight===undefined?function(){return d(window).height()-d(".modal-header",r).outerHeight(true)-d("footer",r).outerHeight(true)-85}:a.getFunctionByName(q.amsModalMaxHeight)};var l=d.extend({},u,q.amsModalOptions);l=a.executeFunctionByName(q.amsModalInitCallback,s,l)||l;d("<div>").addClass("modal fade").append(r).modal(l).on("shown",a.dialog.shown).on("hidden",a.dialog.hidden);a.initContent(r);if(j.amsLogEvent!==false){a.stats.logPageview(i)}}}})}})})},shown:function(m){function l(p){var q=d(".scrollmarker.top",f);var o=f.scrollTop();if(o>0){q.show()}else{q.hide()}var n=d(".scrollmarker.bottom",f);if(j+o>=f.get(0).scrollHeight){n.hide()}else{n.show()}}var k=m.target;var f=d(".modal-viewport",k);if(f.exists()){var j=parseInt(f.css("max-height"));var h=d.scrollbarWidth();if((f.css("overflow")!=="hidden")&&(f.height()===j)){d("<div></div>").addClass("scrollmarker").addClass("top").css("top",0).css("width",f.width()-h).hide().appendTo(f);d("<div></div>").addClass("scrollmarker").addClass("bottom").css("top",j-20).css("width",f.width()-h).appendTo(f);f.scroll(l);f.off("resize").on("resize",l)}else{d(".scrollmarker",f).remove()}}d("[data-ams-shown-callback]",k).each(function(){var n=a.getFunctionByName(d(this).data("ams-shown-callback"));if(n){n.call(k,this)}});var g;var i=d(".modal-dialog",k).data("shown-callbacks");if(i){for(g=0;g<i.length;g++){i[g].call(k)}}i=a.dialog._shown_callbacks;if(i){for(g=0;g<i.length;g++){i[g].call(k)}}a.form.setFocus(k)},close:function(g){if(typeof(g)==="string"){g=d(g)}var h=g.parents(".modal").data("modal");if(h){var f=d("body").data("modalmanager");if(f&&(f.getOpenModals().indexOf(h)>=0)){h.hide()}}},hidden:function(i){var h=i.target;a.skin.cleanContainer(h);d("[data-ams-hidden-callback]",h).each(function(){var j=a.getFunctionByName(d(this).data("ams-hidden-callback"));if(j){j.call(h,this)}});var f;var g=d(".modal-dialog",h).data("hide-callbacks");if(g){for(f=0;f<g.length;f++){g[f].call(h)}}g=a.dialog._hide_callbacks;if(g){for(f=0;f<g.length;f++){g[f].call(h)}}}};e.helpers={select2ClearSelection:function(){var g=d(this);var f=g.parents("label");var h=g.data("ams-select2-target");d('[name="'+h+'"]',f).data("select2").val("")},select2FormatSelection:function(g,f){if(g instanceof Array){d(g).each(function(){if(typeof(this)==="object"){f.append(this.text)}else{f.append(this)}})}else{if(typeof(g)==="object"){f.append(g.text)}else{f.append(g)}}},select2QueryUrlResultsCallback:function(h,g,f){switch(h.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+h.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":d(this).data("select2").dropdown.hide();a.dialog.open(h.location);break;default:return{results:h.results||h,more:h.has_more||false,context:h.context}}},select2QueryMethodSuccessCallback:function(i,g,h){var f=i.result;if(typeof(f)==="string"){try{f=JSON.parse(f)}catch(j){}}switch(f.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+f.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":d(this).data("select2").dropdown.hide();a.dialog.open(f.location);break;default:h.callback({results:f.results||f,more:f.has_more||false,context:f.context})}},contextMenuHandler:function(i,j){var h=j.data();if(h.toggle==="modal"){a.dialog.open(j)}else{var g=j.attr("href")||h.amsUrl;if(!g||g.startsWith("javascript")||j.attr("target")){return}a.event.stop();var f=a.getFunctionByName(g);if(typeof(f)==="function"){g=f.call(j,i)}if(typeof(g)==="function"){g.call(j,i)}else{g=g.replace(/\%23/,"#");i=j.data("ams-target");if(i){a.form.confirmChangedForm(i,function(){a.skin.loadURL(g,i,j.data("ams-link-options"),j.data("ams-link-callback"))})}else{a.form.confirmChangedForm(function(){if(g.startsWith("#")){if(g!==location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=g},150)}else{window.location.hash=g}}}else{window.location=g}})}}}},datetimepickerDialogHiddenCallback:function(){d(".datepicker, .timepicker, .datetimepicker",this).datetimepicker("destroy")}};e.plugins={init:function(m){a.plugins.initData(m);var l=[];d("[data-ams-plugins-disabled]",m).each(function(){var r=d(this).data("ams-plugins-disabled").split(/\s+/);for(var s=0;s<r.length;s++){l.push(r[s])}});var j={};var g;function k(r,t){if(j.hasOwnProperty(r)){var s=j[r];s.css=s.css||t.css;s.callbacks.push({callback:t.callback,context:t.context});if(t.register){s.register=true}if(t.async===false){s.async=false}}else{j[r]={src:t.src,css:t.css,callbacks:[{callback:t.callback,context:t.context}],register:t.register,async:t.async}}if(t.css){a.getCSS(t.css,r+"_css")}}d("[data-ams-plugins]",m).each(function(){var u=d(this);var s=u.data("ams-plugins");if(typeof(s)==="string"){var v=u.data("ams-plugins").split(/\s+/);for(var r=0;r<v.length;r++){g=v[r];var t={src:u.data("ams-plugin-"+g+"-src"),css:u.data("ams-plugin-"+g+"-css"),callback:u.data("ams-plugin-"+g+"-callback"),context:u,register:u.data("ams-plugin-"+g+"-register"),async:u.data("ams-plugin-"+g+"-async")};k(g,t)}}else{for(g in s){if(!s.hasOwnProperty(g)){continue}k(g,s[g])}}});var n;function f(u){var s;var t=n.callbacks,v;if(t&&t.length){for(s=0;s<t.length;s++){v=t[s];v.callback=a.getFunctionByName(v.callback);if(n.register!==false){var r=a.plugins.enabled;if(r.hasOwnProperty(g)){r[g].push(v)}else{r[g]=[v]}}}}else{if(n.register!==false){a.plugins.enabled[g]=null}}if((u!==true)&&t&&t.length&&(n.async!==false)){for(s=0;s<t.length;s++){v=t[s];a.executeFunctionByName(v.callback,m,v.context)}}}function i(){var r=a.plugins.enabled[g];for(o=0;o<r.length;o++){var s=r[o];if(s&&s.context&&!a.isInDOM(s.context)){r[o]=null}}}for(g in j){if(!j.hasOwnProperty(g)){continue}n=j[g];if(a.plugins.enabled[g]===undefined){a.getScript(n.src,f,{async:n.async===undefined?true:n.async})}else{i();f(true)}}for(var o in a.plugins.enabled){if(!a.plugins.enabled.hasOwnProperty(o)){continue}if(l.indexOf(o)>=0){continue}var p=a.plugins.enabled[o];if(p){switch(typeof(p)){case"function":p(m);break;default:for(var h=0;h<p.length;h++){var q=p[h];switch(typeof(q)){case"function":q(m);break;default:if(q&&q.callback){q.callback(q.context)}}}}}}},initData:function(f){d("[data-ams-data]",f).each(function(){var g=d(this);var j=g.data("ams-data");if(j){for(var h in j){if(j.hasOwnProperty(h)){var i=j[h];if(typeof(i)!=="string"){i=JSON.stringify(i)}g.attr("data-"+h,i)}}}})},register:function(g,f,i){if(typeof(f)==="function"){i=f;f=null}f=f||g.name;if(a.plugins.enabled.indexOf(f)>=0){if(b){b.warn&&b.warn("Plugin "+f+" is already registered!")}return}if(typeof(g)==="object"){var h=g.src;if(h){a.ajax.check(g.callback,h,function(j){if(j){a.plugins.enabled[f]=a.getFunctionByName(g.callback);if(g.css){a.getCSS(g.css,f+"_css")}if(i){a.executeFunctionByName(i)}}})}else{a.plugins.enabled[f]=a.getFunctionByName(g.callback);if(g.css){a.getCSS(g.css,f+"_css")}if(i){a.executeFunctionByName(i)}}}else{if(typeof(g)==="function"){a.plugins.enabled[f]=g;if(i){a.executeFunctionByName(i)}}}},enabled:{hint:function(f){var g=d(".hint:not(:parents(.nohints))",f);if(g.length>0){a.ajax.check(d.fn.tipsy,a.baseURL+"ext/jquery-tipsy"+a.devext+".js",function(){a.getCSS(a.baseURL+"../css/ext/jquery-tipsy"+a.devext+".css","jquery-tipsy");g.each(function(){var k=d(this);var j=k.data();var l={html:j.amsHintHtml,title:a.getFunctionByName(j.amsHintTitleGetter)||function(){var n=d(this);var m=n.attr("original-title")||n.attr(j.amsHintTitleAttr||"title")||(j.amsHintHtml?n.html():n.text());m=m.replace(/\?_="/,"?_="+new Date().getTime()+'"');return m},opacity:j.amsHintOpacity||0.95,gravity:j.amsHintGravity||"sw",offset:j.amsHintOffset||0};var h=d.extend({},l,j.amsHintOptions);h=a.executeFunctionByName(j.amsHintInitCallback,k,h)||h;var i=k.tipsy(h);a.executeFunctionByName(j.amsHintAfterInitCallback,k,i,h)})})}},contextMenu:function(f){var g=d(".context-menu",f);if(g.length>0){g.each(function(){var k=d(this);var j=k.data();var l={menuSelector:j.amsContextmenuSelector,menuSelected:a.helpers.contextMenuHandler};var h=d.extend({},l,j.amsContextmenuOptions);h=a.executeFunctionByName(j.amsContextmenuInitCallback,k,h)||h;var i=k.contextMenu(h);a.executeFunctionByName(j.amsContextmenuAfterInitCallback,k,i,h)})}},switcher:function(f){d("LEGEND.switcher",f).each(function(){var h=d(this);var g=h.parent("fieldset");var i=h.data();if(!i.amsSwitcher){d('<i class="fa fa-fw"></i>').prependTo(d(this)).addClass(i.amsSwitcherState==="open"?(i.amsSwitcherMinusClass||"fa-minus"):(i.amsSwitcherPlusClass||"fa-plus"));h.on("click",function(k){k.preventDefault();var j={};h.trigger("ams.switcher.before-switch",[h,j]);if(j.veto){return}if(g.hasClass("switched")){g.removeClass("switched");d(".fa",h).removeClass(i.amsSwitcherPlusClass||"fa-plus").addClass(i.amsSwitcherMinusClass||"fa-minus");h.trigger("ams.switcher.opened",[h]);var l=h.attr("id");if(l){d('legend.switcher[data-ams-switcher-sync="'+l+'"]',g).each(function(){var m=d(this);if(m.parents("fieldset").hasClass("switched")){m.click()}})}}else{g.addClass("switched");d(".fa",h).removeClass(i.amsSwitcherMinusClass||"fa-minus").addClass(i.amsSwitcherPlusClass||"fa-plus");h.trigger("ams.switcher.closed",[h])}});if(i.amsSwitcherState!=="open"){g.addClass("switched")}h.data("ams-switcher","on")}})},checker:function(f){d("LEGEND.checker",f).each(function(){var q=d(this);var s=q.parent("fieldset");var i=q.data();if(!i.amsChecker){var g=d('<label class="checkbox"></label>');var l=i.amsCheckerFieldname||("checker_"+a.generateId());var r=l.replace(/\./,"_");var j=i.amsCheckerHiddenPrefix;var k=null;var o=i.amsCheckerHiddenValueOn||"true";var m=i.amsCheckerHiddenValueOff||"false";var h=i.amsCheckerMarker||false;if(j){k=d('<input type="hidden">').attr("name",j+l).val(i.amsCheckerState==="on"?o:m).prependTo(q)}else{if(h){d('<input type="hidden">').attr("name",h).attr("value",1).prependTo(q)}}var p=d('<input type="checkbox">').attr("name",l).attr("id",r).data("ams-checker-hidden-input",k).data("ams-checker-init",true).val(i.amsCheckerValue||true).attr("checked",i.amsCheckerState==="on"?"checked":null);if(i.amsCheckerReadonly){p.attr("disabled","disabled")}else{p.on("change",function(v){v.preventDefault();var t={};var w=d(this).is(":checked");q.trigger("ams.checker.before-switch",[q,t]);if(t.veto){d(this).prop("checked",!w);return}a.executeFunctionByName(i.amsCheckerChangeHandler,q,w);if(!i.amsCheckerCancelDefault){var u=p.data("ams-checker-hidden-input");if(w){if(i.amsCheckerMode==="disable"){s.removeAttr("disabled")}else{s.removeClass("switched")}if(u){u.val(o)}d("[data-required]",s).attr("required","required");q.trigger("ams.checker.opened",[q])}else{if(i.amsCheckerMode==="disable"){s.prop("disabled","disabled")}else{s.addClass("switched")}if(u){u.val(m)}d("[data-required]",s).removeAttr("required");q.trigger("ams.checker.closed",[q])}}})}p.appendTo(g);d(">label",q).attr("for",p.attr("id"));g.append("<i></i>").prependTo(q);var n=d("[required]",s);n.attr("data-required",true);if(i.amsCheckerState==="on"){p.attr("checked",true)}else{if(i.amsCheckerMode==="disable"){s.attr("disabled","disabled")}else{s.addClass("switched")}n.removeAttr("required")}q.data("ams-checker","on")}})},slider:function(f){var g=d(".slider",f);if(g.length>0){a.ajax.check(d.fn.slider,a.baseURL+"ext/bootstrap-slider-2.0.0"+a.devext+".js",function(){g.each(function(){var j=d(this);var k=j.data();var l={};var h=d.extend({},l,j.data.amsSliderOptions);h=a.executeFunctionByName(k.amsSliderInitCallback,j,h)||h;var i=j.slider(h);a.executeFunctionByName(k.amsSliderAfterInitCallback,j,i,h)})})}},draggable:function(g){var f=d(".draggable",g);if(f.length>0){f.each(function(){var h=d(this);var k=h.data();var l={containment:k.amsDraggableContainment,helper:a.getFunctionByName(k.amsDraggableHelper)||k.amsDraggableHelper,start:a.getFunctionByName(k.amsDraggableStart),stop:a.getFunctionByName(k.amsDraggableStop)};var i=d.extend({},l,k.amsDraggableOptions);i=a.executeFunctionByName(k.amsDraggableInitCallback,h,i)||i;var j=h.draggable(i);h.disableSelection();a.executeFunctionByName(k.amsDraggableAfterInitCallback,h,j,i)})}},sortable:function(f){var g=d(".sortable",f);if(g.length>0){g.each(function(){var l=d(this);var j=l.data();var k={items:j.amsSortableItems,handle:j.amsSortableHandle,connectWith:j.amsSortableConnectwith,start:a.getFunctionByName(j.amsSortableStart),over:a.getFunctionByName(j.amsSortableOver),containment:j.amsSortableContainment,placeholder:j.amsSortablePlaceholder,stop:a.getFunctionByName(j.amsSortableStop)};var h=d.extend({},k,j.amsSortableOptions);h=a.executeFunctionByName(j.amsSortableInitCallback,l,h)||h;var i=l.sortable(h);l.disableSelection();a.executeFunctionByName(j.amsSortableAfterInitCallback,l,i,h)})}},resizable:function(g){var f=d(".resizable",g);if(f.length>0){f.each(function(){var h=d(this);var k=h.data();var l={autoHide:k.amsResizableAutohide===false?true:k.amsResizableAutohide,containment:k.amsResizableContainment,grid:k.amsResizableGrid,handles:k.amsResizableHandles,start:a.getFunctionByName(k.amsResizableStart),stop:a.getFunctionByName(k.amsResizableStop)};var i=d.extend({},l,k.amsResizableOptions);i=a.executeFunctionByName(k.amsResizableInitCallback,h,i)||i;var j=h.resizable(i);h.disableSelection();a.executeFunctionByName(k.amsResizableAfterInitCallback,h,j,i)})}},typeahead:function(g){var f=d(".typeahead",g);if(f.length>0){a.ajax.check(d.fn.typeahead,a.baseURL+"ext/jquery-typeahead"+a.devext+".js",function(){f.each(function(){var h=d(this);var k=h.data();var l={};var i=d.extend({},l,k.amsTypeaheadOptions);i=a.executeFunctionByName(k.amsTypeaheadInitCallback,h,i)||i;var j=h.typeahead(i);a.executeFunctionByName(k.amsTypeaheadAfterInitCallback,h,j,i)})})}},select2:function(g){var f=d(".select2",g);if(f.length>0){a.ajax.check(d.fn.select2,a.baseURL+"ext/jquery-select2-3.5.2"+a.devext+".js",function(){f.each(function(){var h=d(this);var l=h.data();var m={placeholder:l.amsSelect2Placeholder,multiple:l.amsSelect2Multiple,minimumInputLength:l.amsSelect2MinimumInputLength||0,maximumSelectionSize:l.amsSelect2MaximumSelectionSize,openOnEnter:l.amsSelect2EnterOpen===undefined?true:l.amsSelect2EnterOpen,allowClear:l.amsSelect2AllowClear===undefined?true:l.amsSelect2AllowClear,width:l.amsSelect2Width||"100%",initSelection:a.getFunctionByName(l.amsSelect2InitSelection),formatSelection:l.amsSelect2FormatSelection===undefined?a.helpers.select2FormatSelection:a.getFunctionByName(l.amsSelect2FormatSelection),formatResult:a.getFunctionByName(l.amsSelect2FormatResult),formatMatches:l.amsSelect2FormatMatches===undefined?function(n){if(n===1){return a.i18n.SELECT2_MATCH}else{return n+a.i18n.SELECT2_MATCHES}}:a.getFunctionByName(l.amsSelect2FormatMatches),formatNoMatches:l.amsSelect2FormatResult===undefined?function(n){return a.i18n.SELECT2_NOMATCHES}:a.getFunctionByName(l.amsSelect2FormatResult),formatInputTooShort:l.amsSelect2FormatInputTooShort===undefined?function(o,p){var q=p-o.length;return a.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,q).replace(/\{1\}/,q===1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(l.amsSelect2FormatInputTooShort),formatInputTooLong:l.amsSelect2FormatInputTooLong===undefined?function(p,o){var q=p.length-o;return a.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,q).replace(/\{1\}/,q===1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(l.amsSelect2FormatInputTooLong),formatSelectionTooBig:l.amsSelect2FormatSelectionTooBig===undefined?function(n){return a.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,n).replace(/\{1\}/,n===1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(l.amsSelect2FormatSelectionTooBig),formatLoadMore:l.amsSelect2FormatLoadMore===undefined?function(n){return a.i18n.SELECT2_LOADMORE}:a.getFunctionByName(l.amsSelect2FormatLoadMore),formatSearching:l.amsSelect2FormatSearching===undefined?function(){return a.i18n.SELECT2_SEARCHING}:a.getFunctionByName(l.amsSelect2FormatSearching),separator:l.amsSelect2Separator||",",tokenSeparators:l.amsSelect2TokensSeparators||[","],tokenizer:a.getFunctionByName(l.amsSelect2Tokenizer)};switch(h.context.type){case"text":case"hidden":if(!m.initSelection){var i=h.data("ams-select2-values");if(i){m.initSelection=function(n,p){var o=[];d(n.val().split(m.separator)).each(function(){o.push({id:this,text:i[this]||this})});p(o)}}}break;default:break}if(h.attr("readonly")){if(h.attr("type")==="hidden"){m.query=function(){return[]}}}else{if(l.amsSelect2Query){m.query=a.getFunctionByName(l.amsSelect2Query);m.minimumInputLength=l.amsSelect2MinimumInputLength||1}else{if(l.amsSelect2QueryUrl){m.ajax={url:l.amsSelect2QueryUrl,quietMillis:l.amsSelect2QuietMillis||200,type:l.amsSelect2QueryType||"POST",dataType:l.amsSelect2QueryDatatype||"json",data:function(p,q,o){var n={};n[l.amsSelect2QueryParamName||"query"]=p;n[l.amsSelect2PageParamName||"page"]=q;n[l.amsSelect2ContextParamName||"context"]=o;return d.extend({},n,l.amsSelect2QueryOptions)},results:a.helpers.select2QueryUrlResultsCallback};m.minimumInputLength=l.amsSelect2MinimumInputLength||1}else{if(l.amsSelect2QueryMethod){m.query=function(n){var o={id:new Date().getTime(),params:l.amsSelect2QueryParams||{},success:function(p){return a.helpers.select2QueryMethodSuccessCallback.call(h,p,"success",n)},error:a.error.show};o.params[l.amsSelect2QueryParamName||"query"]=n.term;o.params[l.amsSelect2PageParamName||"page"]=n.page;o.params[l.amsSelect2ContextParamName||"context"]=n.context;o=d.extend({},o,l.amsSelect2QueryOptions);o=a.executeFunctionByName(l.amsSelect2QueryInitCallback,h,o)||o;a.ajax.check(d.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){d.jsonRPC.withOptions({endPoint:l.amsSelect2MethodTarget||a.jsonrpc.getAddr(),namespace:l.amsSelect2MethodNamespace,cache:false},function(){d.jsonRPC.request(l.amsSelect2QueryMethod,o)})})};m.minimumInputLength=l.amsSelect2MinimumInputLength||1}else{if(l.amsSelect2Tags){m.tags=l.amsSelect2Tags}else{if(l.amsSelect2Data){m.data=l.amsSelect2Data}}}}}}if(l.amsSelect2EnableFreeTags){m.createSearchChoice=function(n){return{id:n,text:(l.amsSelect2FreeTagsPrefix||a.i18n.SELECT2_FREETAG_PREFIX)+n}}}var j=d.extend({},m,l.amsSelect2Options);j=a.executeFunctionByName(l.amsSelect2InitCallback,h,j)||j;var k=h.select2(j);a.executeFunctionByName(l.amsSelect2AfterInitCallback,h,k,j);if(h.hasClass("ordered")){a.ajax.check(d.fn.select2Sortable,a.baseURL+"ext/jquery-select2-sortable"+a.devext+".js",function(){h.select2Sortable({bindOrder:"sortableStop"})})}h.on("change",function(){var n=d(h.get(0).form).data("validator");if(n!==undefined){d(h).valid()}})})})}},maskedit:function(g){var f=d("[data-mask]",g);if(f.length>0){a.ajax.check(d.fn.mask,a.baseURL+"ext/jquery-maskedinput-1.4.1"+a.devext+".js",function(){f.each(function(){var h=d(this);var k=h.data();var l={placeholder:k.amsMaskeditPlaceholder===undefined?"X":k.amsMaskeditPlaceholder,complete:a.getFunctionByName(k.amsMaskeditComplete)};var i=d.extend({},l,k.amsMaskeditOptions);i=a.executeFunctionByName(k.amsMaskeditInitCallback,h,i)||i;var j=h.mask(h.attr("data-mask"),i);a.executeFunctionByName(k.amsMaskeditAfterInitCallback,h,j,i)})})}},inputmask:function(g){var f=d("[data-input-mask]",g);if(f.length>0){a.ajax.check(d.fn.inputmask,a.baseURL+"ext/jquery-inputmask-bundle-3.2.8"+a.devext+".js",function(){f.each(function(){var h=d(this);var k=h.data();var l;if(typeof(k.inputMask)==="object"){l=k.inputMask}else{l={mask:k.inputMask.toString()}}var i=d.extend({},l,k.amsInputmaskOptions);i=a.executeFunctionByName(k.amsInputmaskInitCallback,h,i)||i;var j=h.inputmask(i);a.executeFunctionByName(k.amsInputmaskAfterInitCallback,h,j,i)})})}},datepicker:function(f){var g=d(".datepicker",f);if(g.length>0){a.ajax.check(d.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(h){if(h){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}g.each(function(){var i=d(this);var l=i.data();var m={lang:l.amsDatetimepickerLang||a.lang,format:l.amsDatetimepickerFormat||"d/m/y",datepicker:true,dayOfWeekStart:1,timepicker:false,closeOnDateSelect:l.amsDatetimepickerCloseOnSelect===undefined?true:l.amsDatetimepickerCloseOnSelect,weeks:l.amsDatetimepickerWeeks};var j=d.extend({},m,l.amsDatetimepickerOptions);j=a.executeFunctionByName(l.amsDatetimepickerInitCallback,i,j)||j;var k=i.datetimepicker(j);a.executeFunctionByName(l.amsDatetimepickerAfterInitCallback,i,k,j)})})}},datetimepicker:function(g){var f=d(".datetimepicker",g);if(f.length>0){a.ajax.check(d.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(h){if(h){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}f.each(function(){var i=d(this);var l=i.data();var m={lang:l.amsDatetimepickerLang||a.lang,format:l.amsDatetimepickerFormat||"d/m/y H:i",datepicker:true,dayOfWeekStart:1,timepicker:true,closeOnDateSelect:l.amsDatetimepickerCloseOnSelect===undefined?true:l.amsDatetimepickerCloseOnSelect,closeOnTimeSelect:l.amsDatetimepickerCloseOnSelect===undefined?true:l.amsDatetimepickerCloseOnSelect,weeks:l.amsDatetimepickerWeeks};var j=d.extend({},m,l.amsDatetimepickerOptions);j=a.executeFunctionByName(l.amsDatetimepickerInitCallback,i,j)||j;var k=i.datetimepicker(j);a.executeFunctionByName(l.amsDatetimepickerAfterInitCallback,i,k,j)})})}},timepicker:function(g){var f=d(".timepicker",g);if(f.length>0){a.ajax.check(d.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(h){if(h){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}f.each(function(){var i=d(this);var l=i.data();var m={lang:l.amsDatetimepickerLang||a.lang,format:l.amsDatetimepickerFormat||"H:i",datepicker:false,timepicker:true,closeOnTimeSelect:l.amsDatetimepickerCloseOnSelect===undefined?true:l.amsDatetimepickerCloseOnSelect};var j=d.extend({},m,l.amsDatetimepickerOptions);j=a.executeFunctionByName(l.amsDatetimepickerInitCallback,i,j)||j;var k=i.datetimepicker(j);a.executeFunctionByName(l.amsDatetimepickerAfterInitCallback,i,k,j)})})}},colorpicker:function(f){var g=d(".colorpicker",f);if(g.length>0){a.ajax.check(d.fn.minicolors,a.baseURL+"ext/jquery-minicolors"+a.devext+".js",function(h){if(h){a.getCSS(a.baseURL+"../css/ext/jquery-minicolors"+a.devext+".css","jquery-minicolors")}g.each(function(){var i=d(this);var l=i.data();var m={position:l.amsColorpickerPosition||i.closest("label.input").data("ams-colorpicker-position")||"bottom left"};var j=d.extend({},m,l.amsColorpickerOptions);j=a.executeFunctionByName(l.amsColorpickerInitCallback,i,j)||j;var k=i.minicolors(j);a.executeFunctionByName(l.amsDatetimepickerAfterInitCallback,i,k,j)})})}},validate:function(g){var f=d("FORM:not([novalidate])",g);if(f.length>0){a.ajax.check(d.fn.validate,a.baseURL+"ext/jquery-validate-1.11.1"+a.devext+".js",function(j){if(j){d.validator.setDefaults({highlight:function(k){d(k).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(k){d(k).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(l,m){var k=m.parents("label:first");if(k.length){l.insertAfter(k)}else{l.insertAfter(m)}}});if(a.plugins.i18n){for(var h in a.plugins.i18n.validate){if(!a.plugins.i18n.validate.hasOwnProperty(h)){continue}var i=a.plugins.i18n.validate[h];if((typeof(i)==="string")&&(i.indexOf("{0}")>-1)){a.plugins.i18n.validate[h]=d.validator.format(i)}}d.extend(d.validator.messages,a.plugins.i18n.validate)}}f.each(function(){var m=d(this);var n=m.data();var o={ignore:null,submitHandler:m.attr("data-async")!==undefined?n.amsFormSubmitHandler===undefined?function(){d(".state-error",m).removeClass("state-error");a.ajax.check(d.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+a.devext+".js");return a.form.submit(m)}:a.getFunctionByName(n.amsFormSubmitHandler):undefined,invalidHandler:m.attr("data-async")!==undefined?n.amsFormInvalidHandler===undefined?function(u,t){d(".state-error",m).removeClass("state-error");for(var s=0;s<t.errorList.length;s++){var r=t.errorList[s];var q=d(r.element).parents(".tab-pane").index()+1;if(q>0){var p=d(".nav-tabs",d(r.element).parents(".tabforms"));d("li:nth-child("+q+")",p).removeClassPrefix("state-").addClass("state-error");d("li.state-error:first a",p).click()}}}:a.getFunctionByName(n.amsFormInvalidHandler):undefined};d("[data-ams-validate-rules]",m).each(function(p){if(p===0){o.rules={}}o.rules[d(this).attr("name")]=d(this).data("ams-validate-rules")});var k=d.extend({},o,n.amsValidateOptions);k=a.executeFunctionByName(n.amsValidateInitCallback,m,k)||k;var l=m.validate(k);a.executeFunctionByName(n.amsValidateAfterInitCallback,m,l,k)})})}},datatable:function(g){var f=d(".datatable",g);if(f.length>0){a.ajax.check(d.fn.dataTable,a.baseURL+"ext/jquery-dataTables-1.9.4"+a.devext+".js",function(h){a.ajax.check(d.fn.dataTableExt.oPagination.bootstrap_full,a.baseURL+"myams-dataTables"+a.devext+".js",function(){d(f).each(function(){var w=d(this);var B=w.data();var y=(B.amsDatatableExtensions||"").split(/\s+/);var o=B.amsDatatableSdom||"W"+((y.indexOf("colreorder")>=0||y.indexOf("colreorderwithresize")>=0)?"R":"")+"<'dt-top-row'"+(y.indexOf("colvis")>=0?"C":"")+((B.amsDatatablePagination===false||B.amsDatatablePaginationSize===false)?"":"L")+(B.amsDatatableGlobalFilter===false?"":"F")+">r<'dt-wrapper't"+(y.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(B.amsDatatableInformation===false?"":"i")+"><'col-sm-6 text-right'p>>";var q;var l=B.amsDatatableSorting;if(typeof(l)==="string"){var z=l.split(";");l=[];for(q=0;q<z.length;q++){var j=z[q].split(",");j[0]=parseInt(j[0]);l.push(j)}}var k=[];var n;var v=d("th",w).listattr("data-ams-datatable-sortable");for(q=0;q<v.length;q++){var m=v[q];if(m!==undefined){n=k[q]||{};n.bSortable=m;k[q]=n}}var s=d("th",w).listattr("data-ams-datatable-stype");for(q=0;q<s.length;q++){var p=s[q];if(p){n=k[q]||{};n.sType=p;k[q]=n}}var t={bJQueryUI:false,bFilter:B.amsDatatableGlobalFilter!==false||y.indexOf("columnfilter")>=0,bPaginate:B.amsDatatablePagination!==false,bInfo:B.amsDatatableInfo!==false,bSort:B.amsDatatableSort!==false,aaSorting:l,aoColumns:k.length>0?k:undefined,bDeferRender:true,bAutoWidth:false,iDisplayLength:B.amsDatatableDisplayLength||25,sPaginationType:B.amsDatatablePaginationType||"bootstrap_full",sDom:o,oLanguage:a.plugins.i18n.datatables,fnInitComplete:function(D,C){d(".ColVis_Button").addClass("btn btn-default btn-sm").html((a.plugins.i18n.datatables.sColumns||"Columns")+' <i class="fa fa-fw fa-caret-down"></i>')}};var x=d.extend({},t,B.amsDatatableOptions);var r=[];var i=[];var A=[];if(y.length>0){for(q=0;q<y.length;q++){switch(y[q]){case"autofill":r.push(d.fn.dataTable.AutoFill);i.push(a.baseURL+"ext/jquery-dataTables-autoFill"+a.devext+".js");break;case"columnfilter":r.push(d.fn.columnFilter);i.push(a.baseURL+"ext/jquery-dataTables-columnFilter"+a.devext+".js");break;case"colreorder":r.push(d.fn.dataTable.ColReorder);i.push(a.baseURL+"ext/jquery-dataTables-colReorder"+a.devext+".js");break;case"colreorderwithresize":r.push(window.ColReorder);i.push(a.baseURL+"ext/jquery-dataTables-colReorderWithResize"+a.devext+".js");break;case"colvis":r.push(d.fn.dataTable.ColVis);i.push(a.baseURL+"ext/jquery-dataTables-colVis"+a.devext+".js");A.push(function(){var C={activate:"click",sAlign:"right"};x.oColVis=d.extend({},C,B.amsDatatableColvisOptions)});break;case"editable":r.push(d.fn.editable);i.push(a.baseURL+"ext/jquery-jeditable"+a.devext+".js");r.push(d.fn.makeEditable);i.push(a.baseURL+"ext/jquery-dataTables-editable"+a.devext+".js");break;case"fixedcolumns":r.push(d.fn.dataTable.FixedColumns);i.push(a.baseURL+"ext/jquery-dataTables-fixedColumns"+a.devext+".js");break;case"fixedheader":r.push(d.fn.dataTable.Fixedheader);i.push(a.baseURL+"ext/jquery-dataTables-fixedHeader"+a.devext+".js");break;case"keytable":r.push(window.keyTable);i.push(a.baseURL+"ext/jquery-dataTables-keyTable"+a.devext+".js");break;case"rowgrouping":r.push(d.fn.rowGrouping());i.push(a.baseURL+"ext/jquery-dataTables-rowGrouping"+a.devext+".js");break;case"rowreordering":r.push(d.fn.rowReordering);i.push(a.baseURL+"ext/jquery-dataTables-rowReordering"+a.devext+".js");break;case"scroller":r.push(d.fn.dataTable.Scroller);i.push(a.baseURL+"ext/jquery-dataTables-scroller"+a.devext+".js");break;default:break}}}function u(){x=a.executeFunctionByName(B.amsDatatableInitCallback,w,x)||x;try{var F=w.dataTable(x);a.executeFunctionByName(B.amsDatatableAfterInitCallback,w,F,x);if(y.length>0){for(q=0;q<y.length;q++){switch(y[q]){case"autofill":var N=d.extend({},B.amsDatatableAutofillOptions,x.autofill);N=a.executeFunctionByName(B.amsDatatableAutofillInitCallback,w,N)||N;w.data("ams-autofill",B.amsDatatableAutofillConstructor===undefined?new d.fn.dataTable.AutoFill(w,N):a.executeFunctionByName(B.amsDatatableAutofillConstructor,w,F,N));break;case"columnfilter":var L={sPlaceHolder:"head:after"};var I=d.extend({},L,B.amsDatatableColumnfilterOptions,x.columnfilter);I=a.executeFunctionByName(B.amsDatatableColumnfilterInitCallback,w,I)||I;w.data("ams-columnfilter",B.amsDatatableColumnfilterConstructor===undefined?F.columnFilter(I):a.executeFunctionByName(B.amsDatatableColumnfilterConstructor,w,F,I));break;case"editable":var J=d.extend({},B.amsDatatableEditableOptions,x.editable);J=a.executeFunctionByName(B.amsDatatableEditableInitCallback,w,J)||J;w.data("ams-editable",B.amsDatatableEditableConstructor===undefined?w.makeEditable(J):a.executeFunctionByName(B.amsDatatableEditableConstructor,w,F,J));break;case"fixedcolumns":var O=d.extend({},B.amsDatatableFixedcolumnsOptions,x.fixedcolumns);O=a.executeFunctionByName(B.amsDatatableFixedcolumnsInitCallback,w,O)||O;w.data("ams-fixedcolumns",B.amsDatatableFixedcolumnsConstructor===undefined?new d.fn.dataTable.FixedColumns(w,O):a.executeFunctionByName(B.amsDatatableFixedcolumnsConstructor,w,F,O));break;case"fixedheader":var K=d.extend({},B.amsDatatableFixedheaderOptions,x.fixedheader);K=a.executeFunctionByName(B.amsDatatableFixedheadeInitCallback,w,K)||K;w.data("ams-fixedheader",B.amsDatatableFixedheaderConstructor===undefined?new d.fn.dataTable.FixedHeader(w,K):a.executeFunctionByName(B.amsDatatableFixedheaderConstructor,w,F,K));break;case"keytable":var M={table:w.get(0),datatable:F};var D=d.extend({},M,B.amsDatatableKeytableOptions,x.keytable);D=a.executeFunctionByName(B.amsDatatableKeytableInitCallback,w,D)||D;w.data("ams-keytable",B.amsDatatableKeytableConstructor===undefined?new KeyTable(D):a.executeFunctionByName(B.amsDatatableKeytableConstructor,w,F,D));break;case"rowgrouping":var E=d.extend({},B.amsDatatableRowgroupingOptions,x.rowgrouping);E=a.executeFunctionByName(B.amsDatatableRowgroupingInitCallback,w,E)||E;w.data("ams-rowgrouping",B.amsDatatableRowgroupingConstructor===undefined?w.rowGrouping(E):a.executeFunctionByName(B.amsDatatableRowgroupingConstructor,w,F,E));break;case"rowreordering":var C=d.extend({},B.amsDatatableRowreorderingOptions,x.rowreordering);C=a.executeFunctionByName(B.amsDatatableRowreorderingInitCallback,w,C)||C;w.data("ams-rowreordering",B.amsDatatableRowreorderingConstructor===undefined?w.rowReordering(C):a.executeFunctionByName(B.amsDatatableRowreorderingConstructor,w,F,C));break;default:break}}}if(B.amsDatatableFinalizeCallback){var H=B.amsDatatableFinalizeCallback.split(/\s+/);if(H.length>0){for(q=0;q<H.length;q++){a.executeFunctionByName(H[q],w,F,x)}}}}catch(G){}}A.push(u);a.ajax.check(r,i,A)})})})}},tablednd:function(g){var f=d(".table-dnd",g);if(f.length>0){a.ajax.check(d.fn.tableDnD,a.baseURL+"ext/jquery-tablednd"+a.devext+".js",function(h){f.each(function(){var k=d(this);var l=k.data();if(l.amsTabledndDragHandle){d("tr",k).addClass("no-drag-handle")}else{d(k).on("mouseover","tr",function(){d(this.cells[0]).addClass("drag-handle")}).on("mouseout","tr",function(){d(this.cells[0]).removeClass("drag-handle")})}var m={onDragClass:l.amsTabledndDragClass||"dragging-row",onDragStart:a.getFunctionByName(l.amsTabledndDragStart),dragHandle:l.amsTabledndDragHandle,scrollAmount:l.amsTabledndScrollAmount,onAllowDrop:l.amsTabledndAllowDrop,onDrop:a.getFunctionByName(l.amsTabledndDrop)||function(r,s){var q=l.amsTabledndDropTarget;if(q){d(s).data("ams-disabled-handlers","click");var o=[];d(r.rows).each(function(){var t=d(this).data("ams-element-name");if(t){o.push(t)}});var p=a.getFunctionByName(q);if(typeof(p)==="function"){p.call(k,r,o)}else{if(!q.startsWith(window.location.protocol)){var n=l.amsLocation;if(n){q=n+"/"+q}}a.ajax.post(q,{names:JSON.stringify(o)})}setTimeout(function(){d(s).removeData("ams-disabled-handlers")},50)}return false}};var i=d.extend({},m,l.amsTabledndOptions);i=a.executeFunctionByName(l.amsTabledndInitCallback,k,i)||i;var j=k.tableDnD(i);a.executeFunctionByName(l.amsTabledndAfterInitCallback,k,j,i)})})}},wizard:function(f){var g=d(".wizard",f);if(g.length>0){a.ajax.check(d,a.baseURL+"ext/bootstrap-wizard-1.4.2"+a.devext+".js",function(h){g.each(function(){var l=d(this);var k=l.data();var m={withVisible:k.amsWizardWithVisible===undefined?true:k.amsWizardWithVisible,tabClass:k.amsWizardTabClass,firstSelector:k.amsWizardFirstSelector,previousSelector:k.amsWizardPreviousSelector,nextSelector:k.amsWizardNextSelector,lastSelector:k.amsWizardLastSelector,finishSelector:k.amsWizardFinishSelector,backSelector:k.amsWizardBackSelector,onInit:a.getFunctionByName(k.amsWizardInit),onShow:a.getFunctionByName(k.amsWizardShow),onNext:a.getFunctionByName(k.amsWizardNext),onPrevious:a.getFunctionByName(k.amsWizardPrevious),onFirst:a.getFunctionByName(k.amsWizardFirst),onLast:a.getFunctionByName(k.amsWizardLast),onBack:a.getFunctionByName(k.amsWizardBack),onFinish:a.getFunctionByName(k.amsWizardFinish),onTabChange:a.getFunctionByName(k.amsWizardTabChange),onTabClick:a.getFunctionByName(k.amsWizardTabClick),onTabShow:a.getFunctionByName(k.amsWizardTabShow)};var i=d.extend({},m,k.amsWizardOptions);i=a.executeFunctionByName(k.amsWizardInitCallback,l,i)||i;var j=l.bootstrapWizard(i);a.executeFunctionByName(k.amsWizardAfterInitCallback,l,j,i)})})}},tinymce:function(f){function i(){d(".tinymce",d(this)).each(function(){var j=tinymce.get(d(this).attr("id"));if(j){j.remove()}})}var g=d(".tinymce",f);if(g.length>0){var h=a.baseURL+"ext/tinymce"+(a.devmode?"/dev":"");a.ajax.check(window.tinymce,h+"/tinymce"+a.devext+".js",function(k){function j(){g.each(function(){var o=d(this);var q=o.data();var s={theme:q.amsTinymceTheme||"modern",language:a.lang,plugins:["advlist autosave autolink lists link image charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime media nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern"],toolbar1:q.amsTinymceToolbar1||"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent",toolbar2:q.amsTinymceToolbar2||"forecolor backcolor emoticons | charmap link image media | fullscreen preview print | code",content_css:q.amsTinymceContentCss,formats:q.amsTinymceFormats,style_formats:q.amsTinymceStyleFormats,block_formats:q.amsTinymceBlockFormats,valid_classes:q.amsTinymceValidClasses,image_advtab:true,image_list:a.getFunctionByName(q.amsTinymceImageList)||q.amsTinymceImageList,image_class_list:q.amsTinymceImageClassList,link_list:a.getFunctionByName(q.amsTinymceLinkList)||q.amsTinymceLinkList,link_class_list:q.amsTinymceLinkClassList,resize:true};if(q.amsTinymceExternalPlugins){var r=q.amsTinymceExternalPlugins.split(/\s+/);for(var m in r){var l=o.data("ams-tinymce-plugin-"+r[m]);tinymce.PluginManager.load(r[m],a.getSource(l))}}var n=d.extend({},s,q.amsTinymceOptions);n=a.executeFunctionByName(q.amsTinymceInitCallback,o,n)||n;var p=o.tinymce(n);a.executeFunctionByName(q.amsTinymceAfterInitCallback,o,p,n)})}if(k){a.getScript(h+"/jquery.tinymce"+a.devext+".js",function(){tinymce.baseURL=h;tinymce.suffix=a.devext;a.skin.registerCleanCallback(i);j()})}else{j()}})}},imgareaselect:function(g){var f=d(".imgareaselect",g);if(f.length>0){a.ajax.check(d.fn.imgAreaSelect,a.baseURL+"ext/jquery-imgareaselect-0.9.11-rc1"+a.devext+".js",function(h){if(h){a.getCSS(a.baseURL+"../css/ext/jquery-imgareaselect"+a.devext+".css")}f.each(function(){var m=d(this);var l=m.data();var j=l.amsImgareaselectParent?m.parents(l.amsImgareaselectParent):"body";var n={instance:true,handles:true,parent:j,x1:l.amsImgareaselectX1||0,y1:l.amsImgareaselectY1||0,x2:l.amsImgareaselectX2||l.amsImgareaselectImageWidth,y2:l.amsImgareaselectY2||l.amsImgareaselectImageHeight,imageWidth:l.amsImgareaselectImageWidth,imageHeight:l.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:l.amsImgareaselectRatio,onSelectEnd:a.getFunctionByName(l.amsImgareaselectSelectEnd)||function(o,p){var q=l.amsImgareaselectTargetField||"image_";d('input[name="'+q+'x1"]',j).val(p.x1);d('input[name="'+q+'y1"]',j).val(p.y1);d('input[name="'+q+'x2"]',j).val(p.x2);d('input[name="'+q+'y2"]',j).val(p.y2)}};var i=d.extend({},n,l.amsImgareaselectOptions);i=a.executeFunctionByName(l.amsImgareaselectInitCallback,m,i)||i;var k=m.imgAreaSelect(i);a.executeFunctionByName(l.amsImgareaselectAfterInitCallback,m,k,i);setTimeout(function(){k.update()},250)})})}},fancybox:function(f){var g=d(".fancybox",f);if(g.length>0){a.ajax.check(d.fn.fancybox,a.baseURL+"ext/jquery-fancybox-2.1.5"+a.devext+".js",function(h){if(h){a.getCSS(a.baseURL+"../css/ext/jquery-fancybox-2.1.5"+a.devext+".css")}g.each(function(){var i=d(this);var o=i.data();var n=(o.amsFancyboxHelpers||"").split(/\s+/);if(n.length>0){for(var j=0;j<n.length;j++){var m=n[j];switch(m){case"buttons":a.ajax.check(d.fancybox.helpers.buttons,a.baseURL+"ext/fancybox-helpers/fancybox-buttons"+a.devext+".js");break;case"thumbs":a.ajax.check(d.fancybox.helpers.thumbs,a.baseURL+"ext/fancybox-helpers/fancybox-thumbs"+a.devext+".js");break;case"media":a.ajax.check(d.fancybox.helpers.media,a.baseURL+"ext/fancybox-helpers/fancybox-media"+a.devext+".js");break;default:break}}}var p={type:o.amsFancyboxType,padding:o.amsFancyboxPadding||10,margin:o.amsFancyboxMargin||10,beforeLoad:a.getFunctionByName(o.amsFancyboxBeforeLoad)||function(){this.title=a.executeFunctionByName(o.amsFancyboxTitleGetter,this)||d(this.element).attr("original-title")||d(this.element).attr("title")},helpers:{title:{type:"inside"}}};var k=d.extend({},p,o.amsFancyboxOptions);k=a.executeFunctionByName(o.amsFancyboxInitCallback,i,k)||k;var l=i.fancybox(k);a.executeFunctionByName(o.amsFancyboxAfterInitCallback,i,l,k)})})}},chart:function(f){var g=d(".chart",f);if(g.length>0){a.ajax.check(d.fn.plot,a.baseURL+"flot/jquery.flot"+a.devext+".js",function(){g.each(function(){function m(t){for(var s in d.plot.plugins){var r=d.plot.plugins[s];if(r.name==t){return r}}return null}var p=d(this);var k=p.data();var q={};var i=(k.amsChartPlugins||"").split(/\s+/);if(i.length>0){for(var n in i){var o=i[n];if(!m(o)){a.getScript(a.baseURL+"flot/jquery.flot."+o+a.devext+".js")}}}var h=d.extend({},q,k.amsChartOptions);h=a.executeFunctionByName(k.amsChartInitCallback,p,h)||h;var j=k.amsChartData;j=a.executeFunctionByName(k.amsChartInitData,p,j)||j;var l=p.plot(j,h);a.executeFunctionByName(k.amsChartAfterInitCallback,p,l,h)})})}},graphs:function(g){var f=d(".sparkline",g);if(f.length>0){a.ajax.check(a.graphs,a.baseURL+"myams-graphs"+a.devext+".js",function(){a.graphs.init(f)})}},scrollbars:function(f){var g=d(".scrollbar",f);if(g.length>0){a.ajax.check(d.event.special.mousewheel,a.baseURL+"ext/jquery-mousewheel.min.js",function(){a.ajax.check(d.fn.mCustomScrollbar,a.baseURL+"ext/jquery-mCustomScrollbar"+a.devext+".js",function(h){if(h){a.getCSS(a.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar")}g.each(function(){var m=d(this);var k=m.data();var l={theme:k.amsScrollbarTheme||"light"};var i=d.extend({},l,k.amsScrollbarOptions);i=a.executeFunctionByName(k.amsScrollbarInitCallback,m,i)||i;var j=m.mCustomScrollbar(i);a.executeFunctionByName(k.amsScrollbarAfterInitCallback,m,j,i)})})})}}}};e.callbacks={init:function(f){d("[data-ams-callback]",f).each(function(){var g=this;var h=d(g).data();var i=a.getFunctionByName(h.amsCallback);if(i===undefined){if(h.amsCallbackSource){a.getScript(h.amsCallbackSource,function(){a.executeFunctionByName(h.amsCallback,g,h.amsCallbackOptions)})}else{if(b){b.warn&&b.warn("Undefined callback: "+h.amsCallback)}}}else{i.call(g,h.amsCallbackOptions)}})},alert:function(n){var i=d(this).data();var f=d.extend({},n,i.amsAlertOptions);var l=d(i.amsAlertParent||f.parent||this);var h=i.amsAlertStatus||f.status||"info";var j=i.amsAlertHeader||f.header;var m=i.amsAlertMessage||f.message;var k=i.amsAlertSubtitle||f.subtitle;var g=i.amsAlertMargin===undefined?(f.margin===undefined?false:f.margin):i.amsAlertMargin;a.skin.alert(l,h,j,m,k,g)},messageBox:function(g){var i=d(this).data();var k=d.extend({},g,i.amsMessageboxOptions);var h=d.extend({},k,{title:i.amsMessageboxTitle||k.title||"",content:i.amsMessageboxContent||k.content||"",icon:i.amsMessageboxIcon||k.icon,number:i.amsMessageboxNumber||k.number,timeout:i.amsMessageboxTimeout||k.timeout});var f=i.amsMessageboxStatus||k.status||"info";var j=a.getFunctionByName(i.amsMessageboxCallback||k.callback);a.skin.messageBox(f,h,j)},smallBox:function(g){var i=d(this).data();var k=d.extend({},g,i.amsSmallboxOptions);var h=d.extend({},k,{title:i.amsSmallboxTitle||k.title||"",content:i.amsSmallboxContent||k.content||"",icon:i.amsSmallboxIcon||k.icon,iconSmall:i.amsSmallboxIconSmall||k.iconSmall,timeout:i.amsSmallboxTimeout||k.timeout});var f=i.amsSmallboxStatus||k.status||"info";var j=a.getFunctionByName(i.amsSmallboxCallback||k.callback);a.skin.smallBox(f,h,j)}};e.events={init:function(f){d("[data-ams-events-handlers]",f).each(function(){var h=d(this);var g=h.data("ams-events-handlers");if(g){for(var i in g){if(g.hasOwnProperty(i)){h.on(i,a.getFunctionByName(g[i]))}}}})}};e.container={changeOrder:function(g,h){var f=d('input[name="'+d(this).data("ams-input-name")+'"]',d(this));f.val(h.join(";"))},deleteElement:function(f){return function(){var g=d(this);e.skin.bigBox({title:a.i18n.WARNING,content:'<i class="text-danger fa fa-2x fa-bell shake animated"></i> '+a.i18n.DELETE_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(j){if(j===a.i18n.BTN_OK){var k=g.parents("table").first();var h=k.data("ams-location")||"";var l=g.parents("tr").first();var i=l.data("ams-delete-target")||k.data("ams-delete-target")||"delete-element.json";var m=l.data("ams-element-name");e.ajax.post(h+"/"+i,{object_name:m},function(n,o){if(n.status==="success"){if(k.hasClass("datatable")){k.dataTable().fnDeleteRow(l[0])}else{l.remove()}}else{e.ajax.handleJSON(n)}})}})}}};e.skin={_setPageHeight:function(){var f=d("#main").height();var h=a.leftPanel.height();var g=d(window).height()-a.navbarHeight;if(f>g){a.root.css("min-height",f+a.navbarHeight)}else{a.root.css("min-height",g)}a.leftPanel.css("min-height",g);a.leftPanel.css("max-height",g)},_checkMobileWidth:function(){if(d(window).width()<979){a.root.addClass("mobile-view-activated")}else{if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("mobile-view-activated")}}},_showShortcutButtons:function(){a.shortcuts.animate({height:"show"},200,"easeOutCirc");a.root.addClass("shortcut-on")},_hideShortcutButtons:function(){a.shortcuts.animate({height:"hide"},300,"easeOutCirc");a.root.removeClass("shortcut-on")},checkNotification:function(){var f=d(".badge","#user-activity >span");if(parseInt(f.text())>0){f.removeClass("hidden").addClass("bg-color-red bounceIn animated")}else{f.addClass("hidden").removeClass("bg-color-red bounceIn animated")}},refreshNotificationsPanel:function(g){var f=d(this);f.addClass("disabled");d("i",f).addClass("fa-spin");d('input[name="activity"]:checked',"#user-activity").change();d("i",f).removeClass("fa-spin");f.removeClass("disabled")},_initDesktopWidgets:function(f){if(a.enableWidgets){var g=d(".ams-widget",f);if(g.length>0){a.ajax.check(d.fn.MyAMSWidget,a.baseURL+"myams-widgets"+a.devext+".js",function(){g.each(function(){var j=d(this);var i=j.data();var k={deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"};var h=d.extend({},k,i.amsWidgetOptions);h=a.executeFunctionByName(i.amsWidgetInitcallback,j,h)||h;j.MyAMSWidget(h)});c.MyAMSWidget.initWidgetsGrid(d(".ams-widget-grid",f))})}}},_initMobileWidgets:function(f){if(a.enableMobile&&a.enableWidgets){a.skin._initDesktopWidgets(f)}},alert:function(m,g,h,n,l,f){if(g==="error"){g="danger"}d(".alert-"+g,m).not(".persistent").remove();var j='<div class="'+(f?"margin-10":"")+" alert alert-block alert-"+g+' padding-5 fade in"><a class="close" data-dismiss="alert"><i class="fa fa-check"></i></a><h4 class="alert-heading"><i class="fa fa-fw fa-warning"></i> '+h+"</h4>"+(l?("<p>"+l+"</p>"):"");if(typeof(n)==="string"){j+="<ul><li>"+n+"</li></ul>"}else{if(n){j+="<ul>";for(var i in n){if(!d.isNumeric(i)){continue}j+="<li>"+n[i]+"</li>"}j+="</ul>"}}j+="</div>";var k=d(j).prependTo(m);if(m.exists){a.ajax.check(d.scrollTo,a.baseURL+"ext/jquery-scrollTo.min.js",function(){d.scrollTo(m,{offset:{top:-50}})})}},bigBox:function(f,g){a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){a.notify.messageBox(f,g)})},messageBox:function(f,g,h){if(typeof(f)==="object"){h=g;g=f||{};f="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){switch(f){case"error":case"danger":g.color="#C46A69";break;case"warning":g.color="#C79121";break;case"success":g.color="#739E73";break;default:g.color=g.color||"#3276B1"}g.sound=false;a.notify.bigBox(g,h)})},smallBox:function(f,g,h){if(typeof(f)==="object"){h=g;g=f||{};f="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){switch(f){case"error":case"danger":g.color="#C46A69";break;case"warning":g.color="#C79121";break;case"success":g.color="#739E73";break;default:g.color=g.color||"#3276B1"}g.sound=false;a.notify.smallBox(g,h)})},_drawBreadCrumb:function(){var f=d("OL.breadcrumb","#ribbon");d("li",f).not(".parent").remove();if(!d("li",f).exists()){f.append(d("<li></li>").append(d("<a></a>").text(a.i18n.HOME).addClass("padding-right-5").attr("href",d('nav a[href!="#"]:first').attr("href"))))}d("LI.active >A","nav").each(function(){var i=d(this);var g=d.trim(i.clone().children(".badge").remove().end().text());var h=d("<li></li>").append(i.attr("href").replace(/^#/,"")?d("<a></a>").html(g).attr("href",i.attr("href")):g);f.append(h)})},checkURL:function(){function f(m){d(".active",k).removeClass("active");m.addClass("open").addClass("active");m.parents("li").addClass("open active").children("ul").addClass("active").show();m.parents("li:first").removeClass("open");m.parents("ul").addClass(m.attr("href").replace(/^#/,"")?"active":"").show()}var l;var k=d("nav");var i=location.hash;var h=i.replace(/^#/,"");if(h){var g=d("#content");if(!g.exists()){g=d("body")}l=d('A[href="'+i+'"]',k);if(l.exists()){f(l)}a.skin.loadURL(h,g,{afterLoadCallback:function(){var m=d("html head title").data("ams-title-prefix");document.title=(m?m+" > ":"")+(d("[data-ams-page-title]:first",g).data("ams-page-title")||l.attr("title")||document.title)}})}else{var j=d("[data-ams-active-menu]").data("ams-active-menu");if(j){l=d('A[href="'+j+'"]',k)}else{l=d('>UL >LI >A[href!="#"]',k).first()}if(l.exists()){f(l);if(j){a.skin._drawBreadCrumb()}else{window.location.hash=l.attr("href")}}}},_clean_callbacks:[],registerCleanCallback:function(g){var f=a.skin._clean_callbacks;if(f.indexOf(g)<0){f.push(g)}},unregisterCleanCallback:function(h){var g=a.skin._clean_callbacks;var f=g.indexOf(h);if(f>=0){g.splice(f,1)}},cleanContainer:function(f){var h=a.skin._clean_callbacks;for(var g=0;g<h.length;g++){h[g].call(f)}},loadURL:function(h,f,g,k){if(h.startsWith("#")){h=h.substr(1)}if(typeof(g)==="function"){k=g;g={}}else{if(g===undefined){g={}}}f=d(f);var j={type:"GET",url:h,dataType:"html",cache:false,beforeSend:function(){a.skin.cleanContainer(f);f.html('<h1 class="loading"><i class="fa fa-cog fa-spin"></i> '+a.i18n.LOADING+" </h1>");if(f[0]===d("#content")[0]){a.skin._drawBreadCrumb();var l=d("html head title").data("ams-title-prefix");document.title=(l?l+" > ":"")+d(".breadcrumb LI:last-child").text();d("html, body").animate({scrollTop:0},"fast")}else{f.animate({scrollTop:0},"fast")}},success:function(q,m,p){if(k){a.executeFunctionByName(k,this,q,m,p,g)}else{var o=a.ajax.getResponse(p);var n=o.contentType;var l=o.data;d(".loading",f).remove();switch(n){case"json":a.ajax.handleJSON(l,f);break;case"script":break;case"xml":break;case"html":case"text":default:f.parents(".hidden").removeClass("hidden");d(".alert",f.parents(".alerts-container")).remove();f.css({opacity:"0.0"}).html(q).removeClass("hidden").delay(50).animate({opacity:"1.0"},300);a.initContent(f);a.form.setFocus(f)}if(g&&g.afterLoadCallback){a.executeFunctionByName(g.afterLoadCallback,this)}a.stats.logPageview()}},error:function(n,m,l){f.html('<h3 class="error"><i class="fa fa-warning txt-color-orangeDark"></i> '+a.i18n.ERROR+l+"</h3>"+n.responseText)},async:g.async===undefined?true:g.async};var i=d.extend({},j,g);d.ajax(i)},setLanguage:function(g){var i=g.lang;var h=g.handler_type||"json";switch(h){case"json":var j=g.method||"setUserLanguage";a.jsonrpc.post(j,{lang:i},function(){window.location.reload(true)});break;case"ajax":var f=g.href||"setUserLanguage";a.ajax.post(f,{lang:i},function(){window.location.reload(true)});break}},logout:function(){window.location=a.loginURL}};e.stats={logPageview:function(g){if(typeof(c._gaq)==="undefined"){return}var f=c.window.location;c._gaq.push(["_trackPageview",g||f.pathname+f.hash])},logEvent:function(g,h,f){if(typeof(c._gaq)==="undefined"){return}if(typeof(g)==="object"){h=g.action;f=g.label;g=g.category}c._gaq.push(["_trackEvent",g,h,f])}};e.initPage=function(){var f=d("body");a.root=f;a.leftPanel=d("#left-panel");a.shortcuts=d("#shortcuts");a.plugins.initData(f);var h=d.ajaxSettings.xhr;d.ajaxSetup({progress:a.ajax.progress,progressUpload:a.ajax.progress,xhr:function(){var j=h();if(j&&(typeof(j.addEventListener)==="function")){var i=this;j.addEventListener("progress",function(k){i.progress(k)},false)}return j}});d(document).ajaxStart(a.ajax.start);d(document).ajaxStop(a.ajax.stop);d(document).ajaxError(a.error.ajax);if(!a.isMobile){a.root.addClass("desktop-detected");a.device="desktop"}else{a.root.addClass("mobile-detected");a.device="mobile";if(a.enableFastclick){a.ajax.check(d.fn.noClickDelay,a.baseURL+"/ext/jquery-smartclick"+a.devext+".js",function(){d("NAV UL A").noClickDelay();d("A","#hide-menu").noClickDelay()})}}d("#hide-menu >:first-child > A").click(function(i){f.toggleClass("hidden-menu");i.preventDefault()});d("#show-shortcuts").click(function(i){if(a.shortcuts.is(":visible")){a.skin._hideShortcutButtons()}else{a.skin._showShortcutButtons()}i.preventDefault()});a.shortcuts.click(function(i){a.skin._hideShortcutButtons()});d(document).mouseup(function(i){if(!a.shortcuts.is(i.target)&&a.shortcuts.has(i.target).length===0){a.skin._hideShortcutButtons()}});d("#search-mobile").click(function(){a.root.addClass("search-mobile")});d("#cancel-search-js").click(function(){a.root.removeClass("search-mobile")});d(".activity-button","#user-activity").click(function(j){var i=d("#user-activity");var k=d(".ajax-dropdown",i);if(!k.is(":visible")){k.css("left",-k.innerWidth()+i.innerWidth()).fadeIn(150);i.addClass("active")}else{k.fadeOut(150);i.removeClass("active")}j.preventDefault()});a.skin.checkNotification();d(document).mouseup(function(i){var j=d(".ajax-dropdown");if(!j.is(i.target)&&j.has(i.target).length===0){j.fadeOut(150).prev().removeClass("active")}});d('input[name="activity"]').change(function(l){var k=d(this).data("ams-url");if(k){l.preventDefault();l.stopPropagation();var j=a.getFunctionByName(k);if(typeof(j)==="function"){k=j.call(this)}if(typeof(k)==="function"){k.call(this)}else{var i=d(".ajax-notifications");a.skin.loadURL(k,i)}}});d("a","#user-menu LI.logout").click(function(i){i.preventDefault();i.stopPropagation();a.loginURL=d(this).attr("href");a.skin.bigBox({title:"<i class='fa fa-sign-out txt-color-orangeDark'></i> "+a.i18n.LOGOUT+" <span class='txt-color-orangeDark'><strong>"+d("#show-shortcut").text()+"</strong></span> ?",content:a.i18n.LOGOUT_COMMENT,buttons:"["+a.i18n.BTN_NO+"]["+a.i18n.BTN_YES+"]"},function(j){if(j===a.i18n.BTN_YES){a.root.addClass("animated fadeOutUp");setTimeout(a.skin.logout,1000)}})});var g=d("nav");d("UL",g).myams_menu({accordion:g.data("ams-menu-accordion")!==false,speed:a.menuSpeed});d(".minifyme").click(function(i){d("BODY").toggleClass("minified");d(this).effect("highlight",{},500);i.preventDefault()});d("#refresh").click(function(i){a.skin.bigBox({title:"<i class='fa fa-refresh' style='color: green'></i> "+a.i18n.CLEAR_STORAGE_TITLE,content:a.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+a.i18n.BTN_CANCEL+"]["+a.i18n.BTN_OK+"]"},function(j){if(j===a.i18n.BTN_OK&&localStorage){localStorage.clear();location.reload()}});i.preventDefault()});f.on("click",function(j){var i=d(this);if(!i.is(j.target)&&i.has(j.target).length===0&&d(".popover").has(j.target).length===0){i.popover("hide")}});a.ajax.check(d.resize,a.baseURL+"ext/jquery-resize"+a.devext+".js",function(){d("#main").resize(function(){a.skin._setPageHeight();a.skin._checkMobileWidth()});g.resize(function(){a.skin._setPageHeight()})});if(a.ajaxNav){d(document).on("click",'a[href="#"]',function(i){i.preventDefault()});d(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(n){var l=d(n.currentTarget);var k=l.data("ams-disabled-handlers");if((k===true)||(k==="click")||(k==="all")){return}var j=l.attr("href")||l.data("ams-url");if(!j||j.startsWith("javascript")||l.attr("target")||(l.data("ams-context-menu")===true)){return}n.preventDefault();n.stopPropagation();var i=a.getFunctionByName(j);if(typeof(i)==="function"){j=i.call(l)}if(typeof(j)==="function"){j.call(l)}else{j=j.replace(/\%23/,"#");var m=l.data("ams-target");if(m){a.form.confirmChangedForm(m,function(){a.skin.loadURL(j,m,l.data("ams-link-options"),l.data("ams-link-callback"))})}else{a.form.confirmChangedForm(function(){if(j.startsWith("#")){if(j!==location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=j},50)}else{window.location.hash=j}}}else{window.location=j}})}}});d(document).on("click",'a[target="_blank"]',function(j){j.preventDefault();var i=d(j.currentTarget);window.open(i.attr("href"));a.stats.logEvent(i.data("ams-stats-category")||"Navigation",i.data("ams-stats-action")||"External",i.data("ams-stats-label")||i.attr("href"))});d(document).on("click",'a[target="_top"]',function(i){i.preventDefault();a.form.confirmChangedForm(function(){window.location=d(i.currentTarget).attr("href")})});d(window).on("hashchange",a.skin.checkURL)}d(document).off("click.modal").on("click",'[data-toggle="modal"]',function(k){var j=d(this);var i=j.data("ams-disabled-handlers");if((i===true)||(i==="click")||(i==="all")){return}if(j.data("ams-context-menu")===true){return}if(j.data("ams-stop-propagation")===true){k.stopPropagation()}k.preventDefault();a.dialog.open(j);if(j.parents("#shortcut").exists()){setTimeout(a.skin._hideShortcutButtons,300)}});d(document).on("click",'button[type="submit"], button.submit',function(){var i=d(this);d(i.get(0).form).data("ams-submit-button",i)});d(document).on("click",'input[type="checkbox"][readonly]',function(){return false});d(document).on("click","[data-ams-click-handler]",function(l){var k=d(this);var i=k.data("ams-disabled-handlers");if((i===true)||(i==="click")||(i==="all")){return}var j=k.data();if(j.amsClickHandler){if((j.amsStopPropagation===true)||(j.amsClickStopPropagation===true)){l.stopPropagation()}if(j.amsClickKeepDefault!==true){l.preventDefault()}var m=a.getFunctionByName(j.amsClickHandler);if(m!==undefined){m.call(k,j.amsClickHandlerOptions)}}});d(document).on("change","[data-ams-change-handler]",function(l){var k=d(this);if(k.prop("readonly")){return}var i=k.data("ams-disabled-handlers");if((i===true)||(i==="change")||(i==="all")){return}var j=k.data();if(j.amsChangeHandler){if(j.amsChangeKeepDefault!==true){l.preventDefault()}var m=a.getFunctionByName(j.amsChangeHandler);if(m!==undefined){m.call(k,j.amsChangeHandlerOptions)}}});d(document).on("reset","form",function(j){var i=d(this);setTimeout(function(){d('INPUT.select2[type="hidden"]',i).each(function(){var l=d(this);var k=l.data("select2");l.select2("val",l.data("ams-select2-input-value").split(k.opts.separator))});i.find(".select2").trigger("change");d("[data-ams-reset-callback]",i).each(function(){var k=d(this);var l=k.data();var m=a.getFunctionByName(l.amsResetCallback);if(m!==undefined){m.call(i,k,l.amsResetCallbackOptions)}})},10);a.form.setFocus(i)});d(document).on("reset","[data-ams-reset-handler]",function(k){var i=d(this);var j=i.data();if(j.amsResetHandler){if(j.amsResetKeepDefault!==true){k.preventDefault()}var l=a.getFunctionByName(j.amsResetHandler);if(l!==undefined){l.call(i,j.amsResetHandlerOptions)}}});d(document).on("change",'input[type="file"]',function(k){k.preventDefault();var i=d(this);var j=i.parent(".button");if(j.exists()&&j.parent().hasClass("input-file")){j.next('input[type="text"]').val(i.val())}});d(document).on("focusin",function(i){if(d(i.target).closest(".mce-window").length){i.stopImmediatePropagation()}});d("a[data-toggle=tab]",".nav-tabs").on("click",function(i){if(d(this).parent("li").hasClass("disabled")){i.preventDefault();return false}});d(document).on("show.bs.tab",function(k){var i=d(k.target);var j=i.data();if(j.amsUrl){if(j.amsTabLoaded){return}try{i.append('<i class="fa fa-spin fa-cog margin-left-5"></i>');a.skin.loadURL(j.amsUrl,i.attr("href"),{afterLoadCallback:function(){if(j.amsTabLoadOnce){i.data("ams-tab-loaded",true)}}})}finally{d("i",i).remove()}}});d(document).on("hide.bs.modal",function(j){var i=d(j.target);a.form.confirmChangedForm(i,function(){i.data("modal").isShown=true;return true},function(){j.preventDefault();return false})});a.initContent(document);if(a.ajaxNav&&g.exists()){a.skin.checkURL()}a.form.setFocus(document);d(window).on("beforeunload",a.form.checkBeforeUnload)};e.initContent=function(f){d(".tipsy").remove();d("[rel=tooltip]",f).tooltip();d("[rel=popover]",f).popover();d("[rel=popover-hover]",f).popover({trigger:"hover"});a.plugins.init(f);a.callbacks.init(f);a.events.init(f);a.form.init(f);if(a.device==="desktop"){a.skin._initDesktopWidgets(f)}else{a.skin._initMobileWidgets(f)}a.skin._setPageHeight()};e.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",LOADING:"Loading...",PROGRESS:"Processing",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",NO_SERVER_RESPONSE:"No response from server!",ERROR_OCCURED:"An error occured!",ERRORS_OCCURED:"Some errors occured!",BAD_LOGIN_TITLE:"Bad login!",BAD_LOGIN_MESSAGE:"Your anthentication credentials didn't allow you to open a session; please check your credentials or contact administrator.",CONFIRM:"Confirm",CONFIRM_REMOVE:"Removing this content can't be undone. Do you confirm?",CLEAR_STORAGE_TITLE:"Clear Local Storage",CLEAR_STORAGE_CONTENT:"Would you like to RESET all your saved widgets and clear LocalStorage?",BTN_OK:"OK",BTN_CANCEL:"Cancel",BTN_OK_CANCEL:"[OK][Cancel]",BTN_YES:"Yes",BTN_NO:"No",BTN_YES_NO:"[Yes][No]",CLIPBOARD_COPY:"Copy to clipboard with Ctrl+C, and Enter",CLIPBOARD_COPY_OK:"Text copied to clipboard",FORM_CHANGED_WARNING:"Some changes were not saved. These updates will be lost if you leave this page.",DELETE_WARNING:"This change can't be undone. Are you sure that you want to delete this element?",NO_UPDATE:"No changes were applied.",DATA_UPDATED:"Data successfully updated.",HOME:"Home",LOGOUT:"Logout?",LOGOUT_COMMENT:"You can improve your security further after logging out by closing this opened browser",SELECT2_PLURAL:"s",SELECT2_MATCH:"One result is available, press enter to select it.",SELECT2_MATCHES:" results are available, use up and down arrow keys to navigate.",SELECT2_NOMATCHES:"No matches found",SELECT2_SEARCHING:"Searching...",SELECT2_LOADMORE:"Loading more results...",SELECT2_INPUT_TOOSHORT:"Please enter {0} more character{1}",SELECT2_INPUT_TOOLONG:"Please delete {0} character{1}",SELECT2_SELECTION_TOOBIG:"You can only select {0} item{1}",SELECT2_FREETAG_PREFIX:"Free text: ",DT_COLUMNS:"Columns"};d(document).ready(function(){d=jQuery.noConflict();var f=d("HTML");var g=f.attr("lang")||f.attr("xml:lang");if(g&&!g.startsWith("en")){e.lang=g;e.getScript(e.baseURL+"i18n/myams_"+g.substr(0,2)+".js",function(){e.initPage()})}else{e.initPage()}})})(jQuery,this);
\ No newline at end of file