# HG changeset patch # User Thierry Florac # Date 1440488781 -7200 # Node ID 4cc2e7381e28ca81a3aa6a868a7a0665c62fa4ee # Parent e7fff7a6f8d3b8aa22f994c37162e69da7c95209 Added click handler in shortcuts DIV diff -r e7fff7a6f8d3 -r 4cc2e7381e28 src/pyams_skin/resources/js/myams.js --- a/src/pyams_skin/resources/js/myams.js Wed Jul 22 17:20:36 2015 +0200 +++ b/src/pyams_skin/resources/js/myams.js Tue Aug 25 09:46:21 2015 +0200 @@ -220,7 +220,7 @@ myams_menu: function(options) { // Extend our default options with those provided var defaults = { - accordion : 'true', + accordion : true, speed : 200, closedSign : '', openedSign : '' @@ -4055,6 +4055,9 @@ } e.preventDefault(); }); + ams.shortcuts.click(function(e) { + ams.skin._hideShortcutButtons(); + }); $(document).mouseup(function(e) { if (!ams.shortcuts.is(e.target) diff -r e7fff7a6f8d3 -r 4cc2e7381e28 src/pyams_skin/resources/js/myams.min.js --- a/src/pyams_skin/resources/js/myams.min.js Wed Jul 22 17:20:36 2015 +0200 +++ b/src/pyams_skin/resources/js/myams.min.js Tue Aug 25 09:46:21 2015 +0200 @@ -1,1 +1,1 @@ -(function(b){String.prototype.startsWith=function(e){var c=this.length;var d=e.length;if(c0};if(b.scrollbarWidth===undefined){b.scrollbarWidth=function(){var d=b('
').appendTo("body");var e=d.children();var c=e.innerWidth()-e.height(99).innerWidth();d.remove();return c}}b.fn.extend({exists:function(){return b(this).length>0},listattr:function(d){var c=[];this.each(function(){c.push(b(this).attr(d))});return c},style:function(d,g,c){var f=this.get(0);if(typeof f=="undefined"){return}var e=this.get(0).style;if(typeof d!="undefined"){if(typeof g!="undefined"){c=typeof c!="undefined"?c:"";e.setProperty(d,g,c);return this}else{return e.getPropertyValue(d)}}else{return e}},removeClassPrefix:function(c){this.each(function(e,f){var d=f.className.split(" ").map(function(g){return g.startsWith(c)?"":g});f.className=b.trim(d.join(" "))});return this},contextMenu:function(d){function c(g,i,f){var h=b(window)[i](),j=b(d.menuSelector)[i](),e=g;if(g+j>h&&j',openedSign:''};var d=b.extend({},e,c);var f=b(this);f.find("LI").each(function(){var g=b(this);if(g.find("UL").size()>0){g.find("A:first").append(""+d.closedSign+"");var h=g.find("A:first");if(h.attr("href")=="#"){h.click(function(){return false})}}});f.find("LI.active").each(function(){var g=b(this).parents("UL");var h=g.parent("LI");g.slideDown(d.speed);h.find("b:first").html(d.openedSign);h.addClass("open")});f.find("LI A").on("click",function(){var j=b(this);var g=j.parent().find("UL");if(d.accordion){var i=j.parent().parents("UL");var k=f.find("UL:visible");k.each(function(l){var m=true;i.each(function(n){if(i[n]==k[l]){m=false;return false}});if(m){if(g!=k[l]){b(k[l]).slideUp(d.speed,function(){j.parent("LI").find("b:first").html(d.closedSign);j.parent("LI").removeClass("open")})}}})}var h=j.parent().find("UL:first");if(!j.attr("href").replace(/^#/,"")&&h.is(":visible")&&!h.hasClass("active")){h.slideUp(d.speed,function(){j.parent("LI").removeClass("open").find("B:first").delay(d.speed).html(d.closedSign)})}else{h.slideDown(d.speed,function(){j.parent("LI").addClass("open").find("B:first").delay(d.speed).html(d.openedSign)})}})}});b.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");var d="";for(var g=0;g127)&&(f<2048)){d+=String.fromCharCode((f>>6)|192);d+=String.fromCharCode((f&63)|128)}else{d+=String.fromCharCode((f>>12)|224);d+=String.fromCharCode(((f>>6)&63)|128);d+=String.fromCharCode((f&63)|128)}}}return d},decode:function(d){var f="";var h=0,j=0,g=0,e=0;while(h191)&&(j<224)){g=d.charCodeAt(h+1);f+=String.fromCharCode(((j&31)<<6)|(g&63));h+=2}else{g=d.charCodeAt(h+1);e=d.charCodeAt(h+2);f+=String.fromCharCode(((j&15)<<12)|((g&63)<<6)|(e&63));h+=3}}}return f}};if(window.MyAMS===undefined){window.MyAMS={devmode:true,devext:"",lang:"en",throttle_delay:350,menu_speed:235,navbar_height:49,ajax_nav:true,enable_widgets:true,enable_mobile:false,enable_fastclick:false,warn_on_form_change:false,ismobile:(/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()))}}var a=MyAMS;MyAMS.baseURL=(function(){var c=b('script[src*="/myams.js"], script[src*="/myams.min.js"]');var d=c.attr("src");a.devmode=d.indexOf(".min.js")<0;a.devext=a.devmode?"":".min";return d.substring(0,d.lastIndexOf("/")+1)})();MyAMS.getQueryVar=function(e,f){if(e.indexOf("?")<0){return false}if(!e.endsWith("&")){e+="&"}var c=new RegExp(".*?[&\\?]"+f+"=(.*?)&.*");var d=e.replace(c,"$1");return d==e?false:d};MyAMS.rgb2hex=function(c){return"#"+b.map(c.match(/\b(\d+)\b/g),function(d){return("0"+parseInt(d).toString(16)).slice(-2)}).join("")};MyAMS.generateId=function(){function c(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return c()+c()+c()+c()};MyAMS.getFunctionByName=function(h,d){if(h===undefined){return undefined}else{if(typeof(h)=="function"){return h}}var g=h.split(".");var f=g.pop();d=(d===undefined||d===null)?window:d;for(var c=0;c").attr({rel:"stylesheet",type:"text/css",href:f,"data-ams-id":g}).appendTo(e)}};MyAMS.event={stop:function(c){if(!c){c=window.event}if(c){if(c.stopPropagation){c.stopPropagation();c.preventDefault()}else{c.cancelBubble=true;c.returnValue=false}}}};MyAMS.browser={getInternetExplorerVersion:function(){var e=-1;if(navigator.appName=="Microsoft Internet Explorer"){var c=navigator.userAgent;var d=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(d.exec(c)!=null){e=parseFloat(RegExp.$1)}}return e},checkVersion:function(){var d="You're not using Windows Internet Explorer.";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=8){d="You're using a recent copy of Windows Internet Explorer."}else{d="You should upgrade your copy of Windows Internet Explorer."}}alert(d)},isIE8orlower:function(){var d="0";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=9){d=0}else{d=1}}return d}};MyAMS.error={ajax:function(f,e){if(e.statusText=="OK"){return}var c=a.ajax.getResponse(e);if(c.content_type=="json"){a.ajax.handleJSON(c.data)}else{var g=f.statusText||f.type;var d=e.responseText;a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"

"+g+"

"+d+"

",icon:"fa fa-warning animated shake",timeout:10000})}if(window.console){console.error(f);console.debug(e)}},show:function(f,c,e){if(!e){return}var d=a.ajax.getResponse(f);if(d.content_type=="json"){a.ajax.handleJSON(d.data)}else{a.skin.messageBox("error",{title:a.i18n.ERRORS_OCCURED,content:"

"+c+"

"+e+"

",icon:"fa fa-warning animated shake",timeout:10000})}if(window.console){console.error(e);console.debug(f)}}};MyAMS.ajax={check:function(d,f,h,c){if(typeof(h)=="object"){c=h;h=undefined}var g={async:typeof(h)=="function"};var e=b.extend({},g,c);if(d===undefined){a.getScript(f,function(){if(typeof(h)=="function"){h(true,c)}},e)}else{if(typeof(h)=="function"){h(false,c)}}},getAddr:function(d){var c=d||b("HTML HEAD BASE").attr("href")||window.location.href;return c.substr(0,c.lastIndexOf("/")+1)},start:function(){b("#ajax-gear").show()},stop:function(){b("#ajax-gear").hide()},progress:function(c){if(!c.lengthComputable){return}if(c.loaded>=c.total){return}console.log(parseInt((c.loaded/c.total*100),10)+"%")},post:function(e,g,d,j){if(e.startsWith(window.location.protocol)){var i=e}else{i=this.getAddr()+e}if(typeof(d)=="function"){j=d;d={}}else{if(!d){d={}}}if(typeof(j)=="undefined"){j=d.callback}if(typeof(j)=="string"){j=a.getFunctionByName(j)}delete d.callback;var c=undefined;var h={url:i,type:"post",cache:false,async:typeof(j)=="function",data:b.param(g),dataType:"json",success:j||function(k){c=k.result},error:a.error.show};var f=b.extend({},h,d);b.ajax(f);return c},getResponse:function(f){var d=f.getResponseHeader("content-type"),h,c;if(d){if(d.startsWith("application/javascript")){h="script";c=f.responseText}else{if(d.startsWith("text/html")){h="html";c=f.responseText}else{if(d.startsWith("text/xml")){h="xml";c=f.responseText}else{c=f.responseJSON;if(c){h="json"}else{try{c=JSON.parse(f.responseText);h="json"}catch(g){c=f.responseText;h="text"}}}}}}else{h="json";c={status:"alert",alert:{title:a.i18n.ERROR_OCCURED,content:a.i18n.NO_SERVER_RESPONSE}}}return{content_type:h,data:c}},handleJSON:function(n,e,j){var h=n.status;var c;switch(h){case"alert":alert(n.alert.title+"\n\n"+n.alert.content);break;case"error":a.form.showErrors(e,n);break;case"info":case"success":if(n.close_form!=false){a.dialog.close(e)}break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":if(n.close_form!=false){a.dialog.close(e)}break;case"modal":a.dialog.open(n.location);break;case"reload":if(n.close_form!=false){a.dialog.close(e)}c=n.location||window.location.hash;if(c.startsWith("#")){c=c.substr(1)}a.skin.loadURL(c,n.target||j||"#content");break;case"redirect":if(n.close_form==true){a.dialog.close(e)}c=n.location||window.location.href;if(n.window){window.open(c,n.window,n.options)}else{if(window.location.href==c){window.location.reload(true)}else{window.location.href=c}}break;default:console.log("Unhandled status: "+h);break}if(n.content){var k=n.content;var d=b(k.target||j||e||"#content");if(k.raw==true){d.text(k.text)}else{d.html(k.html);a.initContent(d)}if(!k.keep_hidden){d.removeClass("hidden")}}if(n.contents){var g=n.contents;for(var i in g){k=g[i];d=b(k.target);if(k.raw==true){d.text(k.text)}else{d.html(k.html);a.initContent(d)}if(!k.keep_hidden){d.removeClass("hidden")}}}if(n.message){var m=n.message;if(typeof(m)=="string"){if((h=="info")||(h=="success")){a.skin.smallBox(h,{title:m,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3000})}else{a.skin.alert(b(e||"#content"),h,m)}}else{a.skin.alert(b(m.target||j||e||"#content"),m.status||"success",m.header,m.body,m.subtitle)}}if(n.smallbox){a.skin.smallBox(n.smallbox_status||h,{title:n.smallbox,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3000})}if(n.messagebox){m=n.messagebox;if(typeof(m)=="string"){a.skin.messageBox("info",{title:a.i18n.ERROR_OCCURED,content:m,timeout:10000})}else{var f=m.status||"info";if(f=="error"&&e&&j){a.executeFunctionByName(e.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",e,j)}a.skin.messageBox(f,{title:m.title||a.i18n.ERROR_OCCURED,content:m.content,icon:m.icon,number:m.number,timeout:m.timeout==null?undefined:(m.timeout||10000)})}}if(n.event){e.trigger(n.event,n.event_options)}if(n.callback){a.executeFunctionByName(n.callback,e,n.options)}if(n.callbacks){for(i in n.callbacks){if(!b.isNumeric(i)){continue}var l=n.callbacks[i];a.executeFunctionByName(l,e,l.options)}}}};MyAMS.jsonrpc={getAddr:function(e){var c=e||b("HTML HEAD BASE").attr("href")||window.location.href;var d=c.replace(/\+\+skin\+\+\w+\//,"");return d.substr(0,d.lastIndexOf("/")+1)},query:function(d,f,c,e){a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){var g;if(typeof(c)=="function"){e=c;c={}}else{if(!c){c={}}}if(typeof(e)=="undefined"){e=c.callback}if(typeof(e)=="string"){e=a.getFunctionByName(e)}delete c.callback;var i={};if(typeof(d)=="string"){i.query=d}else{if(typeof(d)=="object"){b.extend(i,d)}}b.extend(i,c);var h={url:a.jsonrpc.getAddr(c.url),type:"post",cache:false,method:f,params:i,async:typeof(e)=="function",success:e||function(j){g=j.result},error:a.error.show};b.jsonRpc(h);return g})},post:function(f,d,c,e){a.ajax.check(b.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){var g;if(typeof(c)=="function"){e=c;c={}}else{if(!c){c={}}}if(typeof(e)=="undefined"){e=c.callback}if(typeof(e)=="string"){e=a.getFunctionByName(e)}delete c.callback;var g;var i={id:new Date().getTime(),params:d,success:e||function(j){g=j},error:a.error.show};var h=b.extend({},i,c);b.jsonRPC.withOptions({endPoint:a.jsonrpc.getAddr(c.url),namespace:c.namespace,cache:false},function(){b.jsonRPC.request(f,h)});return g})}};MyAMS.xmlrpc={getAddr:function(e){var c=e||b("HTML HEAD BASE").attr("href")||window.location.href;var d=c.replace(/\+\+skin\+\+\w+\//,"");return d.substr(0,d.lastIndexOf("/")+1)},post:function(d,g,e,c,f){a.ajax.check(b.xmlrpc,a.baseURL+"ext/jquery-xmlrpc"+a.devext+".js",function(){var h;if(typeof(c)=="function"){f=c;c={}}else{if(!c){c={}}}if(typeof(f)=="undefined"){f=c.callback}if(typeof(f)=="string"){f=a.getFunctionByName(f)}delete c.callback;var j={url:a.xmlrpc.getAddr(d),methodName:g,params:e,success:f||function(k){h=k},error:a.error.show};var i=b.extend({},j,c);b.xmlrpc(i);return h})}};MyAMS.form={init:function(d){if(a.warn_on_form_change){var c=b('FORM[data-ams-warn-on-change!="false"]',d)}else{c=b('FORM[data-ams-warn-on-change="true"]',d)}c.each(function(){var e=b(this);b('INPUT[type="text"], INPUT[type="checkbox"], INPUT[type="radio"], SELECT, TEXTAREA, [data-ams-changed-event]',e).each(function(){var g=b(this);if(g.data("ams-ignore-change")!==true){var f=g.data("ams-changed-event")||"change";g.on(f,function(){b(this).parents("FORM").attr("data-ams-form-changed",true)})}});e.on("reset",function(){b(this).removeAttr("data-ams-form-changed")})})},checkBeforeUnload:function(){var c=b('FORM[data-ams-form-changed="true"]');if(c.exists()){return a.i18n.FORM_CHANGED_WARNING}},confirmChangedForm:function(d,e){if(typeof(d)=="function"){e=d;d=undefined}var c=b('FORM[data-ams-form-changed="true"]',d);if(c.exists()){a.skin.bigBox({title:a.i18n.WARNING,content:'  '+a.i18n.FORM_CHANGED_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(f){if(f==a.i18n.BTN_OK){e.call(d)}})}else{e.call(d)}},submit:function(e,d,f){e=b(e);if(!e.exists()){return false}if(typeof(d)=="object"){f=d;d=undefined}if(e.data("submitted")){if(!e.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:e.data("ams-form-alert-timeout")||5000})}return false}if(!a.form._checkSubmitValidators(e)){return false}b(".alert, SPAN.state-error",e).remove();b(".state-error",e).removeClassPrefix("state-");var c=b(e.data("ams-submit-button"));if(c&&!c.data("ams-form-hide-loading")){c.button("loading")}a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+a.devext+".js",function(){function i(k,m){var j;var C=k.data();var t=C.amsFormOptions;if(f){var o=f.formDataInitCallback}if(o){delete f.formDataInitCallback}else{o=C.amsFormDataInitCallback}if(o){var u={};if(typeof(o)=="function"){var l=o.call(k,u)}else{l=a.executeFunctionByName(o,k,u)}if(u.veto){j=k.data("ams-submit-button");if(j){j.button("reset")}a.form.finalizeSubmitFooter.call(k);return false}}else{l=C.amsFormData||{}}j=b(k.data("ams-submit-button"));var v,y;if(j){v=j.data("ams-form-handler");y=j.data("ams-form-submit-target")}var r=d||v||C.amsFormHandler||"";if(r.startsWith(window.location.protocol)){var n=r}else{var x=k.attr("action").replace(/#/,"");if(x.startsWith(window.location.protocol)){n=x}else{n=a.ajax.getAddr()+x}n+=r}var B=null;if(C.amsFormInitSubmitTarget){B=b(y||C.amsFormSubmitTarget||"#content");a.executeFunctionByName(C.amsFormInitSubmit||"MyAMS.form.initSubmit",k,B)}else{if(!C.amsFormHideSubmitFooter){a.executeFunctionByName(C.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",k)}}var p=typeof(m.uuid)!="undefined";if(p){if(n.indexOf("X-Progress-ID")<0){n+="?X-Progress-ID="+m.uuid}delete m.uuid}var s={url:n,type:"post",cache:false,data:l,dataType:C.amsFormDatatype,beforeSerialize:function(){if(typeof(tinyMCE)!="undefined"){tinyMCE.triggerSave()}},beforeSubmit:function(E,D){D.data("submitted",true)},error:function(H,D,E,G){if(B){a.executeFunctionByName(C.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",G,B)}if(G.is(":visible")){var F=G.data("ams-submit-button");if(F){F.button("reset")}a.form.finalizeSubmitFooter.call(G)}G.data("submitted",false);G.removeData("ams-submit-button")},iframe:p};var w=C.amsFormDownloadTarget;if(w){var q=b('iframe[name="'+w+'"]');if(!q.exists()){q=b("").hide().attr("name",w).appendTo(k)}s=b.extend({},s,{iframe:true,iframeTarget:q,success:function(D,E,I,H){var G=b(H).parents(".modal-dialog");if(G.exists()){a.dialog.close(H)}else{var J;var F=H.data("ams-submit-button");if(F){J=F.data("ams-form-submit-callback")}if(!J){J=a.getFunctionByName(C.amsFormSubmitCallback)||a.form._submitCallback}J.call(H,D,E,I,H);if(H.is(":visible")&&F){F.button("reset")}H.data("submitted",false);H.removeData("ams-submit-button");H.removeAttr("data-ams-form-changed")}}})}else{s=b.extend({},s,{error:function(H,D,E,G){if(B){a.executeFunctionByName(C.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",G,B)}if(G.is(":visible")){var F=G.data("ams-submit-button");if(F){F.button("reset")}a.form.finalizeSubmitFooter.call(G)}G.data("submitted",false);G.removeData("ams-submit-button")},success:function(D,E,H,G){var I;var F=G.data("ams-submit-button");if(F){I=F.data("ams-form-submit-callback")}if(!I){I=a.getFunctionByName(C.amsFormSubmitCallback)||a.form._submitCallback}I.call(G,D,E,H,G);if(G.is(":visible")&&F){F.button("reset")}G.data("submitted",false);G.removeData("ams-submit-button");G.removeAttr("data-ams-form-changed")},iframe:p})}var A=b.extend({},s,m,t,f);b(k).ajaxSubmit(A);if(w){var z=b(k).parents(".modal-dialog");if(z.exists()){a.dialog.close(k)}else{a.form.finalizeSubmitFooter.call(k);if(j){j.button("reset")}k.data("submitted",false);k.removeData("ams-submit-button");k.removeAttr("data-ams-form-changed")}}}var h=b('INPUT[type="file"]',e).length>0;if(h){a.ajax.check(b.progressBar,a.baseURL+"ext/jquery-progressbar"+a.devext+".js");var g=b.extend({},{uuid:b.progressBar.submit(e)});i(e,g)}else{i(e,{})}});return false},initSubmit:function(e,d){var c=b(this);var f='';if(!d){d=c.data("ams-form-submit-message")}if(d){f+=""+d+""}b(e).html('
'+f+"
");b(e).parents(".hidden").removeClass("hidden")},finalizeSubmitOnError:function(c){b("i",c).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(d){var c=b(this);var f='';if(!d){d=b(this).data("ams-form-submit-message")}if(d){f+=''+d+""}var e=b("footer",c);b("button",e).hide();e.append('
'+f+"
")},finalizeSubmitFooter:function(){var c=b(this);var d=b("footer",c);if(d){b(".row",d).remove();b("button",d).show()}},_submitCallback:function(m,e,d,c){if(c.is(":visible")){a.form.finalizeSubmitFooter.call(c);var g=c.data("ams-submit-button");if(g){g.button("reset")}}var f=c.data();if(f.amsFormDatatype){var j=f.amsFormDatatype}else{var h=a.ajax.getResponse(d);j=h.content_type;m=h.data}if(g){var i=b(g.amsFormSubmitTarget||f.amsFormSubmitTarget||"#content")}else{i=b(f.amsFormSubmitTarget||"#content")}switch(j){case"json":a.ajax.handleJSON(m,c,i);break;case"script":break;case"xml":break;case"html":case"text":default:if(g&&(g.data("ams-keep-modal")!==true)){a.dialog.close(c)}if(!i.exists()){i=b("body")}i.parents(".hidden").removeClass("hidden");b(".alert",i.parents(".alerts-container")).remove();i.css({opacity:"0.0"}).html(m).delay(50).animate({opacity:"1.0"},300);a.initContent(i)}var k=d.getResponseHeader("X-AMS-Callback");if(k){var l=d.getResponseHeader("X-AMS-Callback-Options");a.executeFunctionByName(k,c,l===undefined?{}:JSON.parse(l),d)}},_getSubmitValidators:function(d){var c=new Array();var e=d.data("ams-form-validator");if(e){c.push([d,e])}b("[data-ams-form-validator]",d).each(function(){var f=b(this);c.push([f,f.data("ams-form-validator")])});return c},_checkSubmitValidators:function(e){var g=a.form._getSubmitValidators(e);if(!g.length){return true}var f=new Array();var l=true;for(var i in g){if(!b.isNumeric(i)){continue}var d=g[i];var c=d[0];var j=d[1];var k=a.executeFunctionByName(j,e,c);if(k===false){l=false}else{if(typeof(k)=="string"){f.push(k)}else{if(l.length&&(l.length>0)){f=f.concat(l)}}}}if(f.length>0){var h=f.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(e,"danger",h,f);return false}else{return l}},showErrors:function(c,j){if(typeof(j)=="string"){a.skin.alert(c,"error",a.i18n.ERROR_OCCURED,j)}else{if(j instanceof Array){var f=j.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(c,"error",f,j)}else{b(".state-error",c).removeClass("state-error");f=j.error_header||(j.widgets&&(j.widgets.length>1)?a.i18n.ERRORS_OCCURED:a.i18n.ERROR_OCCURED);var k=new Array();var i;for(i in j.messages){if(!b.isNumeric(i)){continue}if(j.messages[i].header){k.push(""+j.messages[i].header+"
"+j.messages[i].message)}else{k.push(j.messages[i].message||j.messages[i])}}for(i in j.widgets){if(!b.isNumeric(i)){continue}var d=j.widgets[i];var g=b('[name="'+d.name+'"]',c);g.parents("label:first").removeClassPrefix("state-").addClass("state-error").after(''+d.message+"");if(d.label){k.push(d.label+" : "+d.message)}var h=g.parents(".tab-pane").index()+1;if(h>0){var e=b(".nav-tabs",b(g).parents(".tabforms"));b("li:nth-child("+h+")",e).removeClassPrefix("state-").addClass("state-error");b("li.state-error:first a",c).click()}}a.skin.alert(c,j.error_level||"error",f,k,j.error_message)}}}};MyAMS.dialog={_hide_callbacks:[],registerHideCallback:function(d){var c=a.dialog._hide_callbacks;if(c.indexOf(d)<0){c.push(d)}},open:function(d,c){a.ajax.check(b.fn.modalmanager,a.baseURL+"ext/bootstrap-modalmanager"+a.devext+".js",function(){a.ajax.check(b.fn.modal.defaults,a.baseURL+"ext/bootstrap-modal"+a.devext+".js",function(h){if(h){b(document).off("click.modal");b.fn.modal.defaults.spinner=b.fn.modalmanager.defaults.spinner='
'}if(typeof(d)=="string"){var g={};var f=d}else{g=d.data();f=d.attr("href")||g.amsUrl;var e=a.getFunctionByName(f);if(typeof(e)=="function"){f=e.call(d)}}if(!f){return}b("body").modalmanager("loading");if(f.indexOf("#")==0){b(f).modal("show")}else{b.ajax({url:f,type:"get",cache:g.amsAllowCache===undefined?false:g.amsAllowCache,data:c,success:function(l,k,j){b("body").modalmanager("removeLoading");var m=a.ajax.getResponse(j);var r=m.content_type;var s=m.data;switch(r){case"json":a.ajax.handleJSON(s,b(b(d).data("ams-json-target")||"#content"));break;case"script":break;case"xml":break;case"html":case"text":default:var n=b(s);var p=b(".modal-dialog",n.wrap("
").parent());var o=p.data();var q={overflow:o.amsModalOverflow||".modal-viewport",maxHeight:o.amsModalMaxHeight===undefined?function(){return b(window).height()-b(".modal-header",n).outerHeight(true)-b("footer",n).outerHeight(true)-85}:a.getFunctionByName(o.amsModalMaxHeight)};var i=b.extend({},q,o.amsModalOptions);i=a.executeFunctionByName(o.amsModalInitCallback,p,i)||i;b("
").addClass("modal fade").append(n).modal(i).on("shown",a.dialog.shown).on("hidden",a.dialog.hidden);a.initContent(n)}}})}})})},shown:function(i){function h(k){var l=b(".scrollmarker.top",c);var j=c.scrollTop();if(j>0){l.show()}else{l.hide()}var e=b(".scrollmarker.bottom",c);if(f+j>=c.get(0).scrollHeight){e.hide()}else{e.show()}}var g=i.target;var c=b(".modal-viewport",g);if(c.length==0){return}var f=parseInt(c.css("max-height"));var d=b.scrollbarWidth();if(c.height()==f){b("
").addClass("scrollmarker").addClass("top").css("top",0).css("width",c.width()-d).hide().appendTo(c);b("
").addClass("scrollmarker").addClass("bottom").css("top",f-20).css("width",c.width()-d).appendTo(c);c.scroll(h);c.off("resize").on("resize",h)}else{b(".scrollmarker",c).remove()}},close:function(d){var e=d.parents(".modal").data("modal");if(e){var c=b("body").data("modalmanager");if(c&&(c.getOpenModals().indexOf(e)>=0)){e.hide()}}},hidden:function(g){var f=g.target;a.skin.cleanContainer(f);var d=a.dialog._hide_callbacks;for(var c in d){d[c].call(f)}}};MyAMS.helpers={select2ClearSelection:function(){var d=b(this);var c=d.parents("label");var e=d.data("ams-select2-target");b('[name="'+e+'"]',c).data("select2").val("")},select2FormatSelection:function(d,c){if(d instanceof Array){b(d).each(function(){if(typeof(this)=="object"){c.append(this.text)}else{c.append(this)}})}else{if(typeof(d)=="object"){c.append(d.text)}else{c.append(d)}}},select2QueryUrlResultsCallback:function(e,d,c){switch(e.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"

"+e.error_message+"

",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":b(this).data("select2").dropdown.hide();a.dialog.open(result.location);break;default:return{results:e.results||e,more:e.has_more||false,context:e.context}}},select2QueryMethodSuccessCallback:function(g,d,f){var c=g.result;if(typeof(c)=="string"){try{c=JSON.parse(c)}catch(h){}}switch(c.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"

"+c.error_message+"

",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":b(this).data("select2").dropdown.hide();a.dialog.open(c.location);break;default:f.callback({results:c.results||c,more:c.has_more||false,context:c.context})}},contextMenuHandler:function(f,g){var c=g.data();if(c.toggle=="modal"){a.dialog.open(g)}else{var d=g.attr("href")||c.amsUrl;if(!d||d.startsWith("javascript:")||g.attr("target")){return}a.event.stop();var e=a.getFunctionByName(d);if(typeof(e)=="function"){d=e.call(g,f)}if(typeof(d)=="function"){d.call(g,f)}else{d=d.replace(/\%23/,"#");var f=g.data("ams-target");if(f){a.form.confirmChangedForm(f,function(){a.skin.loadURL(d,f,g.data("ams-link-options"),g.data("ams-link-callback"))})}else{a.form.confirmChangedForm(function(){if(d.startsWith("#")){if(d!=location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=d},150)}else{window.location.hash=d}}}else{window.location=d}})}}}},datetimepickerDialogHiddenCallback:function(){b(".datepicker, .timepicker, .datetimepicker",this).datetimepicker("destroy")}};MyAMS.plugins={init:function(e){a.plugins.initData(e);var f=new Array();b("[data-ams-plugins-disabled]",e).each(function(){var h=b(this).data("ams-plugins-disabled").split(/\s+/);for(var i in h){f.push(h[i])}});var d;b("[data-ams-plugins]",e).each(function(){var l=b(this);var h={};if(typeof(l.data("ams-plugins"))==="string"){var m=l.data("ams-plugins").split(/\s+/);for(var j in m){d=m[j];var i={src:l.data("ams-plugin-"+d+"-src"),css:l.data("ams-plugin-"+d+"-css"),callback:l.data("ams-plugin-"+d+"-callback"),register:l.data("ams-plugin-"+d+"-register"),async:l.data("ams-plugin-"+d+"-async")};h[d]=i}}else{h=l.data("ams-plugins")}for(d in h){if(a.plugins.enabled[d]===undefined){var k=h[d];a.getScript(k.src,function(){var p=k.callback;if(p){var o=a.getFunctionByName(p);if(k.register!==false){a.plugins.enabled[d]=o}}else{if(k.register!==false){a.plugins.enabled[d]=null}}var n=k.css;if(n){a.getCSS(n,d+"_css")}},{async:k.async===undefined?true:k.async})}}});for(var c in a.plugins.enabled){if(f.indexOf(c)>=0){continue}var g=a.plugins.enabled[c];if(typeof(g)=="function"){g(e)}}},initData:function(c){b("[data-ams-data]",c).each(function(){var e=b(this);var f=e.data("ams-data");for(var d in f){e.attr("data-"+d,f[d])}})},register:function(d,c,f){if(typeof(c)=="function"){f=c;c=null}c=c||d.name;if(a.plugins.enabled.indexOf(c)>=0){if(window.console){console.warn("Plugin "+c+" is already registered!")}return}if(typeof(d)=="object"){var e=d.src;if(e){a.ajax.check(d.callback,e,function(g){if(g){a.plugins.enabled[c]=a.getFunctionByName(d.callback);if(d.css){a.getCSS(d.css,c+"_css")}if(f){a.executeFunctionByName(f)}}})}else{a.plugins.enabled[c]=a.getFunctionByName(d.callback);if(d.css){a.getCSS(d.css,c+"_css")}if(f){a.executeFunctionByName(f)}}}else{if(typeof(d)=="function"){a.plugins.enabled[c]=d;if(f){a.executeFunctionByName(f)}}}},enabled:{hint:function(c){var d=b(".hint:not(:parents(.nohints))",c);if(d.length>0){a.ajax.check(b.fn.tipsy,a.baseURL+"ext/jquery-tipsy"+a.devext+".js",function(){a.getCSS(a.baseURL+"../css/ext/jquery-tipsy"+a.devext+".css","jquery-tipsy");d.each(function(){var i=b(this);var h=i.data();var f={html:h.amsHintHtml,title:a.getFunctionByName(h.amsHintTitleGetter)||function(){var j=b(this);return j.attr("original-title")||j.attr(h.amsHintTitleAttr||"title")||(h.amsHintHtml?j.html():j.text())},opacity:h.amsHintOpacity||0.95,gravity:h.amsHintGravity||"sw",offset:h.amsHintOffset||0};var e=b.extend({},f,h.amsHintOptions);e=a.executeFunctionByName(h.amsHintInitCallback,i,e)||e;var g=i.tipsy(e);a.executeFunctionByName(h.amsHintAfterInitCallback,i,g,e)})})}},contextMenu:function(c){var d=b(".context-menu",c);if(d.length>0){d.each(function(){var i=b(this);var h=i.data();var f={menuSelector:h.amsContextmenuSelector,menuSelected:a.helpers.contextMenuHandler};var e=b.extend({},f,h.amsContextmenuOptions);e=a.executeFunctionByName(h.amsContextmenuInitCallback,i,e)||e;var g=i.contextMenu(e);a.executeFunctionByName(h.amsContextmenuAfterInitCallback,i,g,e)})}},switcher:function(c){b("LEGEND.switcher",c).each(function(){var e=b(this);var d=e.parent("fieldset");var f=e.data();if(!f.amsSwitcher){b('').prependTo(b(this)).addClass(f.amsSwitcherState=="open"?(f.amsSwitcherMinusClass||"fa-minus"):(f.amsSwitcherPlusClass||"fa-plus"));e.on("click",function(h){h.preventDefault();var g={};e.trigger("ams.switcher.before-switch",[e,g]);if(g.veto){return}if(d.hasClass("switched")){d.removeClass("switched");b(".fa",e).removeClass(f.amsSwitcherPlusClass||"fa-plus").addClass(f.amsSwitcherMinusClass||"fa-minus");e.trigger("ams.switcher.opened",[e]);var i=e.attr("id");if(i){b('legend.switcher[data-ams-switcher-sync="'+i+'"]',d).each(function(){var j=b(this);if(j.parents("fieldset").hasClass("switched")){j.click()}})}}else{d.addClass("switched");b(".fa",e).removeClass(f.amsSwitcherMinusClass||"fa-minus").addClass(f.amsSwitcherPlusClass||"fa-plus");e.trigger("ams.switcher.closed",[e])}});if(f.amsSwitcherState!="open"){d.addClass("switched")}e.data("ams-switcher","on")}})},checker:function(c){b("LEGEND.checker",c).each(function(){var o=b(this);var p=o.parent("fieldset");var f=o.data();if(!f.amsChecker){var d=b('');var i=f.amsCheckerFieldname||("checker_"+a.generateId());var m=i.replace(/\./,"_");var g=f.amsCheckerHiddenPrefix;var h=null;var l=f.amsCheckerHiddenValueOn||"true";var j=f.amsCheckerHiddenValueOff||"false";var e=f.amsCheckerMarker||false;if(g){h=b('').attr("name",g+i).val(f.amsCheckerState=="on"?l:j).prependTo(o)}else{if(e){b('').attr("name",e).attr("value",1).prependTo(o)}}var n=b('').attr("name",i).attr("id",m).data("ams-checker-hidden-input",h).data("ams-checker-init",true).val(f.amsCheckerValue||true).attr("checked",f.amsCheckerState=="on"?"checked":null);if(f.amsCheckerReadonly){n.attr("disabled","disabled")}else{n.on("change",function(s){s.preventDefault();var q={};var t=b(this).is(":checked");o.trigger("ams.checker.before-switch",[o,q]);if(q.veto){b(this).prop("checked",!t);return}a.executeFunctionByName(f.amsCheckerChangeHandler,o,t);if(!f.amsCheckerCancelDefault){var r=n.data("ams-checker-hidden-input");if(t){if(f.amsCheckerMode=="disable"){p.removeAttr("disabled")}else{p.removeClass("switched")}if(r){r.val(l)}b("[data-required]",p).attr("required","required");o.trigger("ams.checker.opened",[o])}else{if(f.amsCheckerMode=="disable"){p.prop("disabled","disabled")}else{p.addClass("switched")}if(r){r.val(j)}b("[data-required]",p).removeAttr("required");o.trigger("ams.checker.closed",[o])}}})}n.appendTo(d);b(">label",o).attr("for",n.attr("id"));d.append("").prependTo(o);var k=b("[required]",p);k.attr("data-required",true);if(f.amsCheckerState=="on"){n.attr("checked",true)}else{if(f.amsCheckerMode=="disable"){p.attr("disabled","disabled")}else{p.addClass("switched")}k.removeAttr("required")}o.data("ams-checker","on")}})},slider:function(c){var d=b(".slider",c);if(d.length>0){a.ajax.check(b.fn.slider,a.baseURL+"ext/bootstrap-slider.min.js",function(){d.each(function(){var h=b(this);var i=h.data();var f={};var e=b.extend({},f,h.data.amsSliderOptions);e=a.executeFunctionByName(i.amsSliderInitCallback,h,e)||e;var g=h.slider(e);a.executeFunctionByName(i.amsSliderAfterInitCallback,h,g,e)})})}},draggable:function(d){var c=b(".draggable",d);if(c.length>0){c.each(function(){var e=b(this);var i=e.data();var g={containment:i.amsDraggableContainment,helper:a.getFunctionByName(i.amsDraggableHelper)||i.amsDraggableHelper,start:a.getFunctionByName(i.amsDraggableStart),stop:a.getFunctionByName(i.amsDraggableStop)};var f=b.extend({},g,i.amsDraggableOptions);f=a.executeFunctionByName(i.amsDraggableInitCallback,e,f)||f;var h=e.draggable(f);e.disableSelection();a.executeFunctionByName(i.amsDraggableAfterInitCallback,e,h,f)})}},sortable:function(c){var d=b(".sortable",c);if(d.length>0){d.each(function(){var i=b(this);var h=i.data();var f={items:h.amsSortableItems,handle:h.amsSortableHandle,connectWith:h.amsSortableConnectwith,start:a.getFunctionByName(h.amsSortableStart),over:a.getFunctionByName(h.amsSortableOver),containment:h.amsSortableContainment,placeholder:h.amsSortablePlaceholder,stop:a.getFunctionByName(h.amsSortableStop)};var e=b.extend({},f,h.amsSortableOptions);e=a.executeFunctionByName(h.amsSortableInitCallback,i,e)||e;var g=i.sortable(e);i.disableSelection();a.executeFunctionByName(h.amsSortableAfterInitCallback,i,g,e)})}},resizable:function(d){var c=b(".resizable",d);if(c.length>0){c.each(function(){var e=b(this);var i=e.data();var g={autoHide:i.amsResizableAutohide===false?true:i.amsResizableAutohide,containment:i.amsResizableContainment,grid:i.amsResizableGrid,handles:i.amsResizableHandles,start:a.getFunctionByName(i.amsResizableStart),stop:a.getFunctionByName(i.amsResizableStop)};var f=b.extend({},g,i.amsResizableOptions);f=a.executeFunctionByName(i.amsResizableInitCallback,e,f)||f;var h=e.resizable(f);e.disableSelection();a.executeFunctionByName(i.amsResizableAfterInitCallback,e,h,f)})}},typeahead:function(d){var c=b(".typeahead",d);if(c.length>0){a.ajax.check(b.fn.typeahead,a.baseURL+"ext/jquery-typeahead"+a.devext+".js",function(){c.each(function(){var e=b(this);var i=e.data();var g={};var f=b.extend({},g,i.amsTypeaheadOptions);f=a.executeFunctionByName(i.amsTypeaheadInitCallback,e,f)||f;var h=e.typeahead(f);a.executeFunctionByName(i.amsTypeaheadAfterInitCallback,e,h,f)})})}},select2:function(d){var c=b(".select2",d);if(c.length>0){a.ajax.check(b.fn.select2,a.baseURL+"ext/jquery-select2-3.5.2"+a.devext+".js",function(){c.each(function(){var e=b(this);var j=e.data();var h={placeholder:j.amsSelect2Placeholder,multiple:j.amsSelect2Multiple,minimumInputLength:j.amsSelect2MinimumInputLength||0,maximumSelectionSize:j.amsSelect2MaximumSelectionSize,openOnEnter:j.amsSelect2EnterOpen===undefined?true:j.amsSelect2EnterOpen,allowClear:j.amsSelect2AllowClear===undefined?true:j.amsSelect2AllowClear,width:j.amsSelect2Width||"100%",initSelection:a.getFunctionByName(j.amsSelect2InitSelection),formatSelection:j.amsSelect2FormatSelection===undefined?a.helpers.select2FormatSelection:a.getFunctionByName(j.amsSelect2FormatSelection),formatResult:a.getFunctionByName(j.amsSelect2FormatResult),formatMatches:j.amsSelect2FormatMatches===undefined?function(k){if(k==1){return a.i18n.SELECT2_MATCH}else{return k+a.i18n.SELECT2_MATCHES}}:a.getFunctionByName(j.amsSelect2FormatMatches),formatNoMatches:j.amsSelect2FormatResult===undefined?function(k){return a.i18n.SELECT2_NOMATCHES}:a.getFunctionByName(j.amsSelect2FormatResult),formatInputTooShort:j.amsSelect2FormatInputTooShort===undefined?function(k,l){var m=l-k.length;return a.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooShort),formatInputTooLong:j.amsSelect2FormatInputTooLong===undefined?function(l,k){var m=l.length-k;return a.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooLong),formatSelectionTooBig:j.amsSelect2FormatSelectionTooBig===undefined?function(k){return a.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,k).replace(/\{1\}/,k==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatSelectionTooBig),formatLoadMore:j.amsSelect2FormatLoadMore===undefined?function(k){return a.i18n.SELECT2_LOADMORE}:a.getFunctionByName(j.amsSelect2FormatLoadMore),formatSearching:j.amsSelect2FormatSearching===undefined?function(){return a.i18n.SELECT2_SEARCHING}:a.getFunctionByName(j.amsSelect2FormatSearching),separator:j.amsSelect2Separator||",",tokenSeparators:j.amsSelect2TokensSeparators||[","],tokenizer:a.getFunctionByName(j.amsSelect2Tokenizer)};switch(e.context.type){case"text":case"hidden":if(!h.initSelection){var f=e.data("ams-select2-values");if(f){h.initSelection=function(k,m){var l=[];b(k.val().split(h.separator)).each(function(){l.push({id:this,text:f[this]||this})});m(l)}}}break;default:break}if(e.attr("readonly")){if(e.attr("type")=="hidden"){h.query=function(){return[]}}}else{if(j.amsSelect2Query){h.query=a.getFunctionByName(j.amsSelect2Query);h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryUrl){h.ajax={url:j.amsSelect2QueryUrl,quietMillis:j.amsSelect2QuietMillis||200,type:j.amsSelect2QueryType||"POST",dataType:j.amsSelect2QueryDatatype||"json",data:function(m,n,l){var k={};k[j.amsSelect2QueryParamName||"query"]=m;k[j.amsSelect2PageParamName||"page"]=n;k[j.amsSelect2ContextParamName||"context"]=l;return b.extend({},k,j.amsSelect2QueryOptions)},results:a.helpers.select2QueryUrlResultsCallback};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryMethod){h.query=function(k){var l={id:new Date().getTime(),params:j.amsSelect2QueryParams||{},success:function(m){return a.helpers.select2QueryMethodSuccessCallback.call(e,m,"success",k)},error:a.error.show};l.params[j.amsSelect2QueryParamName||"query"]=k.term;l.params[j.amsSelect2PageParamName||"page"]=k.page;l.params[j.amsSelect2ContextParamName||"context"]=k.context;l=b.extend({},l,j.amsSelect2QueryOptions);l=a.executeFunctionByName(j.amsSelect2QueryInitCallback,e,l)||l;a.ajax.check(b.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){b.jsonRPC.withOptions({endPoint:j.amsSelect2MethodTarget||a.jsonrpc.getAddr(),namespace:j.amsSelect2MethodNamespace,cache:false},function(){b.jsonRPC.request(j.amsSelect2QueryMethod,l)})})};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2Tags){h.tags=j.amsSelect2Tags}else{if(j.amsSelect2Data){h.data=j.amsSelect2Data}}}}}}if(j.amsSelect2EnableFreeTags){h.createSearchChoice=function(k){return{id:k,text:(j.amsSelect2FreeTagsPrefix||a.i18n.SELECT2_FREETAG_PREFIX)+k}}}var g=b.extend({},h,j.amsSelect2Options);g=a.executeFunctionByName(j.amsSelect2InitCallback,e,g)||g;var i=e.select2(g);a.executeFunctionByName(j.amsSelect2AfterInitCallback,e,i,g);if(e.hasClass("ordered")){a.ajax.check(b.fn.select2Sortable,a.baseURL+"ext/jquery-select2-sortable"+a.devext+".js",function(){e.select2Sortable({bindOrder:"sortableStop"})})}e.on("change",function(){var k=b(e.get(0).form).data("validator");if(k!==undefined){b(e).valid()}})})})}},maskedit:function(d){var c=b("[data-mask]",d);if(c.length>0){a.ajax.check(b.fn.mask,a.baseURL+"ext/jquery-maskedinput-1.3.1.min.js",function(){c.each(function(){var e=b(this);var i=e.data();var g={placeholder:i.amsMaskeditPlaceholder||"X"};var f=b.extend({},g,i.amsMaskeditOptions);f=a.executeFunctionByName(i.amsMaskeditInitCallback,e,f)||f;var h=e.mask(e.attr("data-mask"),f);a.executeFunctionByName(i.amsMaskeditAfterInitCallback,e,h,f)})})}},datepicker:function(c){var d=b(".datepicker",c);if(d.length>0){a.ajax.check(b.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}d.each(function(){var f=b(this);var j=f.data();var h={lang:j.amsDatetimepickerLang||a.lang,format:j.amsDatetimepickerFormat||"d/m/y",datepicker:true,dayOfWeekStart:1,timepicker:false};var g=b.extend({},h,j.amsDatetimepickerOptions);g=a.executeFunctionByName(j.amsDatetimepickerInitCallback,f,g)||g;var i=f.datetimepicker(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},datetimepicker:function(d){var c=b(".datetimepicker",d);if(c.length>0){a.ajax.check(b.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}c.each(function(){var f=b(this);var j=f.data();var h={lang:j.amsDatetimepickerLang||a.lang,format:j.amsDatetimepickerFormat||"d/m/y H:i",datepicker:true,dayOfWeekStart:1,timepicker:true};var g=b.extend({},h,j.amsDatetimepickerOptions);g=a.executeFunctionByName(j.amsDatetimepickerInitCallback,f,g)||g;var i=f.datetimepicker(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},timepicker:function(d){var c=b(".timepicker",d);if(c.length>0){a.ajax.check(b.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}c.each(function(){var f=b(this);var j=f.data();var h={lang:j.amsDatetimepickerLang||a.lang,format:j.amsDatetimepickerFormat||"H:i",datepicker:false,timepicker:true};var g=b.extend({},h,j.amsDatetimepickerOptions);g=a.executeFunctionByName(j.amsDatetimepickerInitCallback,f,g)||g;var i=f.datetimepicker(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},colorpicker:function(c){var d=b(".colorpicker",c);if(d.length>0){a.ajax.check(b.fn.minicolors,a.baseURL+"ext/jquery-minicolors"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-minicolors"+a.devext+".css","jquery-minicolors")}d.each(function(){var f=b(this);var j=f.data();var h={position:j.amsColorpickerPosition||f.closest("label.input").data("ams-colorpicker-position")||"bottom left"};var g=b.extend({},h,j.amsColorpickerOptions);g=a.executeFunctionByName(j.amsColorpickerInitCallback,f,g)||g;var i=f.minicolors(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},validate:function(d){var c=b("FORM:not([novalidate])",d);if(c.length>0){a.ajax.check(b.fn.validate,a.baseURL+"ext/jquery-validate-1.11.1"+a.devext+".js",function(g){if(g){b.validator.setDefaults({highlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(i,j){var h=j.parents("label:first");if(h.length){i.insertAfter(h)}else{i.insertAfter(j)}}});if(a.plugins.i18n){for(var e in a.plugins.i18n.validate){var f=a.plugins.i18n.validate[e];if((typeof(f)=="string")&&(f.indexOf("{0}")>-1)){a.plugins.i18n.validate[e]=b.validator.format(f)}}b.extend(b.validator.messages,a.plugins.i18n.validate)}}c.each(function(){var k=b(this);var l=k.data();var i={ignore:null,submitHandler:k.attr("data-async")!==undefined?l.amsFormSubmitHandler===undefined?function(){b(".state-error",k).removeClass("state-error");a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+a.devext+".js");return a.form.submit(k)}:a.getFunctionByName(l.amsFormSubmitHandler):undefined,invalidHandler:k.attr("data-async")!==undefined?l.amsFormInvalidHandler===undefined?function(q,p){b(".state-error",k).removeClass("state-error");for(var n in p.errorList){var m=p.errorList[n];var o=b(m.element).parents(".tab-pane").index()+1;if(o>0){var r=b(".nav-tabs",b(m.element).parents(".tabforms"));b("li:nth-child("+o+")",r).removeClassPrefix("state-").addClass("state-error");b("li.state-error:first a",r).click()}}}:a.getFunctionByName(l.amsFormInvalidHandler):undefined};var h=b.extend({},i,l.amsValidateOptions);h=a.executeFunctionByName(l.amsValidateInitCallback,k,h)||h;var j=k.validate(h);a.executeFunctionByName(l.amsValidateAfterInitCallback,k,j,h)})})}},datatable:function(d){var c=b(".datatable",d);if(c.length>0){a.ajax.check(b.fn.dataTable,a.baseURL+"ext/jquery-dataTables-1.9.4"+a.devext+".js",function(e){if(e){b.fn.dataTableExt.oSort["numeric-comma-asc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((fi)?1:0))};b.fn.dataTableExt.oSort["numeric-comma-desc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((fi)?-1:0))}}b(c).each(function(){a.ajax.check(b.fn.dataTableExt.oPagination.bootstrap_full,a.baseURL+"myams-dataTables"+a.devext+".js");var u=b(this);var x=u.data();var w=(x.amsDatatableExtensions||"").split(/\s+/);var h=x.amsDatatableSdom||"W"+((w.indexOf("colreorder")>=0||w.indexOf("colreorderwithresize")>=0)?"R":"")+"<'dt-top-row'"+(w.indexOf("colvis")>=0?"C":"")+((x.amsDatatablePagination===false||x.amsDatatablePaginationSize===false)?"":"L")+(x.amsDatatableGlobalFilter===false?"":"F")+">r<'dt-wrapper't"+(w.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(x.amsDatatableInformation===false?"":"i")+"><'col-sm-6 text-right'p>>";var r={bJQueryUI:false,bFilter:x.amsDatatableGlobalFilter!==false,bPaginate:x.amsDatatablePagination!==false,bInfo:x.amsDatatableInfo!==false,bSort:x.amsDatatableSort!==false,aaSorting:x.amsDatatableSorting,bDeferRender:true,bAutoWidth:false,iDisplayLength:x.amsDatatableDisplayLength||25,sPaginationType:x.amsDatatablePaginationType||"bootstrap_full",sDom:h,oLanguage:a.plugins.i18n.datatables,fnInitComplete:function(A,z){b(".ColVis_Button").addClass("btn btn-default btn-sm").html((a.plugins.i18n.datatables.sColumns||"Columns")+' ')}};var v=b.extend({},r,x.amsDatatableOptions);var j;if(w.length>0){for(j in w){switch(w[j]){case"autofill":a.ajax.check(b.fn.dataTable.AutoFill,a.baseURL+"ext/jquery-dataTables-autoFill"+a.devext+".js");break;case"columnfilter":a.ajax.check(b.fn.columnFilter,a.baseURL+"ext/jquery-dataTables-columnFilter"+a.devext+".js");break;case"colreorder":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorder"+a.devext+".js");break;case"colreorderwithresize":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorderWithResize"+a.devext+".js");break;case"colvis":a.ajax.check(b.fn.dataTable.ColVis,a.baseURL+"ext/jquery-dataTables-colVis"+a.devext+".js");var n={activate:"click",sAlign:"right"};v.oColVis=b.extend({},n,x.amsDatatableColvisOptions);break;case"editable":a.ajax.check(b.fn.editable,a.baseURL+"ext/jquery-jeditable"+a.devext+".js");a.ajax.check(b.fn.makeEditable,a.baseURL+"ext/jquery-dataTables-editable"+a.devext+".js");break;case"fixedcolumns":a.ajax.check(b.fn.dataTable.FixedColumns,a.baseURL+"ext/jquery-dataTables-fixedColumns"+a.devext+".js");break;case"fixedheader":a.ajax.check(b.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(b.fn.rowGrouping,a.baseURL+"ext/jquery-dataTables-rowGrouping"+a.devext+".js");break;case"rowreordering":a.ajax.check(b.fn.rowReordering,a.baseURL+"ext/jquery-dataTables-rowReordering"+a.devext+".js");break;case"scroller":a.ajax.check(b.fn.dataTable.Scroller,a.baseURL+"ext/jquery-dataTables-scroller"+a.devext+".js");break;default:break}}}v=a.executeFunctionByName(x.amsDatatableInitCallback,u,v)||v;var g=u.dataTable(v);a.executeFunctionByName(x.amsDatatableAfterInitCallback,u,g,v);if(w.length>0){for(j in w){switch(w[j]){case"autofill":var y=b.extend({},x.amsDatatableAutofillOptions,v.autofill);y=a.executeFunctionByName(x.amsDatatableAutofillInitCallback,u,y)||y;u.data("ams-autofill",x.amsDatatableAutofillConstructor===undefined?new b.fn.dataTable.AutoFill(u,y):a.executeFunctionByName(x.amsDatatableAutofillConstructor,u,g,y));break;case"columnfilter":var k={sPlaceHolder:"head:after"};var l=b.extend({},k,x.amsDatatableColumnfilterOptions,v.columnfilter);l=a.executeFunctionByName(x.amsDatatableColumnfilterInitCallback,u,l)||l;u.data("ams-columnfilter",x.amsDatatableColumnfilterConstructor===undefined?g.columnFilter(l):a.executeFunctionByName(x.amsDatatableColumnfilterConstructor,u,g,l));break;case"editable":var m=b.extend({},x.amsDatatableEditableOptions,v.editable);m=a.executeFunctionByName(x.amsDatatableEditableInitCallback,u,m)||m;u.data("ams-editable",x.amsDatatableEditableConstructor===undefined?u.makeEditable(m):a.executeFunctionByName(x.amsDatatableEditableConstructor,u,g,m));break;case"fixedcolumns":var f=b.extend({},x.amsDatatableFixedcolumnsOptions,v.fixedcolumns);f=a.executeFunctionByName(x.amsDatatableFixedcolumnsInitCallback,u,f)||f;u.data("ams-fixedcolumns",x.amsDatatableFixedcolumnsConstructor===undefined?new b.fn.dataTable.FixedColumns(u,f):a.executeFunctionByName(x.amsDatatableFixedcolumnsConstructor,u,g,f));break;case"fixedheader":var s=b.extend({},x.amsDatatableFixedheaderOptions,v.fixedheader);s=a.executeFunctionByName(x.amsDatatableFixedheadeInitCallback,u,s)||s;u.data("ams-fixedheader",x.amsDatatableFixedheaderConstructor===undefined?new b.fn.dataTable.FixedHeader(u,s):a.executeFunctionByName(x.amsDatatableFixedheaderConstructor,u,g,s));break;case"keytable":var i={table:u.get(0),datatable:g};var q=b.extend({},i,x.amsDatatableKeytableOptions,v.keytable);q=a.executeFunctionByName(x.amsDatatableKeytableInitCallback,u,q)||q;u.data("ams-keytable",x.amsDatatableKeytableConstructor===undefined?new KeyTable(q):a.executeFunctionByName(x.amsDatatableKeytableConstructor,u,g,q));break;case"rowgrouping":var p=b.extend({},x.amsDatatableRowgroupingOptions,v.rowgrouping);p=a.executeFunctionByName(x.amsDatatableRowgroupingInitCallback,u,p)||p;u.data("ams-rowgrouping",x.amsDatatableRowgroupingConstructor===undefined?u.rowGrouping(p):a.executeFunctionByName(x.amsDatatableRowgroupingConstructor,u,g,p));break;case"rowreordering":var o=b.extend({},x.amsDatatableRowreorderingOptions,v.rowreordering);o=a.executeFunctionByName(x.amsDatatableRowreorderingInitCallback,u,o)||o;u.data("ams-rowreordering",x.amsDatatableRowreorderingConstructor===undefined?u.rowReordering(o):a.executeFunctionByName(x.amsDatatableRowreorderingConstructor,u,g,o));break;default:break}}}var t=(x.amsDatatableFinalizeCallback||"").split(/\s+/);if(t.length>0){for(j in t){a.executeFunctionByName(t[j],u,g,v)}}})})}},tablednd:function(d){var c=b(".table-dnd",d);if(c.length>0){a.ajax.check(b.fn.tableDnD,a.baseURL+"ext/jquery-tablednd"+a.devext+".js",function(e){c.each(function(){var i=b(this);b(i).on("mouseover","tr",function(){b(this.cells[0]).addClass("drag-handle")}).on("mouseout","tr",function(){b(this.cells[0]).removeClass("drag-handle")});var j=i.data();var g={onDragClass:j.amsTabledndDragClass||"dragging-row",onDragStart:j.amsTabledndDragStart,dragHandle:j.amsTabledndDragHandle,scrollAmount:j.amsTabledndScrollAmount,onAllowDrop:j.amsTabledndAllowDrop,onDrop:j.amsTabledndDrop||function(m,o){var l=j.amsTabledndDropTarget;if(l){var k=[];b(m.rows).each(function(){var p=b(this).data("ams-element-name");if(p){k.push(p)}});var n=a.getFunctionByName(l);if(typeof(n)=="function"){n.call(i,m,k)}else{a.ajax.post(l,{names:JSON.stringify(k)})}}return false}};var f=b.extend({},g,j.amsTabledndOptions);f=a.executeFunctionByName(j.amsTabledndInitCallback,i,f)||f;var h=i.tableDnD(f);a.executeFunctionByName(j.amsTabledndAfterInitCallback,i,h,f)})})}},tinymce:function(c){function f(){b(".tinymce",b(this)).each(function(){var g=tinymce.get(b(this).attr("id"));if(g){g.remove()}})}var d=b(".tinymce",c);if(d.length>0){var e=a.baseURL+"ext/tinymce"+(a.devmode?"/dev":"");a.ajax.check(window.tinymce,e+"/tinymce"+a.devext+".js",function(g){if(g){a.getScript(e+"/jquery.tinymce"+a.devext+".js");tinymce.baseURL=e;tinymce.suffix=a.devext;a.skin.registerCleanCallback(f)}d.each(function(){var k=b(this);var n=k.data();var j={theme:"modern",language:a.lang,plugins:["advlist autosave autolink lists link image charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime media nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern"],toolbar1:"newdocument undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",toolbar2:"print preview media | forecolor backcolor emoticons | code fullscreen",content_css:n.amsTinymceContentCss,formats:n.amsTinymceFormats,style_formats:n.amsTinymceStyleFormats,block_formats:n.amsTinymceBlockFormats,valid_classes:n.amsTinymceValidClasses,image_advtab:true,image_list:a.getFunctionByName(n.amsTinymceImageList)||n.amsTinymceImageList,image_class_list:n.amsTinymceImageClassList,link_list:a.getFunctionByName(n.amsTinymceLinkList)||n.amsTinymceLinkList,link_class_list:n.amsTinymceLinkClassList,resize:true};if(n.amsTinymceExternalPlugins){var o=n.amsTinymceExternalPlugins.split(/\s+/);for(var h in o){var m=k.data("ams-tinymce-plugin-"+o[h]);tinymce.PluginManager.load(o[h],a.getSource(m))}}var i=b.extend({},j,n.amsTinymceOptions);i=a.executeFunctionByName(n.amsTinymceInitCallback,k,i)||i;var l=k.tinymce(i);a.executeFunctionByName(n.amsTinymceAfterInitCallback,k,l,i)})})}},imgareaselect:function(d){var c=b(".imgareaselect",d);if(c.length>0){a.ajax.check(b.fn.imgAreaSelect,a.baseURL+"ext/jquery-imgareaselect-0.9.10"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-imgareaselect"+a.devext+".css")}c.each(function(){var k=b(this);var j=k.data();var h=j.amsImgareaselectParent?k.parents(j.amsImgareaselectParent):"body";var g={instance:true,handles:true,parent:h,x1:j.amsImgareaselectX1||0,y1:j.amsImgareaselectY1||0,x2:j.amsImgareaselectX2||j.amsImgareaselectImageWidth,y2:j.amsImgareaselectY2||j.amsImgareaselectImageHeight,imageWidth:j.amsImgareaselectImageWidth,imageHeight:j.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:j.amsImgareaselectRatio,onSelectEnd:a.getFunctionByName(j.amsImgareaselectSelectEnd)||function(l,m){var n=j.amsImgareaselectTargetField||"image_";b('input[name="'+n+'x1"]',h).val(m.x1);b('input[name="'+n+'y1"]',h).val(m.y1);b('input[name="'+n+'x2"]',h).val(m.x2);b('input[name="'+n+'y2"]',h).val(m.y2)}};var f=b.extend({},g,j.amsImgareaselectOptions);f=a.executeFunctionByName(j.amsImgareaselectInitCallback,k,f)||f;var i=k.imgAreaSelect(f);a.executeFunctionByName(j.amsImgareaselectAfterInitCallback,k,i,f);setTimeout(function(){i.update()},250)})})}},fancybox:function(c){var d=b(".fancybox",c);if(d.length>0){a.ajax.check(b.fn.fancybox,a.baseURL+"ext/jquery-fancybox-2.1.5"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-fancybox-2.1.5"+a.devext+".css")}d.each(function(){var f=b(this);var m=f.data();var l=(m.amsFancyboxHelpers||"").split(/\s+/);if(l.length>0){for(var g in l){var k=l[g];switch(k){case"buttons":a.ajax.check(b.fancybox.helpers.buttons,a.baseURL+"ext/fancybox-helpers/fancybox-buttons"+a.devext+".js");break;case"thumbs":a.ajax.check(b.fancybox.helpers.thumbs,a.baseURL+"ext/fancybox-helpers/fancybox-thumbs"+a.devext+".js");break;case"media":a.ajax.check(b.fancybox.helpers.media,a.baseURL+"ext/fancybox-helpers/fancybox-media"+a.devext+".js");break;default:break}}}var i={type:m.amsFancyboxType,padding:m.amsFancyboxPadding||10,margin:m.amsFancyboxMargin||10,beforeLoad:a.getFunctionByName(m.amsFancyboxBeforeLoad)||function(){this.title=a.executeFunctionByName(m.amsFancyboxTitleGetter,this)||b(this.element).attr("original-title")||b(this.element).attr("title")},helpers:{title:{type:"inside"}}};var h=b.extend({},i,m.amsFancyboxOptions);h=a.executeFunctionByName(m.amsFancyboxInitCallback,f,h)||h;var j=f.fancybox(h);a.executeFunctionByName(m.amsFancyboxAfterInitCallback,f,j,h)})})}},graphs:function(d){var c=b(".sparkline",d);if(c.length>0){a.ajax.check(a.graphs,a.baseURL+"myams-graphs"+a.devext+".js",function(){a.graphs.init(c)})}},scrollbars:function(c){var d=b(".scrollbar",c);if(d.length>0){a.ajax.check(b.event.special.mousewheel,a.baseURL+"ext/jquery-mousewheel.min.js",function(){a.ajax.check(b.fn.mCustomScrollbar,a.baseURL+"ext/jquery-mCustomScrollbar"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar")}d.each(function(){var j=b(this);var i=j.data();var g={theme:i.amsScrollbarTheme||"light"};var f=b.extend({},g,i.amsScrollbarOptions);f=a.executeFunctionByName(i.amsScrollbarInitCallback,j,f)||f;var h=j.mCustomScrollbar(f);a.executeFunctionByName(i.amsScrollbarAfterInitCallback,j,h,f)})})})}}}};MyAMS.callbacks={init:function(c){b("[data-ams-callback]",c).each(function(){var d=this;var e=b(d).data();var f=a.getFunctionByName(e.amsCallback);if(f===undefined){if(e.amsCallbackSource){a.getScript(e.amsCallbackSource,function(){a.executeFunctionByName(e.amsCallback,d,e.amsCallbackOptions)})}else{if(window.console){console.warn("Undefined callback: "+e.amsCallback)}}}else{f.call(d,e.amsCallbackOptions)}})},alert:function(k){var f=b(this).data();var c=b.extend({},k,f.amsAlertOptions);var i=b(f.amsAlertParent||c.parent||this);var e=f.amsAlertStatus||c.status||"info";var g=f.amsAlertHeader||c.header;var j=f.amsAlertMessage||c.message;var h=f.amsAlertSubtitle||c.subtitle;var d=f.amsAlertMargin===undefined?(c.margin===undefined?false:c.margin):f.amsAlertMargin;a.skin.alert(i,e,g,j,h,d)},messageBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsMessageboxOptions);var e=b.extend({},f,{title:g.amsMessageboxTitle||f.title||"",content:g.amsMessageboxContent||f.content||"",icon:g.amsMessageboxIcon||f.icon,number:g.amsMessageboxNumber||f.number,timeout:g.amsMessageboxTimeout||f.timeout});var c=g.amsMessageboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsMessageboxCallback||f.callback);a.skin.messageBox(c,e,h)},smallBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsSmallboxOptions);var e=b.extend({},f,{title:g.amsSmallboxTitle||f.title||"",content:g.amsSmallboxContent||f.content||"",icon:g.amsSmallboxIcon||f.icon,iconSmall:g.amsSmallboxIconSmall||f.iconSmall,timeout:g.amsSmallboxTimeout||f.timeout});var c=g.amsSmallboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsSmallboxCallback||f.callback);a.skin.smallBox(c,e,h)}};MyAMS.events={init:function(c){b("[data-ams-events-handlers]",c).each(function(){var e=b(this);var d=e.data("ams-events-handlers");for(var f in d){e.on(f,a.getFunctionByName(d[f]))}})}};MyAMS.container={changeOrder:function(d,e){var c=b('input[name="'+b(this).data("ams-input-name")+'"]',b(this));c.val(e.join(";"))},deleteElement:function(c){return function(){var d=b(this);MyAMS.skin.bigBox({title:a.i18n.WARNING,content:'  '+a.i18n.DELETE_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(g){if(g==a.i18n.BTN_OK){var i=d.parents("table");var f=i.data("ams-location")||"";var j=d.parents("tr");var h=j.data("ams-delete-target")||i.data("ams-delete-target")||"delete-element.json";var e=j.data("ams-element-name");MyAMS.ajax.post(f+"/"+h,{object_name:e},function(k,l){if(k.status=="success"){if(i.hasClass("datatable")){i.dataTable().fnDeleteRow(j[0])}else{j.remove()}}})}})}}};MyAMS.skin={_setPageHeight:function(){var e=b("#main").height();var c=a.left_panel.height();var d=b(window).height()-a.navbar_height;if(e>d){a.left_panel.css("min-height",e);a.root.css("min-height",e+a.navbar_height)}else{a.left_panel.css("min-height",d);a.root.css("min-height",d)}},_checkMobileWidth:function(){if(b(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(){$this=b("#activity > .badge");if(parseInt($this.text())>0){$this.removeClass("hidden").addClass("bg-color-red bounceIn animated")}else{$this.addClass("hidden").removeClass("bg-color-red bounceIn animated")}},_initDesktopWidgets:function(c){if(a.enable_widgets){var d=b(".ams-widget",c);if(d.length>0){a.ajax.check(b.fn.MyAMSWidget,a.baseURL+"myams-widgets"+a.devext+".js",function(){d.each(function(){var h=b(this);var g=h.data();var f={deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"};var e=b.extend({},f,g.amsWidgetOptions);e=a.executeFunctionByName(g.amsWidgetInitcallback,h,e)||e;h.MyAMSWidget(e)});MyAMSWidget.initWidgetsGrid(b(".ams-widget-grid",c))})}}},_initMobileWidgets:function(c){if(a.enable_mobile&&a.enable_widgets){a.skin._initDesktopWidgets(c)}},alert:function(j,d,e,k,i,c){b(".alert",j).remove();if(d=="error"){d="danger"}var g='

'+e+"

"+(i?("

"+i+"

"):"");if(typeof(k)=="string"){g+="
  • "+k+"
"}else{if(k){g+="
    ";for(var f in k){if(!b.isNumeric(f)){continue}g+="
  • "+k[f]+"
  • "}g+="
"}}g+="
";var h=b(g).prependTo(j);if(j.exists){a.ajax.check(b.scrollTo,a.baseURL+"ext/jquery-scrollTo.min.js",function(){b.scrollTo(j,{offset:{top:-50}})})}},bigBox:function(c,d){a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){a.notify.messageBox(c,d)})},messageBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.bigBox(d,e)})},smallBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.smallBox(d,e)})},_drawBreadCrumb:function(){var c=b("#ribbon OL.breadcrumb");c.empty().append(b("
  • ").append(b("").text(a.i18n.HOME).attr("href",b('nav a[href!="#"]:first').attr("href"))));b("nav LI.active >A").each(function(){var f=b(this);var d=b.trim(f.clone().children(".badge").remove().end().text());var e=b("
  • ").append(f.attr("href").replace(/^#/,"")?b("").html(d).attr("href",f.attr("href")):d);c.append(e)})},checkURL:function(){function c(i){b("nav .active").removeClass("active");i.addClass("open").addClass("active");i.parents("li").addClass("open active").children("ul").addClass("active").show();i.parents("li:first").removeClass("open");i.parents("ul").addClass(i.attr("href").replace(/^#/,"")?"active":"").show()}var f=location.hash;var e=f.replace(/^#/,"");if(e){var d=b("#content");if(!d.exists()){d=b("body")}var g=b('nav A[href="'+f+'"]');if(g.exists()){c(g)}a.skin.loadURL(e,d);document.title=b("[data-ams-page-title]:first",d).data("ams-page-title")||g.attr("title")||document.title}else{var h=b("[data-ams-active-menu]").data("ams-active-menu");if(h){g=b('nav A[href="'+h+'"]')}else{g=b('nav >UL >LI >A[href!="#"]').first()}if(g.exists()){c(g);if(h){a.skin._drawBreadCrumb()}else{window.location.hash=g.attr("href")}}}},_clean_callbacks:[],registerCleanCallback:function(d){var c=a.skin._clean_callbacks;if(c.indexOf(d)<0){c.push(d)}},cleanContainer:function(c){var e=a.skin._clean_callbacks;for(var d in e){e[d].call(c)}},loadURL:function(e,c,d,h){if(e.startsWith("#")){e=e.substr(1)}if(typeof(d)=="function"){h=d;d={}}c=b(c);var g={type:"GET",url:e,dataType:"html",cache:false,beforeSend:function(){a.skin.cleanContainer(c);c.html('

    Loading...

    ');if(c[0]==b("#content")[0]){a.skin._drawBreadCrumb();document.title=b(".breadcrumb LI:last-child").text();b("html, body").animate({scrollTop:0},"fast")}else{c.animate({scrollTop:0},"fast")}},success:function(m,j,l){if(h){a.executeFunctionByName(h,this,m,j,l,d)}else{var k=a.ajax.getResponse(l);var n=k.content_type;var i=k.data;b(".loading",c).remove();switch(n){case"json":a.ajax.handleJSON(i,c);break;case"script":break;case"xml":break;case"html":case"text":default:c.parents(".hidden").removeClass("hidden");b(".alert",c.parents(".alerts-container")).remove();c.css({opacity:"0.0"}).html(m).removeClass("hidden").delay(50).animate({opacity:"1.0"},300);a.initContent(c)}if(d&&d.afterLoadCallback){a.executeFunctionByName(d.afterLoadCallback,this)}}},error:function(k,j,i){c.html('

    '+a.i18n.ERROR+i+"

    "+k.responseText)},async:false};var f=b.extend({},g,d);b.ajax(f)},setLanguage:function(d){var f=d.lang;var e=d.handler_type||"json";switch(e){case"json":var g=d.method||"setUserLanguage";a.jsonrpc.post(g,{lang:f},function(){window.location.reload(true)});break;case"ajax":var c=d.href||"setUserLanguage";a.ajax.post(c,{lang:f},function(){window.location.reload(true)});break}},logout:function(){window.location=a.loginURL}};MyAMS.initPage=function(){var c=b("body");a.root=c;a.left_panel=b("#left-panel");a.shortcuts=b("#shortcut");a.plugins.initData(c);var d=b.ajaxSettings.xhr;b.ajaxSetup({progress:a.ajax.progress,progressUpload:a.ajax.progress,xhr:function(){var f=d();if(f&&(typeof(f.addEventListener)=="function")){var e=this;f.addEventListener("progress",function(g){e.progress(g)},false)}return f}});b(document).ajaxStart(a.ajax.start);b(document).ajaxStop(a.ajax.stop);b(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.enable_fastclick){a.ajax.check(b.fn.noClickDelay,a.baseURL+"/ext/jquery-smartclick"+a.devext+".js",function(){b("NAV UL A").noClickDelay();b("#hide-menu A").noClickDelay()})}}b("#hide-menu >:first-child > A").click(function(f){c.toggleClass("hidden-menu");f.preventDefault()});b("#show-shortcut").click(function(f){if(a.shortcuts.is(":visible")){a.skin._hideShortcutButtons()}else{a.skin._showShortcutButtons()}f.preventDefault()});b(document).mouseup(function(f){if(!a.shortcuts.is(f.target)&&a.shortcuts.has(f.target).length===0){a.skin._hideShortcutButtons()}});b("#search-mobile").click(function(){a.root.addClass("search-mobile")});b("#cancel-search-js").click(function(){a.root.removeClass("search-mobile")});b("#activity").click(function(g){var f=b(this);var h=f.next(".ajax-dropdown");if(!h.is(":visible")){h.css("left",f.position().left-h.innerWidth()/2+f.innerWidth()/2).fadeIn(150);f.addClass("active")}else{h.fadeOut(150);f.removeClass("active")}g.preventDefault()});a.skin.checkNotification();b(document).mouseup(function(f){var g=b(".ajax-dropdown");if(!g.is(f.target)&&g.has(f.target).length===0){g.fadeOut(150).prev().removeClass("active")}});b('input[name="activity"]').change(function(){var e=b(this).data("ams-url");container=b(".ajax-notifications");a.skin.loadURL(e,container)});b("#logout a").click(function(f){f.preventDefault();f.stopPropagation();a.loginURL=b(this).attr("href");a.skin.bigBox({title:" "+a.i18n.LOGOUT+" "+b("#show-shortcut").text()+" ?",content:a.i18n.LOGOUT_COMMENT,buttons:"["+a.i18n.BTN_NO+"]["+a.i18n.BTN_YES+"]"},function(e){if(e==a.i18n.BTN_YES){a.root.addClass("animated fadeOutUp");setTimeout(a.skin.logout,1000)}})});b("NAV UL").myams_menu({accordion:true,speed:a.menu_speed});b(".minifyme").click(function(f){b("BODY").toggleClass("minified");b(this).effect("highlight",{},500);f.preventDefault()});b("#refresh").click(function(f){a.skin.bigBox({title:" "+a.i18n.CLEAR_STORAGE_TITLE,content:a.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+a.i18n.BTN_CANCEL+"]["+a.i18n.BTN_OK+"]"},function(e){if(e==a.i18n.BTN_OK&&localStorage){localStorage.clear();location.reload()}});f.preventDefault()});c.on("click",function(g){var f=b(this);if(!f.is(g.target)&&f.has(g.target).length===0&&b(".popover").has(g.target).length===0){f.popover("hide")}});a.ajax.check(b.resize,a.baseURL+"ext/jquery-resize"+a.devext+".js",function(){b("#main").resize(function(){a.skin._setPageHeight();a.skin._checkMobileWidth()});b("nav").resize(function(){a.skin._setPageHeight()})});if(a.ajax_nav){b(document).on("click",'a[href="#"]',function(f){f.preventDefault()});b(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(j){var h=b(j.currentTarget);var f=h.attr("href")||h.data("ams-url");if(!f||f.startsWith("javascript:")||h.attr("target")||(h.data("ams-context-menu")===true)){return}j.preventDefault();j.stopPropagation();var g=a.getFunctionByName(f);if(typeof(g)=="function"){f=g.call(h)}if(typeof(f)=="function"){f.call(h)}else{f=f.replace(/\%23/,"#");var i=h.data("ams-target");if(i){a.form.confirmChangedForm(i,function(){a.skin.loadURL(f,i,h.data("ams-link-options"),h.data("ams-link-callback"));j.stopPropagation()})}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},50)}else{window.location.hash=f}}}else{window.location=f}})}}});b(document).on("click",'a[target="_blank"]',function(f){f.preventDefault();window.open(b(f.currentTarget).attr("href"))});b(document).on("click",'a[target="_top"]',function(f){f.preventDefault();a.form.confirmChangedForm(function(){window.location=b(f.currentTarget).attr("href")})});b(window).on("hashchange",a.skin.checkURL)}b(document).off("click.modal").on("click",'[data-toggle="modal"]',function(g){var f=b(this);if(f.data("ams-context-menu")===true){return}if(f.data("ams-stop-propagation")===true){g.stopPropagation()}g.preventDefault();a.dialog.open(f);if(f.parents("#shortcut").exists()){setTimeout(a.skin._hideShortcutButtons,300)}});b(document).on("click",'button[type="submit"], button.submit',function(){var e=b(this);b(e.get(0).form).data("ams-submit-button",e)});b(document).on("click","[data-ams-click-handler]",function(h){var g=b(this);var f=g.data();if(f.amsClickHandler){if((f.amsStopPropagation===true)||(f.amsClickStopPropagation===true)){h.stopPropagation()}if(f.amsClickKeepDefault!==true){h.preventDefault()}var i=a.getFunctionByName(f.amsClickHandler);if(i!==undefined){i.call(g,f.amsClickHandlerOptions)}}});b(document).on("change","[data-ams-change-handler]",function(h){var g=b(this);var f=g.data();if(f.amsChangeHandler){if(f.amsChangeKeepDefault!==true){h.preventDefault()}var i=a.getFunctionByName(f.amsChangeHandler);if(i!==undefined){i.call(g,f.amsChangeHandlerOptions)}}});b(document).on("reset","form",function(g){var f=b(this);setTimeout(function(){f.find(".select2").trigger("change")},10)});b(document).on("reset","[data-ams-reset-handler]",function(h){var f=b(this);var g=f.data();if(g.amsResetHandler){if(g.amsResetKeepDefault!==true){h.preventDefault()}var i=a.getFunctionByName(g.amsResetHandler);if(i!==undefined){i.call(f,g.amsResetHandlerOptions)}}});b(document).on("change",'input[type="file"]',function(h){h.preventDefault();var f=b(this);var g=f.parent(".button");if(g.exists()&&g.parent().hasClass("input-file")){g.next('input[type="text"]').val(f.val())}});b(document).on("focusin",function(f){if(b(f.target).closest(".mce-window").length){f.stopImmediatePropagation()}});b("a[data-toggle=tab]",".nav-tabs").on("click",function(f){if(b(this).parent("li").hasClass("disabled")){f.preventDefault();return false}});b(document).on("show.bs.tab",function(h){var f=b(h.target);var g=f.data();if(g.amsUrl){if(g.amsTabLoaded){return}a.skin.loadURL(g.amsUrl,f.attr("href"));if(g.amsTabLoadOnce){f.data("ams-tab-loaded",true)}}});a.initContent(document);if(a.ajax_nav&&(b("nav").length>0)){a.skin.checkURL()}b(window).on("beforeunload",a.form.checkBeforeUnload)};MyAMS.initContent=function(c){b(".tipsy").remove();b("[rel=tooltip]",c).tooltip();b("[rel=popover]",c).popover();b("[rel=popover-hover]",c).popover({trigger:"hover"});a.plugins.init(c);a.callbacks.init(c);a.events.init(c);a.form.init(c);if(a.device==="desktop"){a.skin._initDesktopWidgets(c)}else{a.skin._initMobileWidgets(c)}a.skin._setPageHeight()};MyAMS.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]",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"};b(document).ready(function(){b=jQuery.noConflict();var c=b("HTML");var d=c.attr("lang")||c.attr("xml:lang");if(d&&!d.startsWith("en")){MyAMS.lang=d;MyAMS.getScript(MyAMS.baseURL+"i18n/myams_"+d.substr(0,2)+".js",function(){MyAMS.initPage()})}else{MyAMS.initPage()}})})(jQuery); \ No newline at end of file +(function(b){String.prototype.startsWith=function(e){var c=this.length;var d=e.length;if(c0};if(b.scrollbarWidth===undefined){b.scrollbarWidth=function(){var d=b('
    ').appendTo("body");var e=d.children();var c=e.innerWidth()-e.height(99).innerWidth();d.remove();return c}}b.fn.extend({exists:function(){return b(this).length>0},listattr:function(d){var c=[];this.each(function(){c.push(b(this).attr(d))});return c},style:function(d,g,c){var f=this.get(0);if(typeof f=="undefined"){return}var e=this.get(0).style;if(typeof d!="undefined"){if(typeof g!="undefined"){c=typeof c!="undefined"?c:"";e.setProperty(d,g,c);return this}else{return e.getPropertyValue(d)}}else{return e}},removeClassPrefix:function(c){this.each(function(e,f){var d=f.className.split(" ").map(function(g){return g.startsWith(c)?"":g});f.className=b.trim(d.join(" "))});return this},contextMenu:function(d){function c(g,i,f){var h=b(window)[i](),j=b(d.menuSelector)[i](),e=g;if(g+j>h&&j',openedSign:''};var d=b.extend({},e,c);var f=b(this);f.find("LI").each(function(){var g=b(this);if(g.find("UL").size()>0){g.find("A:first").append(""+d.closedSign+"");var h=g.find("A:first");if(h.attr("href")=="#"){h.click(function(){return false})}}});f.find("LI.active").each(function(){var g=b(this).parents("UL");var h=g.parent("LI");g.slideDown(d.speed);h.find("b:first").html(d.openedSign);h.addClass("open")});f.find("LI A").on("click",function(){var j=b(this);var g=j.parent().find("UL");if(d.accordion){var i=j.parent().parents("UL");var k=f.find("UL:visible");k.each(function(l){var m=true;i.each(function(n){if(i[n]==k[l]){m=false;return false}});if(m){if(g!=k[l]){b(k[l]).slideUp(d.speed,function(){j.parent("LI").find("b:first").html(d.closedSign);j.parent("LI").removeClass("open")})}}})}var h=j.parent().find("UL:first");if(!j.attr("href").replace(/^#/,"")&&h.is(":visible")&&!h.hasClass("active")){h.slideUp(d.speed,function(){j.parent("LI").removeClass("open").find("B:first").delay(d.speed).html(d.closedSign)})}else{h.slideDown(d.speed,function(){j.parent("LI").addClass("open").find("B:first").delay(d.speed).html(d.openedSign)})}})}});b.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");var d="";for(var g=0;g127)&&(f<2048)){d+=String.fromCharCode((f>>6)|192);d+=String.fromCharCode((f&63)|128)}else{d+=String.fromCharCode((f>>12)|224);d+=String.fromCharCode(((f>>6)&63)|128);d+=String.fromCharCode((f&63)|128)}}}return d},decode:function(d){var f="";var h=0,j=0,g=0,e=0;while(h191)&&(j<224)){g=d.charCodeAt(h+1);f+=String.fromCharCode(((j&31)<<6)|(g&63));h+=2}else{g=d.charCodeAt(h+1);e=d.charCodeAt(h+2);f+=String.fromCharCode(((j&15)<<12)|((g&63)<<6)|(e&63));h+=3}}}return f}};if(window.MyAMS===undefined){window.MyAMS={devmode:true,devext:"",lang:"en",throttle_delay:350,menu_speed:235,navbar_height:49,ajax_nav:true,enable_widgets:true,enable_mobile:false,enable_fastclick:false,warn_on_form_change:false,ismobile:(/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()))}}var a=MyAMS;MyAMS.baseURL=(function(){var c=b('script[src*="/myams.js"], script[src*="/myams.min.js"]');var d=c.attr("src");a.devmode=d.indexOf(".min.js")<0;a.devext=a.devmode?"":".min";return d.substring(0,d.lastIndexOf("/")+1)})();MyAMS.getQueryVar=function(e,f){if(e.indexOf("?")<0){return false}if(!e.endsWith("&")){e+="&"}var c=new RegExp(".*?[&\\?]"+f+"=(.*?)&.*");var d=e.replace(c,"$1");return d==e?false:d};MyAMS.rgb2hex=function(c){return"#"+b.map(c.match(/\b(\d+)\b/g),function(d){return("0"+parseInt(d).toString(16)).slice(-2)}).join("")};MyAMS.generateId=function(){function c(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return c()+c()+c()+c()};MyAMS.getFunctionByName=function(h,d){if(h===undefined){return undefined}else{if(typeof(h)=="function"){return h}}var g=h.split(".");var f=g.pop();d=(d===undefined||d===null)?window:d;for(var c=0;c").attr({rel:"stylesheet",type:"text/css",href:f,"data-ams-id":g}).appendTo(e)}};MyAMS.event={stop:function(c){if(!c){c=window.event}if(c){if(c.stopPropagation){c.stopPropagation();c.preventDefault()}else{c.cancelBubble=true;c.returnValue=false}}}};MyAMS.browser={getInternetExplorerVersion:function(){var e=-1;if(navigator.appName=="Microsoft Internet Explorer"){var c=navigator.userAgent;var d=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(d.exec(c)!=null){e=parseFloat(RegExp.$1)}}return e},checkVersion:function(){var d="You're not using Windows Internet Explorer.";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=8){d="You're using a recent copy of Windows Internet Explorer."}else{d="You should upgrade your copy of Windows Internet Explorer."}}alert(d)},isIE8orlower:function(){var d="0";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=9){d=0}else{d=1}}return d}};MyAMS.error={ajax:function(f,e){if(e.statusText=="OK"){return}var c=a.ajax.getResponse(e);if(c.content_type=="json"){a.ajax.handleJSON(c.data)}else{var g=f.statusText||f.type;var d=e.responseText;a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"

    "+g+"

    "+d+"

    ",icon:"fa fa-warning animated shake",timeout:10000})}if(window.console){console.error(f);console.debug(e)}},show:function(f,c,e){if(!e){return}var d=a.ajax.getResponse(f);if(d.content_type=="json"){a.ajax.handleJSON(d.data)}else{a.skin.messageBox("error",{title:a.i18n.ERRORS_OCCURED,content:"

    "+c+"

    "+e+"

    ",icon:"fa fa-warning animated shake",timeout:10000})}if(window.console){console.error(e);console.debug(f)}}};MyAMS.ajax={check:function(d,f,h,c){if(typeof(h)=="object"){c=h;h=undefined}var g={async:typeof(h)=="function"};var e=b.extend({},g,c);if(d===undefined){a.getScript(f,function(){if(typeof(h)=="function"){h(true,c)}},e)}else{if(typeof(h)=="function"){h(false,c)}}},getAddr:function(d){var c=d||b("HTML HEAD BASE").attr("href")||window.location.href;return c.substr(0,c.lastIndexOf("/")+1)},start:function(){b("#ajax-gear").show()},stop:function(){b("#ajax-gear").hide()},progress:function(c){if(!c.lengthComputable){return}if(c.loaded>=c.total){return}console.log(parseInt((c.loaded/c.total*100),10)+"%")},post:function(e,g,d,j){if(e.startsWith(window.location.protocol)){var i=e}else{i=this.getAddr()+e}if(typeof(d)=="function"){j=d;d={}}else{if(!d){d={}}}if(typeof(j)=="undefined"){j=d.callback}if(typeof(j)=="string"){j=a.getFunctionByName(j)}delete d.callback;var c=undefined;var h={url:i,type:"post",cache:false,async:typeof(j)=="function",data:b.param(g),dataType:"json",success:j||function(k){c=k.result},error:a.error.show};var f=b.extend({},h,d);b.ajax(f);return c},getResponse:function(f){var d=f.getResponseHeader("content-type"),h,c;if(d){if(d.startsWith("application/javascript")){h="script";c=f.responseText}else{if(d.startsWith("text/html")){h="html";c=f.responseText}else{if(d.startsWith("text/xml")){h="xml";c=f.responseText}else{c=f.responseJSON;if(c){h="json"}else{try{c=JSON.parse(f.responseText);h="json"}catch(g){c=f.responseText;h="text"}}}}}}else{h="json";c={status:"alert",alert:{title:a.i18n.ERROR_OCCURED,content:a.i18n.NO_SERVER_RESPONSE}}}return{content_type:h,data:c}},handleJSON:function(n,e,j){var h=n.status;var c;switch(h){case"alert":alert(n.alert.title+"\n\n"+n.alert.content);break;case"error":a.form.showErrors(e,n);break;case"info":case"success":if(n.close_form!=false){a.dialog.close(e)}break;case"message":case"messagebox":break;case"notify":case"callback":case"callbacks":if(n.close_form!=false){a.dialog.close(e)}break;case"modal":a.dialog.open(n.location);break;case"reload":if(n.close_form!=false){a.dialog.close(e)}c=n.location||window.location.hash;if(c.startsWith("#")){c=c.substr(1)}a.skin.loadURL(c,n.target||j||"#content");break;case"redirect":if(n.close_form==true){a.dialog.close(e)}c=n.location||window.location.href;if(n.window){window.open(c,n.window,n.options)}else{if(window.location.href==c){window.location.reload(true)}else{window.location.href=c}}break;default:console.log("Unhandled status: "+h);break}if(n.content){var k=n.content;var d=b(k.target||j||e||"#content");if(k.raw==true){d.text(k.text)}else{d.html(k.html);a.initContent(d)}if(!k.keep_hidden){d.removeClass("hidden")}}if(n.contents){var g=n.contents;for(var i in g){k=g[i];d=b(k.target);if(k.raw==true){d.text(k.text)}else{d.html(k.html);a.initContent(d)}if(!k.keep_hidden){d.removeClass("hidden")}}}if(n.message){var m=n.message;if(typeof(m)=="string"){if((h=="info")||(h=="success")){a.skin.smallBox(h,{title:m,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3000})}else{a.skin.alert(b(e||"#content"),h,m)}}else{a.skin.alert(b(m.target||j||e||"#content"),m.status||"success",m.header,m.body,m.subtitle)}}if(n.smallbox){a.skin.smallBox(n.smallbox_status||h,{title:n.smallbox,icon:"fa fa-fw fa-info-circle font-xs align-top margin-top-10",timeout:3000})}if(n.messagebox){m=n.messagebox;if(typeof(m)=="string"){a.skin.messageBox("info",{title:a.i18n.ERROR_OCCURED,content:m,timeout:10000})}else{var f=m.status||"info";if(f=="error"&&e&&j){a.executeFunctionByName(e.data("ams-form-submit-error")||"MyAMS.form.finalizeSubmitOnError",e,j)}a.skin.messageBox(f,{title:m.title||a.i18n.ERROR_OCCURED,content:m.content,icon:m.icon,number:m.number,timeout:m.timeout==null?undefined:(m.timeout||10000)})}}if(n.event){e.trigger(n.event,n.event_options)}if(n.callback){a.executeFunctionByName(n.callback,e,n.options)}if(n.callbacks){for(i in n.callbacks){if(!b.isNumeric(i)){continue}var l=n.callbacks[i];a.executeFunctionByName(l,e,l.options)}}}};MyAMS.jsonrpc={getAddr:function(e){var c=e||b("HTML HEAD BASE").attr("href")||window.location.href;var d=c.replace(/\+\+skin\+\+\w+\//,"");return d.substr(0,d.lastIndexOf("/")+1)},query:function(d,f,c,e){a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){var g;if(typeof(c)=="function"){e=c;c={}}else{if(!c){c={}}}if(typeof(e)=="undefined"){e=c.callback}if(typeof(e)=="string"){e=a.getFunctionByName(e)}delete c.callback;var i={};if(typeof(d)=="string"){i.query=d}else{if(typeof(d)=="object"){b.extend(i,d)}}b.extend(i,c);var h={url:a.jsonrpc.getAddr(c.url),type:"post",cache:false,method:f,params:i,async:typeof(e)=="function",success:e||function(j){g=j.result},error:a.error.show};b.jsonRpc(h);return g})},post:function(f,d,c,e){a.ajax.check(b.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){var g;if(typeof(c)=="function"){e=c;c={}}else{if(!c){c={}}}if(typeof(e)=="undefined"){e=c.callback}if(typeof(e)=="string"){e=a.getFunctionByName(e)}delete c.callback;var g;var i={id:new Date().getTime(),params:d,success:e||function(j){g=j},error:a.error.show};var h=b.extend({},i,c);b.jsonRPC.withOptions({endPoint:a.jsonrpc.getAddr(c.url),namespace:c.namespace,cache:false},function(){b.jsonRPC.request(f,h)});return g})}};MyAMS.xmlrpc={getAddr:function(e){var c=e||b("HTML HEAD BASE").attr("href")||window.location.href;var d=c.replace(/\+\+skin\+\+\w+\//,"");return d.substr(0,d.lastIndexOf("/")+1)},post:function(d,g,e,c,f){a.ajax.check(b.xmlrpc,a.baseURL+"ext/jquery-xmlrpc"+a.devext+".js",function(){var h;if(typeof(c)=="function"){f=c;c={}}else{if(!c){c={}}}if(typeof(f)=="undefined"){f=c.callback}if(typeof(f)=="string"){f=a.getFunctionByName(f)}delete c.callback;var j={url:a.xmlrpc.getAddr(d),methodName:g,params:e,success:f||function(k){h=k},error:a.error.show};var i=b.extend({},j,c);b.xmlrpc(i);return h})}};MyAMS.form={init:function(d){if(a.warn_on_form_change){var c=b('FORM[data-ams-warn-on-change!="false"]',d)}else{c=b('FORM[data-ams-warn-on-change="true"]',d)}c.each(function(){var e=b(this);b('INPUT[type="text"], INPUT[type="checkbox"], INPUT[type="radio"], SELECT, TEXTAREA, [data-ams-changed-event]',e).each(function(){var g=b(this);if(g.data("ams-ignore-change")!==true){var f=g.data("ams-changed-event")||"change";g.on(f,function(){b(this).parents("FORM").attr("data-ams-form-changed",true)})}});e.on("reset",function(){b(this).removeAttr("data-ams-form-changed")})})},checkBeforeUnload:function(){var c=b('FORM[data-ams-form-changed="true"]');if(c.exists()){return a.i18n.FORM_CHANGED_WARNING}},confirmChangedForm:function(d,e){if(typeof(d)=="function"){e=d;d=undefined}var c=b('FORM[data-ams-form-changed="true"]',d);if(c.exists()){a.skin.bigBox({title:a.i18n.WARNING,content:'  '+a.i18n.FORM_CHANGED_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(f){if(f==a.i18n.BTN_OK){e.call(d)}})}else{e.call(d)}},submit:function(e,d,f){e=b(e);if(!e.exists()){return false}if(typeof(d)=="object"){f=d;d=undefined}if(e.data("submitted")){if(!e.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:e.data("ams-form-alert-timeout")||5000})}return false}if(!a.form._checkSubmitValidators(e)){return false}b(".alert, SPAN.state-error",e).remove();b(".state-error",e).removeClassPrefix("state-");var c=b(e.data("ams-submit-button"));if(c&&!c.data("ams-form-hide-loading")){c.button("loading")}a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+a.devext+".js",function(){function i(k,m){var j;var C=k.data();var t=C.amsFormOptions;if(f){var o=f.formDataInitCallback}if(o){delete f.formDataInitCallback}else{o=C.amsFormDataInitCallback}if(o){var u={};if(typeof(o)=="function"){var l=o.call(k,u)}else{l=a.executeFunctionByName(o,k,u)}if(u.veto){j=k.data("ams-submit-button");if(j){j.button("reset")}a.form.finalizeSubmitFooter.call(k);return false}}else{l=C.amsFormData||{}}j=b(k.data("ams-submit-button"));var v,y;if(j){v=j.data("ams-form-handler");y=j.data("ams-form-submit-target")}var r=d||v||C.amsFormHandler||"";if(r.startsWith(window.location.protocol)){var n=r}else{var x=k.attr("action").replace(/#/,"");if(x.startsWith(window.location.protocol)){n=x}else{n=a.ajax.getAddr()+x}n+=r}var B=null;if(C.amsFormInitSubmitTarget){B=b(y||C.amsFormSubmitTarget||"#content");a.executeFunctionByName(C.amsFormInitSubmit||"MyAMS.form.initSubmit",k,B)}else{if(!C.amsFormHideSubmitFooter){a.executeFunctionByName(C.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",k)}}var p=typeof(m.uuid)!="undefined";if(p){if(n.indexOf("X-Progress-ID")<0){n+="?X-Progress-ID="+m.uuid}delete m.uuid}var s={url:n,type:"post",cache:false,data:l,dataType:C.amsFormDatatype,beforeSerialize:function(){if(typeof(tinyMCE)!="undefined"){tinyMCE.triggerSave()}},beforeSubmit:function(E,D){D.data("submitted",true)},error:function(H,D,E,G){if(B){a.executeFunctionByName(C.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",G,B)}if(G.is(":visible")){var F=G.data("ams-submit-button");if(F){F.button("reset")}a.form.finalizeSubmitFooter.call(G)}G.data("submitted",false);G.removeData("ams-submit-button")},iframe:p};var w=C.amsFormDownloadTarget;if(w){var q=b('iframe[name="'+w+'"]');if(!q.exists()){q=b("").hide().attr("name",w).appendTo(k)}s=b.extend({},s,{iframe:true,iframeTarget:q,success:function(D,E,I,H){var G=b(H).parents(".modal-dialog");if(G.exists()){a.dialog.close(H)}else{var J;var F=H.data("ams-submit-button");if(F){J=F.data("ams-form-submit-callback")}if(!J){J=a.getFunctionByName(C.amsFormSubmitCallback)||a.form._submitCallback}J.call(H,D,E,I,H);if(H.is(":visible")&&F){F.button("reset")}H.data("submitted",false);H.removeData("ams-submit-button");H.removeAttr("data-ams-form-changed")}}})}else{s=b.extend({},s,{error:function(H,D,E,G){if(B){a.executeFunctionByName(C.amsFormSubmitError||"MyAMS.form.finalizeSubmitOnError",G,B)}if(G.is(":visible")){var F=G.data("ams-submit-button");if(F){F.button("reset")}a.form.finalizeSubmitFooter.call(G)}G.data("submitted",false);G.removeData("ams-submit-button")},success:function(D,E,H,G){var I;var F=G.data("ams-submit-button");if(F){I=F.data("ams-form-submit-callback")}if(!I){I=a.getFunctionByName(C.amsFormSubmitCallback)||a.form._submitCallback}I.call(G,D,E,H,G);if(G.is(":visible")&&F){F.button("reset")}G.data("submitted",false);G.removeData("ams-submit-button");G.removeAttr("data-ams-form-changed")},iframe:p})}var A=b.extend({},s,m,t,f);b(k).ajaxSubmit(A);if(w){var z=b(k).parents(".modal-dialog");if(z.exists()){a.dialog.close(k)}else{a.form.finalizeSubmitFooter.call(k);if(j){j.button("reset")}k.data("submitted",false);k.removeData("ams-submit-button");k.removeAttr("data-ams-form-changed")}}}var h=b('INPUT[type="file"]',e).length>0;if(h){a.ajax.check(b.progressBar,a.baseURL+"ext/jquery-progressbar"+a.devext+".js");var g=b.extend({},{uuid:b.progressBar.submit(e)});i(e,g)}else{i(e,{})}});return false},initSubmit:function(e,d){var c=b(this);var f='';if(!d){d=c.data("ams-form-submit-message")}if(d){f+=""+d+""}b(e).html('
    '+f+"
    ");b(e).parents(".hidden").removeClass("hidden")},finalizeSubmitOnError:function(c){b("i",c).removeClass("fa-spin").removeClass("fa-gear").addClass("fa-ambulance")},initSubmitFooter:function(d){var c=b(this);var f='';if(!d){d=b(this).data("ams-form-submit-message")}if(d){f+=''+d+""}var e=b("footer",c);b("button",e).hide();e.append('
    '+f+"
    ")},finalizeSubmitFooter:function(){var c=b(this);var d=b("footer",c);if(d){b(".row",d).remove();b("button",d).show()}},_submitCallback:function(m,e,d,c){if(c.is(":visible")){a.form.finalizeSubmitFooter.call(c);var g=c.data("ams-submit-button");if(g){g.button("reset")}}var f=c.data();if(f.amsFormDatatype){var j=f.amsFormDatatype}else{var h=a.ajax.getResponse(d);j=h.content_type;m=h.data}if(g){var i=b(g.amsFormSubmitTarget||f.amsFormSubmitTarget||"#content")}else{i=b(f.amsFormSubmitTarget||"#content")}switch(j){case"json":a.ajax.handleJSON(m,c,i);break;case"script":break;case"xml":break;case"html":case"text":default:if(g&&(g.data("ams-keep-modal")!==true)){a.dialog.close(c)}if(!i.exists()){i=b("body")}i.parents(".hidden").removeClass("hidden");b(".alert",i.parents(".alerts-container")).remove();i.css({opacity:"0.0"}).html(m).delay(50).animate({opacity:"1.0"},300);a.initContent(i)}var k=d.getResponseHeader("X-AMS-Callback");if(k){var l=d.getResponseHeader("X-AMS-Callback-Options");a.executeFunctionByName(k,c,l===undefined?{}:JSON.parse(l),d)}},_getSubmitValidators:function(d){var c=new Array();var e=d.data("ams-form-validator");if(e){c.push([d,e])}b("[data-ams-form-validator]",d).each(function(){var f=b(this);c.push([f,f.data("ams-form-validator")])});return c},_checkSubmitValidators:function(e){var g=a.form._getSubmitValidators(e);if(!g.length){return true}var f=new Array();var l=true;for(var i in g){if(!b.isNumeric(i)){continue}var d=g[i];var c=d[0];var j=d[1];var k=a.executeFunctionByName(j,e,c);if(k===false){l=false}else{if(typeof(k)=="string"){f.push(k)}else{if(l.length&&(l.length>0)){f=f.concat(l)}}}}if(f.length>0){var h=f.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(e,"danger",h,f);return false}else{return l}},showErrors:function(c,j){if(typeof(j)=="string"){a.skin.alert(c,"error",a.i18n.ERROR_OCCURED,j)}else{if(j instanceof Array){var f=j.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(c,"error",f,j)}else{b(".state-error",c).removeClass("state-error");f=j.error_header||(j.widgets&&(j.widgets.length>1)?a.i18n.ERRORS_OCCURED:a.i18n.ERROR_OCCURED);var k=new Array();var i;for(i in j.messages){if(!b.isNumeric(i)){continue}if(j.messages[i].header){k.push(""+j.messages[i].header+"
    "+j.messages[i].message)}else{k.push(j.messages[i].message||j.messages[i])}}for(i in j.widgets){if(!b.isNumeric(i)){continue}var d=j.widgets[i];var g=b('[name="'+d.name+'"]',c);g.parents("label:first").removeClassPrefix("state-").addClass("state-error").after(''+d.message+"");if(d.label){k.push(d.label+" : "+d.message)}var h=g.parents(".tab-pane").index()+1;if(h>0){var e=b(".nav-tabs",b(g).parents(".tabforms"));b("li:nth-child("+h+")",e).removeClassPrefix("state-").addClass("state-error");b("li.state-error:first a",c).click()}}a.skin.alert(c,j.error_level||"error",f,k,j.error_message)}}}};MyAMS.dialog={_hide_callbacks:[],registerHideCallback:function(d){var c=a.dialog._hide_callbacks;if(c.indexOf(d)<0){c.push(d)}},open:function(d,c){a.ajax.check(b.fn.modalmanager,a.baseURL+"ext/bootstrap-modalmanager"+a.devext+".js",function(){a.ajax.check(b.fn.modal.defaults,a.baseURL+"ext/bootstrap-modal"+a.devext+".js",function(h){if(h){b(document).off("click.modal");b.fn.modal.defaults.spinner=b.fn.modalmanager.defaults.spinner='
    '}if(typeof(d)=="string"){var g={};var f=d}else{g=d.data();f=d.attr("href")||g.amsUrl;var e=a.getFunctionByName(f);if(typeof(e)=="function"){f=e.call(d)}}if(!f){return}b("body").modalmanager("loading");if(f.indexOf("#")==0){b(f).modal("show")}else{b.ajax({url:f,type:"get",cache:g.amsAllowCache===undefined?false:g.amsAllowCache,data:c,success:function(l,k,j){b("body").modalmanager("removeLoading");var m=a.ajax.getResponse(j);var r=m.content_type;var s=m.data;switch(r){case"json":a.ajax.handleJSON(s,b(b(d).data("ams-json-target")||"#content"));break;case"script":break;case"xml":break;case"html":case"text":default:var n=b(s);var p=b(".modal-dialog",n.wrap("
    ").parent());var o=p.data();var q={overflow:o.amsModalOverflow||".modal-viewport",maxHeight:o.amsModalMaxHeight===undefined?function(){return b(window).height()-b(".modal-header",n).outerHeight(true)-b("footer",n).outerHeight(true)-85}:a.getFunctionByName(o.amsModalMaxHeight)};var i=b.extend({},q,o.amsModalOptions);i=a.executeFunctionByName(o.amsModalInitCallback,p,i)||i;b("
    ").addClass("modal fade").append(n).modal(i).on("shown",a.dialog.shown).on("hidden",a.dialog.hidden);a.initContent(n)}}})}})})},shown:function(i){function h(k){var l=b(".scrollmarker.top",c);var j=c.scrollTop();if(j>0){l.show()}else{l.hide()}var e=b(".scrollmarker.bottom",c);if(f+j>=c.get(0).scrollHeight){e.hide()}else{e.show()}}var g=i.target;var c=b(".modal-viewport",g);if(c.length==0){return}var f=parseInt(c.css("max-height"));var d=b.scrollbarWidth();if(c.height()==f){b("
    ").addClass("scrollmarker").addClass("top").css("top",0).css("width",c.width()-d).hide().appendTo(c);b("
    ").addClass("scrollmarker").addClass("bottom").css("top",f-20).css("width",c.width()-d).appendTo(c);c.scroll(h);c.off("resize").on("resize",h)}else{b(".scrollmarker",c).remove()}},close:function(d){var e=d.parents(".modal").data("modal");if(e){var c=b("body").data("modalmanager");if(c&&(c.getOpenModals().indexOf(e)>=0)){e.hide()}}},hidden:function(g){var f=g.target;a.skin.cleanContainer(f);var d=a.dialog._hide_callbacks;for(var c in d){d[c].call(f)}}};MyAMS.helpers={select2ClearSelection:function(){var d=b(this);var c=d.parents("label");var e=d.data("ams-select2-target");b('[name="'+e+'"]',c).data("select2").val("")},select2FormatSelection:function(d,c){if(d instanceof Array){b(d).each(function(){if(typeof(this)=="object"){c.append(this.text)}else{c.append(this)}})}else{if(typeof(d)=="object"){c.append(d.text)}else{c.append(d)}}},select2QueryUrlResultsCallback:function(e,d,c){switch(e.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"

    "+e.error_message+"

    ",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":b(this).data("select2").dropdown.hide();a.dialog.open(result.location);break;default:return{results:e.results||e,more:e.has_more||false,context:e.context}}},select2QueryMethodSuccessCallback:function(g,d,f){var c=g.result;if(typeof(c)=="string"){try{c=JSON.parse(c)}catch(h){}}switch(c.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"

    "+c.error_message+"

    ",icon:"fa fa-warning animated shake",timeout:10000});break;case"modal":b(this).data("select2").dropdown.hide();a.dialog.open(c.location);break;default:f.callback({results:c.results||c,more:c.has_more||false,context:c.context})}},contextMenuHandler:function(f,g){var c=g.data();if(c.toggle=="modal"){a.dialog.open(g)}else{var d=g.attr("href")||c.amsUrl;if(!d||d.startsWith("javascript:")||g.attr("target")){return}a.event.stop();var e=a.getFunctionByName(d);if(typeof(e)=="function"){d=e.call(g,f)}if(typeof(d)=="function"){d.call(g,f)}else{d=d.replace(/\%23/,"#");var f=g.data("ams-target");if(f){a.form.confirmChangedForm(f,function(){a.skin.loadURL(d,f,g.data("ams-link-options"),g.data("ams-link-callback"))})}else{a.form.confirmChangedForm(function(){if(d.startsWith("#")){if(d!=location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=d},150)}else{window.location.hash=d}}}else{window.location=d}})}}}},datetimepickerDialogHiddenCallback:function(){b(".datepicker, .timepicker, .datetimepicker",this).datetimepicker("destroy")}};MyAMS.plugins={init:function(e){a.plugins.initData(e);var f=new Array();b("[data-ams-plugins-disabled]",e).each(function(){var h=b(this).data("ams-plugins-disabled").split(/\s+/);for(var i in h){f.push(h[i])}});var d;b("[data-ams-plugins]",e).each(function(){var l=b(this);var h={};if(typeof(l.data("ams-plugins"))==="string"){var m=l.data("ams-plugins").split(/\s+/);for(var j in m){d=m[j];var i={src:l.data("ams-plugin-"+d+"-src"),css:l.data("ams-plugin-"+d+"-css"),callback:l.data("ams-plugin-"+d+"-callback"),register:l.data("ams-plugin-"+d+"-register"),async:l.data("ams-plugin-"+d+"-async")};h[d]=i}}else{h=l.data("ams-plugins")}for(d in h){if(a.plugins.enabled[d]===undefined){var k=h[d];a.getScript(k.src,function(){var p=k.callback;if(p){var o=a.getFunctionByName(p);if(k.register!==false){a.plugins.enabled[d]=o}}else{if(k.register!==false){a.plugins.enabled[d]=null}}var n=k.css;if(n){a.getCSS(n,d+"_css")}},{async:k.async===undefined?true:k.async})}}});for(var c in a.plugins.enabled){if(f.indexOf(c)>=0){continue}var g=a.plugins.enabled[c];if(typeof(g)=="function"){g(e)}}},initData:function(c){b("[data-ams-data]",c).each(function(){var e=b(this);var f=e.data("ams-data");for(var d in f){e.attr("data-"+d,f[d])}})},register:function(d,c,f){if(typeof(c)=="function"){f=c;c=null}c=c||d.name;if(a.plugins.enabled.indexOf(c)>=0){if(window.console){console.warn("Plugin "+c+" is already registered!")}return}if(typeof(d)=="object"){var e=d.src;if(e){a.ajax.check(d.callback,e,function(g){if(g){a.plugins.enabled[c]=a.getFunctionByName(d.callback);if(d.css){a.getCSS(d.css,c+"_css")}if(f){a.executeFunctionByName(f)}}})}else{a.plugins.enabled[c]=a.getFunctionByName(d.callback);if(d.css){a.getCSS(d.css,c+"_css")}if(f){a.executeFunctionByName(f)}}}else{if(typeof(d)=="function"){a.plugins.enabled[c]=d;if(f){a.executeFunctionByName(f)}}}},enabled:{hint:function(c){var d=b(".hint:not(:parents(.nohints))",c);if(d.length>0){a.ajax.check(b.fn.tipsy,a.baseURL+"ext/jquery-tipsy"+a.devext+".js",function(){a.getCSS(a.baseURL+"../css/ext/jquery-tipsy"+a.devext+".css","jquery-tipsy");d.each(function(){var i=b(this);var h=i.data();var f={html:h.amsHintHtml,title:a.getFunctionByName(h.amsHintTitleGetter)||function(){var j=b(this);return j.attr("original-title")||j.attr(h.amsHintTitleAttr||"title")||(h.amsHintHtml?j.html():j.text())},opacity:h.amsHintOpacity||0.95,gravity:h.amsHintGravity||"sw",offset:h.amsHintOffset||0};var e=b.extend({},f,h.amsHintOptions);e=a.executeFunctionByName(h.amsHintInitCallback,i,e)||e;var g=i.tipsy(e);a.executeFunctionByName(h.amsHintAfterInitCallback,i,g,e)})})}},contextMenu:function(c){var d=b(".context-menu",c);if(d.length>0){d.each(function(){var i=b(this);var h=i.data();var f={menuSelector:h.amsContextmenuSelector,menuSelected:a.helpers.contextMenuHandler};var e=b.extend({},f,h.amsContextmenuOptions);e=a.executeFunctionByName(h.amsContextmenuInitCallback,i,e)||e;var g=i.contextMenu(e);a.executeFunctionByName(h.amsContextmenuAfterInitCallback,i,g,e)})}},switcher:function(c){b("LEGEND.switcher",c).each(function(){var e=b(this);var d=e.parent("fieldset");var f=e.data();if(!f.amsSwitcher){b('').prependTo(b(this)).addClass(f.amsSwitcherState=="open"?(f.amsSwitcherMinusClass||"fa-minus"):(f.amsSwitcherPlusClass||"fa-plus"));e.on("click",function(h){h.preventDefault();var g={};e.trigger("ams.switcher.before-switch",[e,g]);if(g.veto){return}if(d.hasClass("switched")){d.removeClass("switched");b(".fa",e).removeClass(f.amsSwitcherPlusClass||"fa-plus").addClass(f.amsSwitcherMinusClass||"fa-minus");e.trigger("ams.switcher.opened",[e]);var i=e.attr("id");if(i){b('legend.switcher[data-ams-switcher-sync="'+i+'"]',d).each(function(){var j=b(this);if(j.parents("fieldset").hasClass("switched")){j.click()}})}}else{d.addClass("switched");b(".fa",e).removeClass(f.amsSwitcherMinusClass||"fa-minus").addClass(f.amsSwitcherPlusClass||"fa-plus");e.trigger("ams.switcher.closed",[e])}});if(f.amsSwitcherState!="open"){d.addClass("switched")}e.data("ams-switcher","on")}})},checker:function(c){b("LEGEND.checker",c).each(function(){var o=b(this);var p=o.parent("fieldset");var f=o.data();if(!f.amsChecker){var d=b('');var i=f.amsCheckerFieldname||("checker_"+a.generateId());var m=i.replace(/\./,"_");var g=f.amsCheckerHiddenPrefix;var h=null;var l=f.amsCheckerHiddenValueOn||"true";var j=f.amsCheckerHiddenValueOff||"false";var e=f.amsCheckerMarker||false;if(g){h=b('').attr("name",g+i).val(f.amsCheckerState=="on"?l:j).prependTo(o)}else{if(e){b('').attr("name",e).attr("value",1).prependTo(o)}}var n=b('').attr("name",i).attr("id",m).data("ams-checker-hidden-input",h).data("ams-checker-init",true).val(f.amsCheckerValue||true).attr("checked",f.amsCheckerState=="on"?"checked":null);if(f.amsCheckerReadonly){n.attr("disabled","disabled")}else{n.on("change",function(s){s.preventDefault();var q={};var t=b(this).is(":checked");o.trigger("ams.checker.before-switch",[o,q]);if(q.veto){b(this).prop("checked",!t);return}a.executeFunctionByName(f.amsCheckerChangeHandler,o,t);if(!f.amsCheckerCancelDefault){var r=n.data("ams-checker-hidden-input");if(t){if(f.amsCheckerMode=="disable"){p.removeAttr("disabled")}else{p.removeClass("switched")}if(r){r.val(l)}b("[data-required]",p).attr("required","required");o.trigger("ams.checker.opened",[o])}else{if(f.amsCheckerMode=="disable"){p.prop("disabled","disabled")}else{p.addClass("switched")}if(r){r.val(j)}b("[data-required]",p).removeAttr("required");o.trigger("ams.checker.closed",[o])}}})}n.appendTo(d);b(">label",o).attr("for",n.attr("id"));d.append("").prependTo(o);var k=b("[required]",p);k.attr("data-required",true);if(f.amsCheckerState=="on"){n.attr("checked",true)}else{if(f.amsCheckerMode=="disable"){p.attr("disabled","disabled")}else{p.addClass("switched")}k.removeAttr("required")}o.data("ams-checker","on")}})},slider:function(c){var d=b(".slider",c);if(d.length>0){a.ajax.check(b.fn.slider,a.baseURL+"ext/bootstrap-slider.min.js",function(){d.each(function(){var h=b(this);var i=h.data();var f={};var e=b.extend({},f,h.data.amsSliderOptions);e=a.executeFunctionByName(i.amsSliderInitCallback,h,e)||e;var g=h.slider(e);a.executeFunctionByName(i.amsSliderAfterInitCallback,h,g,e)})})}},draggable:function(d){var c=b(".draggable",d);if(c.length>0){c.each(function(){var e=b(this);var i=e.data();var g={containment:i.amsDraggableContainment,helper:a.getFunctionByName(i.amsDraggableHelper)||i.amsDraggableHelper,start:a.getFunctionByName(i.amsDraggableStart),stop:a.getFunctionByName(i.amsDraggableStop)};var f=b.extend({},g,i.amsDraggableOptions);f=a.executeFunctionByName(i.amsDraggableInitCallback,e,f)||f;var h=e.draggable(f);e.disableSelection();a.executeFunctionByName(i.amsDraggableAfterInitCallback,e,h,f)})}},sortable:function(c){var d=b(".sortable",c);if(d.length>0){d.each(function(){var i=b(this);var h=i.data();var f={items:h.amsSortableItems,handle:h.amsSortableHandle,connectWith:h.amsSortableConnectwith,start:a.getFunctionByName(h.amsSortableStart),over:a.getFunctionByName(h.amsSortableOver),containment:h.amsSortableContainment,placeholder:h.amsSortablePlaceholder,stop:a.getFunctionByName(h.amsSortableStop)};var e=b.extend({},f,h.amsSortableOptions);e=a.executeFunctionByName(h.amsSortableInitCallback,i,e)||e;var g=i.sortable(e);i.disableSelection();a.executeFunctionByName(h.amsSortableAfterInitCallback,i,g,e)})}},resizable:function(d){var c=b(".resizable",d);if(c.length>0){c.each(function(){var e=b(this);var i=e.data();var g={autoHide:i.amsResizableAutohide===false?true:i.amsResizableAutohide,containment:i.amsResizableContainment,grid:i.amsResizableGrid,handles:i.amsResizableHandles,start:a.getFunctionByName(i.amsResizableStart),stop:a.getFunctionByName(i.amsResizableStop)};var f=b.extend({},g,i.amsResizableOptions);f=a.executeFunctionByName(i.amsResizableInitCallback,e,f)||f;var h=e.resizable(f);e.disableSelection();a.executeFunctionByName(i.amsResizableAfterInitCallback,e,h,f)})}},typeahead:function(d){var c=b(".typeahead",d);if(c.length>0){a.ajax.check(b.fn.typeahead,a.baseURL+"ext/jquery-typeahead"+a.devext+".js",function(){c.each(function(){var e=b(this);var i=e.data();var g={};var f=b.extend({},g,i.amsTypeaheadOptions);f=a.executeFunctionByName(i.amsTypeaheadInitCallback,e,f)||f;var h=e.typeahead(f);a.executeFunctionByName(i.amsTypeaheadAfterInitCallback,e,h,f)})})}},select2:function(d){var c=b(".select2",d);if(c.length>0){a.ajax.check(b.fn.select2,a.baseURL+"ext/jquery-select2-3.5.2"+a.devext+".js",function(){c.each(function(){var e=b(this);var j=e.data();var h={placeholder:j.amsSelect2Placeholder,multiple:j.amsSelect2Multiple,minimumInputLength:j.amsSelect2MinimumInputLength||0,maximumSelectionSize:j.amsSelect2MaximumSelectionSize,openOnEnter:j.amsSelect2EnterOpen===undefined?true:j.amsSelect2EnterOpen,allowClear:j.amsSelect2AllowClear===undefined?true:j.amsSelect2AllowClear,width:j.amsSelect2Width||"100%",initSelection:a.getFunctionByName(j.amsSelect2InitSelection),formatSelection:j.amsSelect2FormatSelection===undefined?a.helpers.select2FormatSelection:a.getFunctionByName(j.amsSelect2FormatSelection),formatResult:a.getFunctionByName(j.amsSelect2FormatResult),formatMatches:j.amsSelect2FormatMatches===undefined?function(k){if(k==1){return a.i18n.SELECT2_MATCH}else{return k+a.i18n.SELECT2_MATCHES}}:a.getFunctionByName(j.amsSelect2FormatMatches),formatNoMatches:j.amsSelect2FormatResult===undefined?function(k){return a.i18n.SELECT2_NOMATCHES}:a.getFunctionByName(j.amsSelect2FormatResult),formatInputTooShort:j.amsSelect2FormatInputTooShort===undefined?function(k,l){var m=l-k.length;return a.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooShort),formatInputTooLong:j.amsSelect2FormatInputTooLong===undefined?function(l,k){var m=l.length-k;return a.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooLong),formatSelectionTooBig:j.amsSelect2FormatSelectionTooBig===undefined?function(k){return a.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,k).replace(/\{1\}/,k==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatSelectionTooBig),formatLoadMore:j.amsSelect2FormatLoadMore===undefined?function(k){return a.i18n.SELECT2_LOADMORE}:a.getFunctionByName(j.amsSelect2FormatLoadMore),formatSearching:j.amsSelect2FormatSearching===undefined?function(){return a.i18n.SELECT2_SEARCHING}:a.getFunctionByName(j.amsSelect2FormatSearching),separator:j.amsSelect2Separator||",",tokenSeparators:j.amsSelect2TokensSeparators||[","],tokenizer:a.getFunctionByName(j.amsSelect2Tokenizer)};switch(e.context.type){case"text":case"hidden":if(!h.initSelection){var f=e.data("ams-select2-values");if(f){h.initSelection=function(k,m){var l=[];b(k.val().split(h.separator)).each(function(){l.push({id:this,text:f[this]||this})});m(l)}}}break;default:break}if(e.attr("readonly")){if(e.attr("type")=="hidden"){h.query=function(){return[]}}}else{if(j.amsSelect2Query){h.query=a.getFunctionByName(j.amsSelect2Query);h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryUrl){h.ajax={url:j.amsSelect2QueryUrl,quietMillis:j.amsSelect2QuietMillis||200,type:j.amsSelect2QueryType||"POST",dataType:j.amsSelect2QueryDatatype||"json",data:function(m,n,l){var k={};k[j.amsSelect2QueryParamName||"query"]=m;k[j.amsSelect2PageParamName||"page"]=n;k[j.amsSelect2ContextParamName||"context"]=l;return b.extend({},k,j.amsSelect2QueryOptions)},results:a.helpers.select2QueryUrlResultsCallback};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryMethod){h.query=function(k){var l={id:new Date().getTime(),params:j.amsSelect2QueryParams||{},success:function(m){return a.helpers.select2QueryMethodSuccessCallback.call(e,m,"success",k)},error:a.error.show};l.params[j.amsSelect2QueryParamName||"query"]=k.term;l.params[j.amsSelect2PageParamName||"page"]=k.page;l.params[j.amsSelect2ContextParamName||"context"]=k.context;l=b.extend({},l,j.amsSelect2QueryOptions);l=a.executeFunctionByName(j.amsSelect2QueryInitCallback,e,l)||l;a.ajax.check(b.jsonRPC,a.baseURL+"ext/jquery-jsonrpc"+a.devext+".js",function(){b.jsonRPC.withOptions({endPoint:j.amsSelect2MethodTarget||a.jsonrpc.getAddr(),namespace:j.amsSelect2MethodNamespace,cache:false},function(){b.jsonRPC.request(j.amsSelect2QueryMethod,l)})})};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2Tags){h.tags=j.amsSelect2Tags}else{if(j.amsSelect2Data){h.data=j.amsSelect2Data}}}}}}if(j.amsSelect2EnableFreeTags){h.createSearchChoice=function(k){return{id:k,text:(j.amsSelect2FreeTagsPrefix||a.i18n.SELECT2_FREETAG_PREFIX)+k}}}var g=b.extend({},h,j.amsSelect2Options);g=a.executeFunctionByName(j.amsSelect2InitCallback,e,g)||g;var i=e.select2(g);a.executeFunctionByName(j.amsSelect2AfterInitCallback,e,i,g);if(e.hasClass("ordered")){a.ajax.check(b.fn.select2Sortable,a.baseURL+"ext/jquery-select2-sortable"+a.devext+".js",function(){e.select2Sortable({bindOrder:"sortableStop"})})}e.on("change",function(){var k=b(e.get(0).form).data("validator");if(k!==undefined){b(e).valid()}})})})}},maskedit:function(d){var c=b("[data-mask]",d);if(c.length>0){a.ajax.check(b.fn.mask,a.baseURL+"ext/jquery-maskedinput-1.3.1.min.js",function(){c.each(function(){var e=b(this);var i=e.data();var g={placeholder:i.amsMaskeditPlaceholder||"X"};var f=b.extend({},g,i.amsMaskeditOptions);f=a.executeFunctionByName(i.amsMaskeditInitCallback,e,f)||f;var h=e.mask(e.attr("data-mask"),f);a.executeFunctionByName(i.amsMaskeditAfterInitCallback,e,h,f)})})}},datepicker:function(c){var d=b(".datepicker",c);if(d.length>0){a.ajax.check(b.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}d.each(function(){var f=b(this);var j=f.data();var h={lang:j.amsDatetimepickerLang||a.lang,format:j.amsDatetimepickerFormat||"d/m/y",datepicker:true,dayOfWeekStart:1,timepicker:false};var g=b.extend({},h,j.amsDatetimepickerOptions);g=a.executeFunctionByName(j.amsDatetimepickerInitCallback,f,g)||g;var i=f.datetimepicker(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},datetimepicker:function(d){var c=b(".datetimepicker",d);if(c.length>0){a.ajax.check(b.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}c.each(function(){var f=b(this);var j=f.data();var h={lang:j.amsDatetimepickerLang||a.lang,format:j.amsDatetimepickerFormat||"d/m/y H:i",datepicker:true,dayOfWeekStart:1,timepicker:true};var g=b.extend({},h,j.amsDatetimepickerOptions);g=a.executeFunctionByName(j.amsDatetimepickerInitCallback,f,g)||g;var i=f.datetimepicker(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},timepicker:function(d){var c=b(".timepicker",d);if(c.length>0){a.ajax.check(b.fn.datetimepicker,a.baseURL+"ext/jquery-datetimepicker"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-datetimepicker"+a.devext+".css","jquery-datetimepicker");a.dialog.registerHideCallback(a.helpers.datetimepickerDialogHiddenCallback)}c.each(function(){var f=b(this);var j=f.data();var h={lang:j.amsDatetimepickerLang||a.lang,format:j.amsDatetimepickerFormat||"H:i",datepicker:false,timepicker:true};var g=b.extend({},h,j.amsDatetimepickerOptions);g=a.executeFunctionByName(j.amsDatetimepickerInitCallback,f,g)||g;var i=f.datetimepicker(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},colorpicker:function(c){var d=b(".colorpicker",c);if(d.length>0){a.ajax.check(b.fn.minicolors,a.baseURL+"ext/jquery-minicolors"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-minicolors"+a.devext+".css","jquery-minicolors")}d.each(function(){var f=b(this);var j=f.data();var h={position:j.amsColorpickerPosition||f.closest("label.input").data("ams-colorpicker-position")||"bottom left"};var g=b.extend({},h,j.amsColorpickerOptions);g=a.executeFunctionByName(j.amsColorpickerInitCallback,f,g)||g;var i=f.minicolors(g);a.executeFunctionByName(j.amsDatetimepickerAfterInitCallback,f,i,g)})})}},validate:function(d){var c=b("FORM:not([novalidate])",d);if(c.length>0){a.ajax.check(b.fn.validate,a.baseURL+"ext/jquery-validate-1.11.1"+a.devext+".js",function(g){if(g){b.validator.setDefaults({highlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(i,j){var h=j.parents("label:first");if(h.length){i.insertAfter(h)}else{i.insertAfter(j)}}});if(a.plugins.i18n){for(var e in a.plugins.i18n.validate){var f=a.plugins.i18n.validate[e];if((typeof(f)=="string")&&(f.indexOf("{0}")>-1)){a.plugins.i18n.validate[e]=b.validator.format(f)}}b.extend(b.validator.messages,a.plugins.i18n.validate)}}c.each(function(){var k=b(this);var l=k.data();var i={ignore:null,submitHandler:k.attr("data-async")!==undefined?l.amsFormSubmitHandler===undefined?function(){b(".state-error",k).removeClass("state-error");a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+a.devext+".js");return a.form.submit(k)}:a.getFunctionByName(l.amsFormSubmitHandler):undefined,invalidHandler:k.attr("data-async")!==undefined?l.amsFormInvalidHandler===undefined?function(q,p){b(".state-error",k).removeClass("state-error");for(var n in p.errorList){var m=p.errorList[n];var o=b(m.element).parents(".tab-pane").index()+1;if(o>0){var r=b(".nav-tabs",b(m.element).parents(".tabforms"));b("li:nth-child("+o+")",r).removeClassPrefix("state-").addClass("state-error");b("li.state-error:first a",r).click()}}}:a.getFunctionByName(l.amsFormInvalidHandler):undefined};var h=b.extend({},i,l.amsValidateOptions);h=a.executeFunctionByName(l.amsValidateInitCallback,k,h)||h;var j=k.validate(h);a.executeFunctionByName(l.amsValidateAfterInitCallback,k,j,h)})})}},datatable:function(d){var c=b(".datatable",d);if(c.length>0){a.ajax.check(b.fn.dataTable,a.baseURL+"ext/jquery-dataTables-1.9.4"+a.devext+".js",function(e){if(e){b.fn.dataTableExt.oSort["numeric-comma-asc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((fi)?1:0))};b.fn.dataTableExt.oSort["numeric-comma-desc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((fi)?-1:0))}}b(c).each(function(){a.ajax.check(b.fn.dataTableExt.oPagination.bootstrap_full,a.baseURL+"myams-dataTables"+a.devext+".js");var u=b(this);var x=u.data();var w=(x.amsDatatableExtensions||"").split(/\s+/);var h=x.amsDatatableSdom||"W"+((w.indexOf("colreorder")>=0||w.indexOf("colreorderwithresize")>=0)?"R":"")+"<'dt-top-row'"+(w.indexOf("colvis")>=0?"C":"")+((x.amsDatatablePagination===false||x.amsDatatablePaginationSize===false)?"":"L")+(x.amsDatatableGlobalFilter===false?"":"F")+">r<'dt-wrapper't"+(w.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'"+(x.amsDatatableInformation===false?"":"i")+"><'col-sm-6 text-right'p>>";var r={bJQueryUI:false,bFilter:x.amsDatatableGlobalFilter!==false,bPaginate:x.amsDatatablePagination!==false,bInfo:x.amsDatatableInfo!==false,bSort:x.amsDatatableSort!==false,aaSorting:x.amsDatatableSorting,bDeferRender:true,bAutoWidth:false,iDisplayLength:x.amsDatatableDisplayLength||25,sPaginationType:x.amsDatatablePaginationType||"bootstrap_full",sDom:h,oLanguage:a.plugins.i18n.datatables,fnInitComplete:function(A,z){b(".ColVis_Button").addClass("btn btn-default btn-sm").html((a.plugins.i18n.datatables.sColumns||"Columns")+' ')}};var v=b.extend({},r,x.amsDatatableOptions);var j;if(w.length>0){for(j in w){switch(w[j]){case"autofill":a.ajax.check(b.fn.dataTable.AutoFill,a.baseURL+"ext/jquery-dataTables-autoFill"+a.devext+".js");break;case"columnfilter":a.ajax.check(b.fn.columnFilter,a.baseURL+"ext/jquery-dataTables-columnFilter"+a.devext+".js");break;case"colreorder":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorder"+a.devext+".js");break;case"colreorderwithresize":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorderWithResize"+a.devext+".js");break;case"colvis":a.ajax.check(b.fn.dataTable.ColVis,a.baseURL+"ext/jquery-dataTables-colVis"+a.devext+".js");var n={activate:"click",sAlign:"right"};v.oColVis=b.extend({},n,x.amsDatatableColvisOptions);break;case"editable":a.ajax.check(b.fn.editable,a.baseURL+"ext/jquery-jeditable"+a.devext+".js");a.ajax.check(b.fn.makeEditable,a.baseURL+"ext/jquery-dataTables-editable"+a.devext+".js");break;case"fixedcolumns":a.ajax.check(b.fn.dataTable.FixedColumns,a.baseURL+"ext/jquery-dataTables-fixedColumns"+a.devext+".js");break;case"fixedheader":a.ajax.check(b.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(b.fn.rowGrouping,a.baseURL+"ext/jquery-dataTables-rowGrouping"+a.devext+".js");break;case"rowreordering":a.ajax.check(b.fn.rowReordering,a.baseURL+"ext/jquery-dataTables-rowReordering"+a.devext+".js");break;case"scroller":a.ajax.check(b.fn.dataTable.Scroller,a.baseURL+"ext/jquery-dataTables-scroller"+a.devext+".js");break;default:break}}}v=a.executeFunctionByName(x.amsDatatableInitCallback,u,v)||v;var g=u.dataTable(v);a.executeFunctionByName(x.amsDatatableAfterInitCallback,u,g,v);if(w.length>0){for(j in w){switch(w[j]){case"autofill":var y=b.extend({},x.amsDatatableAutofillOptions,v.autofill);y=a.executeFunctionByName(x.amsDatatableAutofillInitCallback,u,y)||y;u.data("ams-autofill",x.amsDatatableAutofillConstructor===undefined?new b.fn.dataTable.AutoFill(u,y):a.executeFunctionByName(x.amsDatatableAutofillConstructor,u,g,y));break;case"columnfilter":var k={sPlaceHolder:"head:after"};var l=b.extend({},k,x.amsDatatableColumnfilterOptions,v.columnfilter);l=a.executeFunctionByName(x.amsDatatableColumnfilterInitCallback,u,l)||l;u.data("ams-columnfilter",x.amsDatatableColumnfilterConstructor===undefined?g.columnFilter(l):a.executeFunctionByName(x.amsDatatableColumnfilterConstructor,u,g,l));break;case"editable":var m=b.extend({},x.amsDatatableEditableOptions,v.editable);m=a.executeFunctionByName(x.amsDatatableEditableInitCallback,u,m)||m;u.data("ams-editable",x.amsDatatableEditableConstructor===undefined?u.makeEditable(m):a.executeFunctionByName(x.amsDatatableEditableConstructor,u,g,m));break;case"fixedcolumns":var f=b.extend({},x.amsDatatableFixedcolumnsOptions,v.fixedcolumns);f=a.executeFunctionByName(x.amsDatatableFixedcolumnsInitCallback,u,f)||f;u.data("ams-fixedcolumns",x.amsDatatableFixedcolumnsConstructor===undefined?new b.fn.dataTable.FixedColumns(u,f):a.executeFunctionByName(x.amsDatatableFixedcolumnsConstructor,u,g,f));break;case"fixedheader":var s=b.extend({},x.amsDatatableFixedheaderOptions,v.fixedheader);s=a.executeFunctionByName(x.amsDatatableFixedheadeInitCallback,u,s)||s;u.data("ams-fixedheader",x.amsDatatableFixedheaderConstructor===undefined?new b.fn.dataTable.FixedHeader(u,s):a.executeFunctionByName(x.amsDatatableFixedheaderConstructor,u,g,s));break;case"keytable":var i={table:u.get(0),datatable:g};var q=b.extend({},i,x.amsDatatableKeytableOptions,v.keytable);q=a.executeFunctionByName(x.amsDatatableKeytableInitCallback,u,q)||q;u.data("ams-keytable",x.amsDatatableKeytableConstructor===undefined?new KeyTable(q):a.executeFunctionByName(x.amsDatatableKeytableConstructor,u,g,q));break;case"rowgrouping":var p=b.extend({},x.amsDatatableRowgroupingOptions,v.rowgrouping);p=a.executeFunctionByName(x.amsDatatableRowgroupingInitCallback,u,p)||p;u.data("ams-rowgrouping",x.amsDatatableRowgroupingConstructor===undefined?u.rowGrouping(p):a.executeFunctionByName(x.amsDatatableRowgroupingConstructor,u,g,p));break;case"rowreordering":var o=b.extend({},x.amsDatatableRowreorderingOptions,v.rowreordering);o=a.executeFunctionByName(x.amsDatatableRowreorderingInitCallback,u,o)||o;u.data("ams-rowreordering",x.amsDatatableRowreorderingConstructor===undefined?u.rowReordering(o):a.executeFunctionByName(x.amsDatatableRowreorderingConstructor,u,g,o));break;default:break}}}var t=(x.amsDatatableFinalizeCallback||"").split(/\s+/);if(t.length>0){for(j in t){a.executeFunctionByName(t[j],u,g,v)}}})})}},tablednd:function(d){var c=b(".table-dnd",d);if(c.length>0){a.ajax.check(b.fn.tableDnD,a.baseURL+"ext/jquery-tablednd"+a.devext+".js",function(e){c.each(function(){var i=b(this);b(i).on("mouseover","tr",function(){b(this.cells[0]).addClass("drag-handle")}).on("mouseout","tr",function(){b(this.cells[0]).removeClass("drag-handle")});var j=i.data();var g={onDragClass:j.amsTabledndDragClass||"dragging-row",onDragStart:j.amsTabledndDragStart,dragHandle:j.amsTabledndDragHandle,scrollAmount:j.amsTabledndScrollAmount,onAllowDrop:j.amsTabledndAllowDrop,onDrop:j.amsTabledndDrop||function(m,o){var l=j.amsTabledndDropTarget;if(l){var k=[];b(m.rows).each(function(){var p=b(this).data("ams-element-name");if(p){k.push(p)}});var n=a.getFunctionByName(l);if(typeof(n)=="function"){n.call(i,m,k)}else{a.ajax.post(l,{names:JSON.stringify(k)})}}return false}};var f=b.extend({},g,j.amsTabledndOptions);f=a.executeFunctionByName(j.amsTabledndInitCallback,i,f)||f;var h=i.tableDnD(f);a.executeFunctionByName(j.amsTabledndAfterInitCallback,i,h,f)})})}},tinymce:function(c){function f(){b(".tinymce",b(this)).each(function(){var g=tinymce.get(b(this).attr("id"));if(g){g.remove()}})}var d=b(".tinymce",c);if(d.length>0){var e=a.baseURL+"ext/tinymce"+(a.devmode?"/dev":"");a.ajax.check(window.tinymce,e+"/tinymce"+a.devext+".js",function(g){if(g){a.getScript(e+"/jquery.tinymce"+a.devext+".js");tinymce.baseURL=e;tinymce.suffix=a.devext;a.skin.registerCleanCallback(f)}d.each(function(){var k=b(this);var n=k.data();var j={theme:"modern",language:a.lang,plugins:["advlist autosave autolink lists link image charmap print preview hr anchor pagebreak","searchreplace wordcount visualblocks visualchars code fullscreen","insertdatetime media nonbreaking save table contextmenu directionality","emoticons paste textcolor colorpicker textpattern"],toolbar1:"newdocument undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",toolbar2:"print preview media | forecolor backcolor emoticons | code fullscreen",content_css:n.amsTinymceContentCss,formats:n.amsTinymceFormats,style_formats:n.amsTinymceStyleFormats,block_formats:n.amsTinymceBlockFormats,valid_classes:n.amsTinymceValidClasses,image_advtab:true,image_list:a.getFunctionByName(n.amsTinymceImageList)||n.amsTinymceImageList,image_class_list:n.amsTinymceImageClassList,link_list:a.getFunctionByName(n.amsTinymceLinkList)||n.amsTinymceLinkList,link_class_list:n.amsTinymceLinkClassList,resize:true};if(n.amsTinymceExternalPlugins){var o=n.amsTinymceExternalPlugins.split(/\s+/);for(var h in o){var m=k.data("ams-tinymce-plugin-"+o[h]);tinymce.PluginManager.load(o[h],a.getSource(m))}}var i=b.extend({},j,n.amsTinymceOptions);i=a.executeFunctionByName(n.amsTinymceInitCallback,k,i)||i;var l=k.tinymce(i);a.executeFunctionByName(n.amsTinymceAfterInitCallback,k,l,i)})})}},imgareaselect:function(d){var c=b(".imgareaselect",d);if(c.length>0){a.ajax.check(b.fn.imgAreaSelect,a.baseURL+"ext/jquery-imgareaselect-0.9.10"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-imgareaselect"+a.devext+".css")}c.each(function(){var k=b(this);var j=k.data();var h=j.amsImgareaselectParent?k.parents(j.amsImgareaselectParent):"body";var g={instance:true,handles:true,parent:h,x1:j.amsImgareaselectX1||0,y1:j.amsImgareaselectY1||0,x2:j.amsImgareaselectX2||j.amsImgareaselectImageWidth,y2:j.amsImgareaselectY2||j.amsImgareaselectImageHeight,imageWidth:j.amsImgareaselectImageWidth,imageHeight:j.amsImgareaselectImageHeight,minWidth:128,minHeight:128,aspectRatio:j.amsImgareaselectRatio,onSelectEnd:a.getFunctionByName(j.amsImgareaselectSelectEnd)||function(l,m){var n=j.amsImgareaselectTargetField||"image_";b('input[name="'+n+'x1"]',h).val(m.x1);b('input[name="'+n+'y1"]',h).val(m.y1);b('input[name="'+n+'x2"]',h).val(m.x2);b('input[name="'+n+'y2"]',h).val(m.y2)}};var f=b.extend({},g,j.amsImgareaselectOptions);f=a.executeFunctionByName(j.amsImgareaselectInitCallback,k,f)||f;var i=k.imgAreaSelect(f);a.executeFunctionByName(j.amsImgareaselectAfterInitCallback,k,i,f);setTimeout(function(){i.update()},250)})})}},fancybox:function(c){var d=b(".fancybox",c);if(d.length>0){a.ajax.check(b.fn.fancybox,a.baseURL+"ext/jquery-fancybox-2.1.5"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-fancybox-2.1.5"+a.devext+".css")}d.each(function(){var f=b(this);var m=f.data();var l=(m.amsFancyboxHelpers||"").split(/\s+/);if(l.length>0){for(var g in l){var k=l[g];switch(k){case"buttons":a.ajax.check(b.fancybox.helpers.buttons,a.baseURL+"ext/fancybox-helpers/fancybox-buttons"+a.devext+".js");break;case"thumbs":a.ajax.check(b.fancybox.helpers.thumbs,a.baseURL+"ext/fancybox-helpers/fancybox-thumbs"+a.devext+".js");break;case"media":a.ajax.check(b.fancybox.helpers.media,a.baseURL+"ext/fancybox-helpers/fancybox-media"+a.devext+".js");break;default:break}}}var i={type:m.amsFancyboxType,padding:m.amsFancyboxPadding||10,margin:m.amsFancyboxMargin||10,beforeLoad:a.getFunctionByName(m.amsFancyboxBeforeLoad)||function(){this.title=a.executeFunctionByName(m.amsFancyboxTitleGetter,this)||b(this.element).attr("original-title")||b(this.element).attr("title")},helpers:{title:{type:"inside"}}};var h=b.extend({},i,m.amsFancyboxOptions);h=a.executeFunctionByName(m.amsFancyboxInitCallback,f,h)||h;var j=f.fancybox(h);a.executeFunctionByName(m.amsFancyboxAfterInitCallback,f,j,h)})})}},graphs:function(d){var c=b(".sparkline",d);if(c.length>0){a.ajax.check(a.graphs,a.baseURL+"myams-graphs"+a.devext+".js",function(){a.graphs.init(c)})}},scrollbars:function(c){var d=b(".scrollbar",c);if(d.length>0){a.ajax.check(b.event.special.mousewheel,a.baseURL+"ext/jquery-mousewheel.min.js",function(){a.ajax.check(b.fn.mCustomScrollbar,a.baseURL+"ext/jquery-mCustomScrollbar"+a.devext+".js",function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar")}d.each(function(){var j=b(this);var i=j.data();var g={theme:i.amsScrollbarTheme||"light"};var f=b.extend({},g,i.amsScrollbarOptions);f=a.executeFunctionByName(i.amsScrollbarInitCallback,j,f)||f;var h=j.mCustomScrollbar(f);a.executeFunctionByName(i.amsScrollbarAfterInitCallback,j,h,f)})})})}}}};MyAMS.callbacks={init:function(c){b("[data-ams-callback]",c).each(function(){var d=this;var e=b(d).data();var f=a.getFunctionByName(e.amsCallback);if(f===undefined){if(e.amsCallbackSource){a.getScript(e.amsCallbackSource,function(){a.executeFunctionByName(e.amsCallback,d,e.amsCallbackOptions)})}else{if(window.console){console.warn("Undefined callback: "+e.amsCallback)}}}else{f.call(d,e.amsCallbackOptions)}})},alert:function(k){var f=b(this).data();var c=b.extend({},k,f.amsAlertOptions);var i=b(f.amsAlertParent||c.parent||this);var e=f.amsAlertStatus||c.status||"info";var g=f.amsAlertHeader||c.header;var j=f.amsAlertMessage||c.message;var h=f.amsAlertSubtitle||c.subtitle;var d=f.amsAlertMargin===undefined?(c.margin===undefined?false:c.margin):f.amsAlertMargin;a.skin.alert(i,e,g,j,h,d)},messageBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsMessageboxOptions);var e=b.extend({},f,{title:g.amsMessageboxTitle||f.title||"",content:g.amsMessageboxContent||f.content||"",icon:g.amsMessageboxIcon||f.icon,number:g.amsMessageboxNumber||f.number,timeout:g.amsMessageboxTimeout||f.timeout});var c=g.amsMessageboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsMessageboxCallback||f.callback);a.skin.messageBox(c,e,h)},smallBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsSmallboxOptions);var e=b.extend({},f,{title:g.amsSmallboxTitle||f.title||"",content:g.amsSmallboxContent||f.content||"",icon:g.amsSmallboxIcon||f.icon,iconSmall:g.amsSmallboxIconSmall||f.iconSmall,timeout:g.amsSmallboxTimeout||f.timeout});var c=g.amsSmallboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsSmallboxCallback||f.callback);a.skin.smallBox(c,e,h)}};MyAMS.events={init:function(c){b("[data-ams-events-handlers]",c).each(function(){var e=b(this);var d=e.data("ams-events-handlers");for(var f in d){e.on(f,a.getFunctionByName(d[f]))}})}};MyAMS.container={changeOrder:function(d,e){var c=b('input[name="'+b(this).data("ams-input-name")+'"]',b(this));c.val(e.join(";"))},deleteElement:function(c){return function(){var d=b(this);MyAMS.skin.bigBox({title:a.i18n.WARNING,content:'  '+a.i18n.DELETE_WARNING,buttons:a.i18n.BTN_OK_CANCEL},function(g){if(g==a.i18n.BTN_OK){var i=d.parents("table");var f=i.data("ams-location")||"";var j=d.parents("tr");var h=j.data("ams-delete-target")||i.data("ams-delete-target")||"delete-element.json";var e=j.data("ams-element-name");MyAMS.ajax.post(f+"/"+h,{object_name:e},function(k,l){if(k.status=="success"){if(i.hasClass("datatable")){i.dataTable().fnDeleteRow(j[0])}else{j.remove()}}})}})}}};MyAMS.skin={_setPageHeight:function(){var e=b("#main").height();var c=a.left_panel.height();var d=b(window).height()-a.navbar_height;if(e>d){a.left_panel.css("min-height",e);a.root.css("min-height",e+a.navbar_height)}else{a.left_panel.css("min-height",d);a.root.css("min-height",d)}},_checkMobileWidth:function(){if(b(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(){$this=b("#activity > .badge");if(parseInt($this.text())>0){$this.removeClass("hidden").addClass("bg-color-red bounceIn animated")}else{$this.addClass("hidden").removeClass("bg-color-red bounceIn animated")}},_initDesktopWidgets:function(c){if(a.enable_widgets){var d=b(".ams-widget",c);if(d.length>0){a.ajax.check(b.fn.MyAMSWidget,a.baseURL+"myams-widgets"+a.devext+".js",function(){d.each(function(){var h=b(this);var g=h.data();var f={deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"};var e=b.extend({},f,g.amsWidgetOptions);e=a.executeFunctionByName(g.amsWidgetInitcallback,h,e)||e;h.MyAMSWidget(e)});MyAMSWidget.initWidgetsGrid(b(".ams-widget-grid",c))})}}},_initMobileWidgets:function(c){if(a.enable_mobile&&a.enable_widgets){a.skin._initDesktopWidgets(c)}},alert:function(j,d,e,k,i,c){b(".alert",j).remove();if(d=="error"){d="danger"}var g='

    '+e+"

    "+(i?("

    "+i+"

    "):"");if(typeof(k)=="string"){g+="
    • "+k+"
    "}else{if(k){g+="
      ";for(var f in k){if(!b.isNumeric(f)){continue}g+="
    • "+k[f]+"
    • "}g+="
    "}}g+="
    ";var h=b(g).prependTo(j);if(j.exists){a.ajax.check(b.scrollTo,a.baseURL+"ext/jquery-scrollTo.min.js",function(){b.scrollTo(j,{offset:{top:-50}})})}},bigBox:function(c,d){a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){a.notify.messageBox(c,d)})},messageBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.bigBox(d,e)})},smallBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+a.devext+".js",function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.smallBox(d,e)})},_drawBreadCrumb:function(){var c=b("#ribbon OL.breadcrumb");c.empty().append(b("
  • ").append(b("").text(a.i18n.HOME).attr("href",b('nav a[href!="#"]:first').attr("href"))));b("nav LI.active >A").each(function(){var f=b(this);var d=b.trim(f.clone().children(".badge").remove().end().text());var e=b("
  • ").append(f.attr("href").replace(/^#/,"")?b("").html(d).attr("href",f.attr("href")):d);c.append(e)})},checkURL:function(){function c(i){b("nav .active").removeClass("active");i.addClass("open").addClass("active");i.parents("li").addClass("open active").children("ul").addClass("active").show();i.parents("li:first").removeClass("open");i.parents("ul").addClass(i.attr("href").replace(/^#/,"")?"active":"").show()}var f=location.hash;var e=f.replace(/^#/,"");if(e){var d=b("#content");if(!d.exists()){d=b("body")}var g=b('nav A[href="'+f+'"]');if(g.exists()){c(g)}a.skin.loadURL(e,d);document.title=b("[data-ams-page-title]:first",d).data("ams-page-title")||g.attr("title")||document.title}else{var h=b("[data-ams-active-menu]").data("ams-active-menu");if(h){g=b('nav A[href="'+h+'"]')}else{g=b('nav >UL >LI >A[href!="#"]').first()}if(g.exists()){c(g);if(h){a.skin._drawBreadCrumb()}else{window.location.hash=g.attr("href")}}}},_clean_callbacks:[],registerCleanCallback:function(d){var c=a.skin._clean_callbacks;if(c.indexOf(d)<0){c.push(d)}},cleanContainer:function(c){var e=a.skin._clean_callbacks;for(var d in e){e[d].call(c)}},loadURL:function(e,c,d,h){if(e.startsWith("#")){e=e.substr(1)}if(typeof(d)=="function"){h=d;d={}}c=b(c);var g={type:"GET",url:e,dataType:"html",cache:false,beforeSend:function(){a.skin.cleanContainer(c);c.html('

    Loading...

    ');if(c[0]==b("#content")[0]){a.skin._drawBreadCrumb();document.title=b(".breadcrumb LI:last-child").text();b("html, body").animate({scrollTop:0},"fast")}else{c.animate({scrollTop:0},"fast")}},success:function(m,j,l){if(h){a.executeFunctionByName(h,this,m,j,l,d)}else{var k=a.ajax.getResponse(l);var n=k.content_type;var i=k.data;b(".loading",c).remove();switch(n){case"json":a.ajax.handleJSON(i,c);break;case"script":break;case"xml":break;case"html":case"text":default:c.parents(".hidden").removeClass("hidden");b(".alert",c.parents(".alerts-container")).remove();c.css({opacity:"0.0"}).html(m).removeClass("hidden").delay(50).animate({opacity:"1.0"},300);a.initContent(c)}if(d&&d.afterLoadCallback){a.executeFunctionByName(d.afterLoadCallback,this)}}},error:function(k,j,i){c.html('

    '+a.i18n.ERROR+i+"

    "+k.responseText)},async:false};var f=b.extend({},g,d);b.ajax(f)},setLanguage:function(d){var f=d.lang;var e=d.handler_type||"json";switch(e){case"json":var g=d.method||"setUserLanguage";a.jsonrpc.post(g,{lang:f},function(){window.location.reload(true)});break;case"ajax":var c=d.href||"setUserLanguage";a.ajax.post(c,{lang:f},function(){window.location.reload(true)});break}},logout:function(){window.location=a.loginURL}};MyAMS.initPage=function(){var c=b("body");a.root=c;a.left_panel=b("#left-panel");a.shortcuts=b("#shortcut");a.plugins.initData(c);var d=b.ajaxSettings.xhr;b.ajaxSetup({progress:a.ajax.progress,progressUpload:a.ajax.progress,xhr:function(){var f=d();if(f&&(typeof(f.addEventListener)=="function")){var e=this;f.addEventListener("progress",function(g){e.progress(g)},false)}return f}});b(document).ajaxStart(a.ajax.start);b(document).ajaxStop(a.ajax.stop);b(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.enable_fastclick){a.ajax.check(b.fn.noClickDelay,a.baseURL+"/ext/jquery-smartclick"+a.devext+".js",function(){b("NAV UL A").noClickDelay();b("#hide-menu A").noClickDelay()})}}b("#hide-menu >:first-child > A").click(function(f){c.toggleClass("hidden-menu");f.preventDefault()});b("#show-shortcut").click(function(f){if(a.shortcuts.is(":visible")){a.skin._hideShortcutButtons()}else{a.skin._showShortcutButtons()}f.preventDefault()});a.shortcuts.click(function(f){a.skin._hideShortcutButtons()});b(document).mouseup(function(f){if(!a.shortcuts.is(f.target)&&a.shortcuts.has(f.target).length===0){a.skin._hideShortcutButtons()}});b("#search-mobile").click(function(){a.root.addClass("search-mobile")});b("#cancel-search-js").click(function(){a.root.removeClass("search-mobile")});b("#activity").click(function(g){var f=b(this);var h=f.next(".ajax-dropdown");if(!h.is(":visible")){h.css("left",f.position().left-h.innerWidth()/2+f.innerWidth()/2).fadeIn(150);f.addClass("active")}else{h.fadeOut(150);f.removeClass("active")}g.preventDefault()});a.skin.checkNotification();b(document).mouseup(function(f){var g=b(".ajax-dropdown");if(!g.is(f.target)&&g.has(f.target).length===0){g.fadeOut(150).prev().removeClass("active")}});b('input[name="activity"]').change(function(){var e=b(this).data("ams-url");container=b(".ajax-notifications");a.skin.loadURL(e,container)});b("#logout a").click(function(f){f.preventDefault();f.stopPropagation();a.loginURL=b(this).attr("href");a.skin.bigBox({title:" "+a.i18n.LOGOUT+" "+b("#show-shortcut").text()+" ?",content:a.i18n.LOGOUT_COMMENT,buttons:"["+a.i18n.BTN_NO+"]["+a.i18n.BTN_YES+"]"},function(e){if(e==a.i18n.BTN_YES){a.root.addClass("animated fadeOutUp");setTimeout(a.skin.logout,1000)}})});b("NAV UL").myams_menu({accordion:true,speed:a.menu_speed});b(".minifyme").click(function(f){b("BODY").toggleClass("minified");b(this).effect("highlight",{},500);f.preventDefault()});b("#refresh").click(function(f){a.skin.bigBox({title:" "+a.i18n.CLEAR_STORAGE_TITLE,content:a.i18n.CLEAR_STORAGE_CONTENT,buttons:"["+a.i18n.BTN_CANCEL+"]["+a.i18n.BTN_OK+"]"},function(e){if(e==a.i18n.BTN_OK&&localStorage){localStorage.clear();location.reload()}});f.preventDefault()});c.on("click",function(g){var f=b(this);if(!f.is(g.target)&&f.has(g.target).length===0&&b(".popover").has(g.target).length===0){f.popover("hide")}});a.ajax.check(b.resize,a.baseURL+"ext/jquery-resize"+a.devext+".js",function(){b("#main").resize(function(){a.skin._setPageHeight();a.skin._checkMobileWidth()});b("nav").resize(function(){a.skin._setPageHeight()})});if(a.ajax_nav){b(document).on("click",'a[href="#"]',function(f){f.preventDefault()});b(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(j){var h=b(j.currentTarget);var f=h.attr("href")||h.data("ams-url");if(!f||f.startsWith("javascript:")||h.attr("target")||(h.data("ams-context-menu")===true)){return}j.preventDefault();j.stopPropagation();var g=a.getFunctionByName(f);if(typeof(g)=="function"){f=g.call(h)}if(typeof(f)=="function"){f.call(h)}else{f=f.replace(/\%23/,"#");var i=h.data("ams-target");if(i){a.form.confirmChangedForm(i,function(){a.skin.loadURL(f,i,h.data("ams-link-options"),h.data("ams-link-callback"));j.stopPropagation()})}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},50)}else{window.location.hash=f}}}else{window.location=f}})}}});b(document).on("click",'a[target="_blank"]',function(f){f.preventDefault();window.open(b(f.currentTarget).attr("href"))});b(document).on("click",'a[target="_top"]',function(f){f.preventDefault();a.form.confirmChangedForm(function(){window.location=b(f.currentTarget).attr("href")})});b(window).on("hashchange",a.skin.checkURL)}b(document).off("click.modal").on("click",'[data-toggle="modal"]',function(g){var f=b(this);if(f.data("ams-context-menu")===true){return}if(f.data("ams-stop-propagation")===true){g.stopPropagation()}g.preventDefault();a.dialog.open(f);if(f.parents("#shortcut").exists()){setTimeout(a.skin._hideShortcutButtons,300)}});b(document).on("click",'button[type="submit"], button.submit',function(){var e=b(this);b(e.get(0).form).data("ams-submit-button",e)});b(document).on("click","[data-ams-click-handler]",function(h){var g=b(this);var f=g.data();if(f.amsClickHandler){if((f.amsStopPropagation===true)||(f.amsClickStopPropagation===true)){h.stopPropagation()}if(f.amsClickKeepDefault!==true){h.preventDefault()}var i=a.getFunctionByName(f.amsClickHandler);if(i!==undefined){i.call(g,f.amsClickHandlerOptions)}}});b(document).on("change","[data-ams-change-handler]",function(h){var g=b(this);var f=g.data();if(f.amsChangeHandler){if(f.amsChangeKeepDefault!==true){h.preventDefault()}var i=a.getFunctionByName(f.amsChangeHandler);if(i!==undefined){i.call(g,f.amsChangeHandlerOptions)}}});b(document).on("reset","form",function(g){var f=b(this);setTimeout(function(){f.find(".select2").trigger("change")},10)});b(document).on("reset","[data-ams-reset-handler]",function(h){var f=b(this);var g=f.data();if(g.amsResetHandler){if(g.amsResetKeepDefault!==true){h.preventDefault()}var i=a.getFunctionByName(g.amsResetHandler);if(i!==undefined){i.call(f,g.amsResetHandlerOptions)}}});b(document).on("change",'input[type="file"]',function(h){h.preventDefault();var f=b(this);var g=f.parent(".button");if(g.exists()&&g.parent().hasClass("input-file")){g.next('input[type="text"]').val(f.val())}});b(document).on("focusin",function(f){if(b(f.target).closest(".mce-window").length){f.stopImmediatePropagation()}});b("a[data-toggle=tab]",".nav-tabs").on("click",function(f){if(b(this).parent("li").hasClass("disabled")){f.preventDefault();return false}});b(document).on("show.bs.tab",function(h){var f=b(h.target);var g=f.data();if(g.amsUrl){if(g.amsTabLoaded){return}a.skin.loadURL(g.amsUrl,f.attr("href"));if(g.amsTabLoadOnce){f.data("ams-tab-loaded",true)}}});a.initContent(document);if(a.ajax_nav&&(b("nav").length>0)){a.skin.checkURL()}b(window).on("beforeunload",a.form.checkBeforeUnload)};MyAMS.initContent=function(c){b(".tipsy").remove();b("[rel=tooltip]",c).tooltip();b("[rel=popover]",c).popover();b("[rel=popover-hover]",c).popover({trigger:"hover"});a.plugins.init(c);a.callbacks.init(c);a.events.init(c);a.form.init(c);if(a.device==="desktop"){a.skin._initDesktopWidgets(c)}else{a.skin._initMobileWidgets(c)}a.skin._setPageHeight()};MyAMS.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]",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"};b(document).ready(function(){b=jQuery.noConflict();var c=b("HTML");var d=c.attr("lang")||c.attr("xml:lang");if(d&&!d.startsWith("en")){MyAMS.lang=d;MyAMS.getScript(MyAMS.baseURL+"i18n/myams_"+d.substr(0,2)+".js",function(){MyAMS.initPage()})}else{MyAMS.initPage()}})})(jQuery); \ No newline at end of file