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