--- a/src/pyams_skin/resources/js/myams.min.js Tue Apr 18 11:35:26 2017 +0200
+++ b/src/pyams_skin/resources/js/myams.min.js Tue Apr 18 11:38:32 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.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.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.statusText==="OK"){return}var 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,h,j,e){if(typeof(j)==="object"){e=j;j=undefined}var i={async:typeof(j)==="function"};var g=c.extend({},i,e);if(f===undefined){a.getScript(h,function(){if(typeof(j)==="function"){j(true,e)}},g)}else{if(typeof(j)==="function"){j(false,e)}}},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.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(){m.button("reset");clearInterval(N);a.executeFunctionByName(H,o,m)}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{m.text(m.data("ams-progress-text")+" "+Q.current+" / "+Q.length)}}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{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){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 h=f.data("ams-data");if(h){for(var g in h){if(h.hasOwnProperty(g)){f.attr("data-"+g,h[g])}}}})},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){c(e).each(function(){a.ajax.check(c.fn.dataTableExt.oPagination.bootstrap_full,a.baseURL+"myams-dataTables"+a.devext+".js");var D=c(this);var K=D.data();var G=(K.amsDatatableExtensions||"").split(/\s+/);var q=K.amsDatatableSdom||"W"+((G.indexOf("colreorder")>=0||G.indexOf("colreorderwithresize")>=0)?"R":"")+"<'dt-top-row'"+(G.indexOf("colvis")>=0?"C":"")+((K.amsDatatablePagination===false||K.amsDatatablePaginationSize===false)?"":"L")+(K.amsDatatableGlobalFilter===false?"":"F")+">r<'dt-wrapper't"+(G.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(K.amsDatatableInformation===false?"":"i")+"><'col-sm-6 text-right'p>>";var u;var m=K.amsDatatableSorting;if(typeof(m)==="string"){var J=m.split(";");m=[];for(u=0;u<J.length;u++){var i=J[u].split(",");i[0]=parseInt(i[0]);m.push(i)}}var j=[];var o;var A=c("th",D).listattr("data-ams-datatable-sortable");for(u=0;u<A.length;u++){var n=A[u];if(n!==undefined){o=j[u]||{};o.bSortable=n;j[u]=o}}var v=c("th",D).listattr("data-ams-datatable-stype");for(u=0;u<v.length;u++){var s=v[u];if(s){o=j[u]||{};o.sType=s;j[u]=o}}var x={bJQueryUI:false,bFilter:K.amsDatatableGlobalFilter!==false||G.indexOf("columnfilter")>=0,bPaginate:K.amsDatatablePagination!==false,bInfo:K.amsDatatableInfo!==false,bSort:K.amsDatatableSort!==false,aaSorting:m,aoColumns:j.length>0?j:undefined,bDeferRender:true,bAutoWidth:false,iDisplayLength:K.amsDatatableDisplayLength||25,sPaginationType:K.amsDatatablePaginationType||"bootstrap_full",sDom:q,oLanguage:a.plugins.i18n.datatables,fnInitComplete:function(M,L){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 E=c.extend({},x,K.amsDatatableOptions);if(G.length>0){for(u=0;u<G.length;u++){switch(G[u]){case"autofill":a.ajax.check(c.fn.dataTable.AutoFill,a.baseURL+"ext/jquery-dataTables-autoFill"+a.devext+".js");break;case"columnfilter":a.ajax.check(c.fn.columnFilter,a.baseURL+"ext/jquery-dataTables-columnFilter"+a.devext+".js");break;case"colreorder":a.ajax.check(c.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorder"+a.devext+".js");break;case"colreorderwithresize":a.ajax.check(c.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorderWithResize"+a.devext+".js");break;case"colvis":a.ajax.check(c.fn.dataTable.ColVis,a.baseURL+"ext/jquery-dataTables-colVis"+a.devext+".js");var w={activate:"click",sAlign:"right"};E.oColVis=c.extend({},w,K.amsDatatableColvisOptions);break;case"editable":a.ajax.check(c.fn.editable,a.baseURL+"ext/jquery-jeditable"+a.devext+".js");a.ajax.check(c.fn.makeEditable,a.baseURL+"ext/jquery-dataTables-editable"+a.devext+".js");break;case"fixedcolumns":a.ajax.check(c.fn.dataTable.FixedColumns,a.baseURL+"ext/jquery-dataTables-fixedColumns"+a.devext+".js");break;case"fixedheader":a.ajax.check(c.fn.dataTable.FixedHeader,a.baseURL+"ext/jquery-dataTables-fixedHeader"+a.devext+".js");break;case"keytable":a.ajax.check(window.KeyTable,a.baseURL+"ext/jquery-dataTables-keyTable"+a.devext+".js");break;case"rowgrouping":a.ajax.check(c.fn.rowGrouping,a.baseURL+"ext/jquery-dataTables-rowGrouping"+a.devext+".js");break;case"rowreordering":a.ajax.check(c.fn.rowReordering,a.baseURL+"ext/jquery-dataTables-rowReordering"+a.devext+".js");break;case"scroller":a.ajax.check(c.fn.dataTable.Scroller,a.baseURL+"ext/jquery-dataTables-scroller"+a.devext+".js");break;default:break}}}E=a.executeFunctionByName(K.amsDatatableInitCallback,D,E)||E;try{var p=D.dataTable(E);a.executeFunctionByName(K.amsDatatableAfterInitCallback,D,p,E);if(G.length>0){for(u=0;u<G.length;u++){switch(G[u]){case"autofill":var l=c.extend({},K.amsDatatableAutofillOptions,E.autofill);l=a.executeFunctionByName(K.amsDatatableAutofillInitCallback,D,l)||l;D.data("ams-autofill",K.amsDatatableAutofillConstructor===undefined?new c.fn.dataTable.AutoFill(D,l):a.executeFunctionByName(K.amsDatatableAutofillConstructor,D,p,l));break;case"columnfilter":var I={sPlaceHolder:"head:after"};var H=c.extend({},I,K.amsDatatableColumnfilterOptions,E.columnfilter);H=a.executeFunctionByName(K.amsDatatableColumnfilterInitCallback,D,H)||H;D.data("ams-columnfilter",K.amsDatatableColumnfilterConstructor===undefined?p.columnFilter(H):a.executeFunctionByName(K.amsDatatableColumnfilterConstructor,D,p,H));break;case"editable":var z=c.extend({},K.amsDatatableEditableOptions,E.editable);z=a.executeFunctionByName(K.amsDatatableEditableInitCallback,D,z)||z;D.data("ams-editable",K.amsDatatableEditableConstructor===undefined?D.makeEditable(z):a.executeFunctionByName(K.amsDatatableEditableConstructor,D,p,z));break;case"fixedcolumns":var y=c.extend({},K.amsDatatableFixedcolumnsOptions,E.fixedcolumns);y=a.executeFunctionByName(K.amsDatatableFixedcolumnsInitCallback,D,y)||y;D.data("ams-fixedcolumns",K.amsDatatableFixedcolumnsConstructor===undefined?new c.fn.dataTable.FixedColumns(D,y):a.executeFunctionByName(K.amsDatatableFixedcolumnsConstructor,D,p,y));break;case"fixedheader":var k=c.extend({},K.amsDatatableFixedheaderOptions,E.fixedheader);k=a.executeFunctionByName(K.amsDatatableFixedheadeInitCallback,D,k)||k;D.data("ams-fixedheader",K.amsDatatableFixedheaderConstructor===undefined?new c.fn.dataTable.FixedHeader(D,k):a.executeFunctionByName(K.amsDatatableFixedheaderConstructor,D,p,k));break;case"keytable":var r={table:D.get(0),datatable:p};var F=c.extend({},r,K.amsDatatableKeytableOptions,E.keytable);F=a.executeFunctionByName(K.amsDatatableKeytableInitCallback,D,F)||F;D.data("ams-keytable",K.amsDatatableKeytableConstructor===undefined?new KeyTable(F):a.executeFunctionByName(K.amsDatatableKeytableConstructor,D,p,F));break;case"rowgrouping":var h=c.extend({},K.amsDatatableRowgroupingOptions,E.rowgrouping);h=a.executeFunctionByName(K.amsDatatableRowgroupingInitCallback,D,h)||h;D.data("ams-rowgrouping",K.amsDatatableRowgroupingConstructor===undefined?D.rowGrouping(h):a.executeFunctionByName(K.amsDatatableRowgroupingConstructor,D,p,h));break;case"rowreordering":var t=c.extend({},K.amsDatatableRowreorderingOptions,E.rowreordering);t=a.executeFunctionByName(K.amsDatatableRowreorderingInitCallback,D,t)||t;D.data("ams-rowreordering",K.amsDatatableRowreorderingConstructor===undefined?D.rowReordering(t):a.executeFunctionByName(K.amsDatatableRowreorderingConstructor,D,p,t));break;default:break}}}var B=(K.amsDatatableFinalizeCallback||"").split(/\s+/);if(B.length>0){for(u=0;u<B.length;u++){a.executeFunctionByName(B[u],D,p,E)}}}catch(C){}})})}},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()}}})}})}}};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(m){c(".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=c("nav");var i=location.hash;var g=i.replace(/^#/,"");if(g){var f=c("#content");if(!f.exists()){f=c("body")}l=c('A[href="'+i+'"]',k);if(l.exists()){e(l)}a.skin.loadURL(g,f);var h=c("html head title").data("ams-title-prefix");document.title=(h?h+" > ":"")+(c("[data-ams-page-title]:first",f).data("ams-page-title")||l.attr("title")||document.title)}else{var j=c("[data-ams-active-menu]").data("ams-active-menu");if(j){l=c('A[href="'+j+'"]',k)}else{l=c('>UL >LI >A[href!="#"]',k).first()}if(l.exists()){e(l);if(j){a.skin._drawBreadCrumb()}else{window.location.hash=l.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={}}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> 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:false};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")},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"));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: ",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(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.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.statusText==="OK"){return}var 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(h,j,l,g){if(typeof(l)==="object"){g=l;l=undefined}var k={async:typeof(l)==="function"};var i=c.extend({},k,g);if(h instanceof Array){var e=[];for(var f=0;f<h.length;f++){if(h[f]===undefined){e.push(a.getScript(j[f],{async:true}))}}if(e.length>0){c.when.apply(c,e).then(function(){if(typeof(l)==="function"){l(true,g)}})}else{if(typeof(l)==="function"){l(false,g)}}}else{if(h===undefined){if(typeof(j)==="string"){a.getScript(j,function(){if(typeof(l)==="function"){l(true,g)}},i)}}else{if(typeof(l)==="function"){l(false,g)}}}},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){c(e).each(function(){a.ajax.check(c.fn.dataTableExt.oPagination.bootstrap_full,a.baseURL+"myams-dataTables"+a.devext+".js");var D=c(this);var K=D.data();var G=(K.amsDatatableExtensions||"").split(/\s+/);var q=K.amsDatatableSdom||"W"+((G.indexOf("colreorder")>=0||G.indexOf("colreorderwithresize")>=0)?"R":"")+"<'dt-top-row'"+(G.indexOf("colvis")>=0?"C":"")+((K.amsDatatablePagination===false||K.amsDatatablePaginationSize===false)?"":"L")+(K.amsDatatableGlobalFilter===false?"":"F")+">r<'dt-wrapper't"+(G.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(K.amsDatatableInformation===false?"":"i")+"><'col-sm-6 text-right'p>>";var u;var m=K.amsDatatableSorting;if(typeof(m)==="string"){var J=m.split(";");m=[];for(u=0;u<J.length;u++){var i=J[u].split(",");i[0]=parseInt(i[0]);m.push(i)}}var j=[];var o;var A=c("th",D).listattr("data-ams-datatable-sortable");for(u=0;u<A.length;u++){var n=A[u];if(n!==undefined){o=j[u]||{};o.bSortable=n;j[u]=o}}var v=c("th",D).listattr("data-ams-datatable-stype");for(u=0;u<v.length;u++){var s=v[u];if(s){o=j[u]||{};o.sType=s;j[u]=o}}var x={bJQueryUI:false,bFilter:K.amsDatatableGlobalFilter!==false||G.indexOf("columnfilter")>=0,bPaginate:K.amsDatatablePagination!==false,bInfo:K.amsDatatableInfo!==false,bSort:K.amsDatatableSort!==false,aaSorting:m,aoColumns:j.length>0?j:undefined,bDeferRender:true,bAutoWidth:false,iDisplayLength:K.amsDatatableDisplayLength||25,sPaginationType:K.amsDatatablePaginationType||"bootstrap_full",sDom:q,oLanguage:a.plugins.i18n.datatables,fnInitComplete:function(M,L){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 E=c.extend({},x,K.amsDatatableOptions);if(G.length>0){for(u=0;u<G.length;u++){switch(G[u]){case"autofill":a.ajax.check(c.fn.dataTable.AutoFill,a.baseURL+"ext/jquery-dataTables-autoFill"+a.devext+".js");break;case"columnfilter":a.ajax.check(c.fn.columnFilter,a.baseURL+"ext/jquery-dataTables-columnFilter"+a.devext+".js");break;case"colreorder":a.ajax.check(c.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorder"+a.devext+".js");break;case"colreorderwithresize":a.ajax.check(c.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorderWithResize"+a.devext+".js");break;case"colvis":a.ajax.check(c.fn.dataTable.ColVis,a.baseURL+"ext/jquery-dataTables-colVis"+a.devext+".js");var w={activate:"click",sAlign:"right"};E.oColVis=c.extend({},w,K.amsDatatableColvisOptions);break;case"editable":a.ajax.check(c.fn.editable,a.baseURL+"ext/jquery-jeditable"+a.devext+".js");a.ajax.check(c.fn.makeEditable,a.baseURL+"ext/jquery-dataTables-editable"+a.devext+".js");break;case"fixedcolumns":a.ajax.check(c.fn.dataTable.FixedColumns,a.baseURL+"ext/jquery-dataTables-fixedColumns"+a.devext+".js");break;case"fixedheader":a.ajax.check(c.fn.dataTable.FixedHeader,a.baseURL+"ext/jquery-dataTables-fixedHeader"+a.devext+".js");break;case"keytable":a.ajax.check(window.KeyTable,a.baseURL+"ext/jquery-dataTables-keyTable"+a.devext+".js");break;case"rowgrouping":a.ajax.check(c.fn.rowGrouping,a.baseURL+"ext/jquery-dataTables-rowGrouping"+a.devext+".js");break;case"rowreordering":a.ajax.check(c.fn.rowReordering,a.baseURL+"ext/jquery-dataTables-rowReordering"+a.devext+".js");break;case"scroller":a.ajax.check(c.fn.dataTable.Scroller,a.baseURL+"ext/jquery-dataTables-scroller"+a.devext+".js");break;default:break}}}E=a.executeFunctionByName(K.amsDatatableInitCallback,D,E)||E;try{var p=D.dataTable(E);a.executeFunctionByName(K.amsDatatableAfterInitCallback,D,p,E);if(G.length>0){for(u=0;u<G.length;u++){switch(G[u]){case"autofill":var l=c.extend({},K.amsDatatableAutofillOptions,E.autofill);l=a.executeFunctionByName(K.amsDatatableAutofillInitCallback,D,l)||l;D.data("ams-autofill",K.amsDatatableAutofillConstructor===undefined?new c.fn.dataTable.AutoFill(D,l):a.executeFunctionByName(K.amsDatatableAutofillConstructor,D,p,l));break;case"columnfilter":var I={sPlaceHolder:"head:after"};var H=c.extend({},I,K.amsDatatableColumnfilterOptions,E.columnfilter);H=a.executeFunctionByName(K.amsDatatableColumnfilterInitCallback,D,H)||H;D.data("ams-columnfilter",K.amsDatatableColumnfilterConstructor===undefined?p.columnFilter(H):a.executeFunctionByName(K.amsDatatableColumnfilterConstructor,D,p,H));break;case"editable":var z=c.extend({},K.amsDatatableEditableOptions,E.editable);z=a.executeFunctionByName(K.amsDatatableEditableInitCallback,D,z)||z;D.data("ams-editable",K.amsDatatableEditableConstructor===undefined?D.makeEditable(z):a.executeFunctionByName(K.amsDatatableEditableConstructor,D,p,z));break;case"fixedcolumns":var y=c.extend({},K.amsDatatableFixedcolumnsOptions,E.fixedcolumns);y=a.executeFunctionByName(K.amsDatatableFixedcolumnsInitCallback,D,y)||y;D.data("ams-fixedcolumns",K.amsDatatableFixedcolumnsConstructor===undefined?new c.fn.dataTable.FixedColumns(D,y):a.executeFunctionByName(K.amsDatatableFixedcolumnsConstructor,D,p,y));break;case"fixedheader":var k=c.extend({},K.amsDatatableFixedheaderOptions,E.fixedheader);k=a.executeFunctionByName(K.amsDatatableFixedheadeInitCallback,D,k)||k;D.data("ams-fixedheader",K.amsDatatableFixedheaderConstructor===undefined?new c.fn.dataTable.FixedHeader(D,k):a.executeFunctionByName(K.amsDatatableFixedheaderConstructor,D,p,k));break;case"keytable":var r={table:D.get(0),datatable:p};var F=c.extend({},r,K.amsDatatableKeytableOptions,E.keytable);F=a.executeFunctionByName(K.amsDatatableKeytableInitCallback,D,F)||F;D.data("ams-keytable",K.amsDatatableKeytableConstructor===undefined?new KeyTable(F):a.executeFunctionByName(K.amsDatatableKeytableConstructor,D,p,F));break;case"rowgrouping":var h=c.extend({},K.amsDatatableRowgroupingOptions,E.rowgrouping);h=a.executeFunctionByName(K.amsDatatableRowgroupingInitCallback,D,h)||h;D.data("ams-rowgrouping",K.amsDatatableRowgroupingConstructor===undefined?D.rowGrouping(h):a.executeFunctionByName(K.amsDatatableRowgroupingConstructor,D,p,h));break;case"rowreordering":var t=c.extend({},K.amsDatatableRowreorderingOptions,E.rowreordering);t=a.executeFunctionByName(K.amsDatatableRowreorderingInitCallback,D,t)||t;D.data("ams-rowreordering",K.amsDatatableRowreorderingConstructor===undefined?D.rowReordering(t):a.executeFunctionByName(K.amsDatatableRowreorderingConstructor,D,p,t));break;default:break}}}var B=(K.amsDatatableFinalizeCallback||"").split(/\s+/);if(B.length>0){for(u=0;u<B.length;u++){a.executeFunctionByName(B[u],D,p,E)}}}catch(C){}})})}},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")},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