Version 0.1.0
authorThierry Florac <thierry.florac@onf.fr>
Mon, 12 May 2014 16:59:41 +0200
changeset 17 847adb5d49b1
parent 16 0aff8587343b
child 18 a3634899023d
Version 0.1.0
.installed.cfg
buildout.cfg
docs/README.txt
src/ztfy.myams.egg-info/PKG-INFO
src/ztfy.myams.egg-info/requires.txt
src/ztfy/myams/resources/js/myams.js
src/ztfy/myams/resources/js/myams.min.js
--- a/.installed.cfg	Mon May 12 00:35:54 2014 +0200
+++ b/.installed.cfg	Mon May 12 16:59:41 2014 +0200
@@ -4,7 +4,7 @@
 
 [package]
 __buildout_installed__ = 
-__buildout_signature__ = zc.recipe.egg-1.3.2-py2.7.egg setuptools-0.6c11-py2.7.egg zc.buildout-1.5.2-py2.7.egg
+__buildout_signature__ = zc.recipe.egg-2.0.1-py2.7.egg setuptools-3.5.1-py2.7.egg zc.buildout-2.2.1-py2.7.egg
 _b = /home/tflorac/Dropbox/src/ztfy.myams/bin
 _d = /home/tflorac/Dropbox/src/ztfy.myams/develop-eggs
 _e = /var/local/eggs
@@ -12,26 +12,20 @@
 develop-eggs-directory = /home/tflorac/Dropbox/src/ztfy.myams/develop-eggs
 eggs = ztfy.myams
 eggs-directory = /var/local/eggs
-executable = /usr/bin/python2.7
 find-links = http://download.zope.org/distribution/
 	http://download.ztfy.org/thirdparty/
 	http://dist.plone.org/thirdparty/
-python = buildout
 recipe = zc.recipe.egg
 
 [i18n]
-__buildout_installed__ = /home/tflorac/Dropbox/src/ztfy.myams/parts/i18n/configure.zcml
-	/home/tflorac/Dropbox/src/ztfy.myams/parts/i18n/sitecustomize.py
-	/home/tflorac/Dropbox/src/ztfy.myams/parts/i18n/site.py
-	/home/tflorac/Dropbox/src/ztfy.myams/bin/i18nextract
+__buildout_installed__ = /home/tflorac/Dropbox/src/ztfy.myams/bin/i18nextract
 	/home/tflorac/Dropbox/src/ztfy.myams/bin/i18nmergeall
 	/home/tflorac/Dropbox/src/ztfy.myams/bin/i18nstats
 	/home/tflorac/Dropbox/src/ztfy.myams/bin/i18ncompile
-__buildout_signature__ = z3c.recipe.i18n-0.8.1-py2.7.egg zope.configuration-3.7.4-py2.7.egg zope.app.locales-3.6.2-py2.7.egg zope.app.appsetup-3.15.0-py2.7.egg z3c.recipe.scripts-1.0.1-py2.7.egg zc.buildout-1.5.2-py2.7.egg setuptools-0.6c11-py2.7.egg zope.schema-3.7.1-py2.7.egg zope.interface-3.7.0-py2.7-linux-x86_64.egg zope.i18nmessageid-3.5.3-py2.7-linux-x86_64.egg zope.app.applicationcontrol-3.5.10-py2.7.egg zope.tal-3.5.2-py2.7.egg zope.traversing-3.14.0-py2.7.egg zope.site-3.9.2-py2.7.egg zope.session-3.9.5-py2.7.egg zope.security-3.8.3-py2.7-linux-x86_64.egg zope.processlifetime-1.0-py2.7.egg zope.event-3.5.2-py2.7.egg zope.error-3.7.4-py2.7.egg zope.container-3.12.0-py2.7-linux-x86_64.egg zope.component-3.10.0-py2.7.egg zope.app.publication-3.12.0-py2.7.egg ZODB3-3.10.5-py2.7-linux-x86_64.egg zc.recipe.egg-1.3.2-py2.7.egg zc.buildout-1.5.2-py2.7.egg zope.traversing-3.14.0-py2.7.egg zope.size-3.4.1-py2.7.egg zope.i18n-3.7.4-py2.7.egg zope.component-3.10.0-py2.7.egg zope.applicationcontrol-3.5.5-py2.7.egg zope.location-3.9.1-py2.7.egg zope.security-3.8.3-py2.7-linux-x86_64.egg zope.publisher-3.12.6-py2.7.egg zope.proxy-3.6.1-py2.7-linux-x86_64.egg zope.lifecycleevent-3.6.2-py2.7.egg zope.annotation-3.6.0-py2.7.egg zope.minmax-1.1.2-py2.7.egg zope.location-3.9.1-py2.7.egg zope.proxy-3.6.1-py2.7-linux-x86_64.egg zope.exceptions-3.6.2-py2.7.egg zope.broken-3.6.0-py2.7.egg zope.filerepresentation-3.6.1-py2.7.egg zope.lifecycleevent-3.6.2-py2.7.egg zope.location-3.9.1-py2.7.egg zope.dottedname-3.4.6-py2.7.egg zope.traversing-3.14.0-py2.7.egg zope.publisher-3.12.6-py2.7.egg zope.browser-1.3-py2.7.egg zope.authentication-3.7.1-py2.7.egg zdaemon-2.0.7-py2.7.egg ZConfig-2.8.0-py2.7.egg zc.lockfile-1.0.2-py2.7.egg transaction-1.1.1-py2.7.egg pytz-2013b-py2.7.egg zope.proxy-3.6.1-py2.7-linux-x86_64.egg zope.schema-3.7.1-py2.7.egg zope.contenttype-3.5.5-py2.7.egg zope.browser-1.3-py2.7.egg zope.component-3.10.0-py2.7.egg
+__buildout_signature__ = z3c.recipe.i18n-0.9.0-py2.7.egg zope.configuration-3.7.4-py2.7.egg zope.app.locales-3.6.2-py2.7.egg zope.app.appsetup-3.15.0-py2.7.egg zc.recipe.egg-2.0.1-py2.7.egg zc.buildout-2.2.1-py2.7.egg setuptools-3.5.1-py2.7.egg zope.schema-3.7.1-py2.7.egg zope.interface-3.7.0-py2.7-linux-x86_64.egg zope.i18nmessageid-3.5.3-py2.7-linux-x86_64.egg zope.app.applicationcontrol-3.5.10-py2.7.egg zope.tal-3.5.2-py2.7.egg zope.traversing-3.14.0-py2.7.egg zope.site-3.9.2-py2.7.egg zope.session-3.9.5-py2.7.egg zope.security-3.8.3-py2.7-linux-x86_64.egg zope.processlifetime-1.0-py2.7.egg zope.event-3.5.2-py2.7.egg zope.error-3.7.4-py2.7.egg zope.container-3.12.0-py2.7-linux-x86_64.egg zope.component-3.10.0-py2.7.egg zope.app.publication-3.12.0-py2.7.egg ZODB3-3.10.5-py2.7-linux-x86_64.egg zope.size-3.4.1-py2.7.egg zope.i18n-3.7.4-py2.7.egg zope.applicationcontrol-3.5.5-py2.7.egg zope.location-3.9.1-py2.7.egg zope.publisher-3.12.6-py2.7.egg zope.proxy-3.6.1-py2.7-linux-x86_64.egg zope.lifecycleevent-3.6.2-py2.7.egg zope.annotation-3.6.0-py2.7.egg zope.minmax-1.1.2-py2.7.egg zope.exceptions-3.6.2-py2.7.egg zope.broken-3.6.0-py2.7.egg zope.filerepresentation-3.6.1-py2.7.egg zope.dottedname-3.4.6-py2.7.egg zope.browser-1.3-py2.7.egg zope.authentication-3.7.1-py2.7.egg zdaemon-2.0.7-py2.7.egg ZConfig-2.8.0-py2.7.egg zc.lockfile-1.0.2-py2.7.egg transaction-1.1.1-py2.7.egg pytz-24b9ebbc6a8753cdf23ec38b7729bb74 zope.contenttype-3.5.5-py2.7.egg
 _b = /home/tflorac/Dropbox/src/ztfy.myams/bin
 _d = /home/tflorac/Dropbox/src/ztfy.myams/develop-eggs
 _e = /var/local/eggs
-allowed-eggs-from-site-packages = *
 bin-directory = /home/tflorac/Dropbox/src/ztfy.myams/bin
 develop-eggs-directory = /home/tflorac/Dropbox/src/ztfy.myams/develop-eggs
 domain = ztfy.myams
@@ -39,23 +33,18 @@
 	z3c.recipe.i18n
 	zope.app.locales [extract]
 eggs-directory = /var/local/eggs
-exec-sitecustomize = true
-executable = /usr/bin/python2.7
 find-links = http://download.zope.org/distribution/
 	http://download.ztfy.org/thirdparty/
 	http://dist.plone.org/thirdparty/
-include-site-packages = false
 output = src/ztfy/myams/locales
 packages = ztfy.myams
-parts-directory = /home/tflorac/Dropbox/src/ztfy.myams/parts/i18n
-python = buildout
 recipe = z3c.recipe.i18n:i18n
 zcml = <include file="configure.zcml" />
 
 [pyflakes]
 __buildout_installed__ = /home/tflorac/Dropbox/src/ztfy.myams/bin/pyflakes
 	/home/tflorac/Dropbox/src/ztfy.myams/bin/pyflakes
-__buildout_signature__ = zc.recipe.egg-1.3.2-py2.7.egg setuptools-0.6c11-py2.7.egg zc.buildout-1.5.2-py2.7.egg
+__buildout_signature__ = zc.recipe.egg-2.0.1-py2.7.egg setuptools-3.5.1-py2.7.egg zc.buildout-2.2.1-py2.7.egg
 _b = /home/tflorac/Dropbox/src/ztfy.myams/bin
 _d = /home/tflorac/Dropbox/src/ztfy.myams/develop-eggs
 _e = /var/local/eggs
@@ -64,97 +53,34 @@
 eggs = pyflakes
 eggs-directory = /var/local/eggs
 entry-points = pyflakes=pyflakes.scripts.pyflakes:main
-executable = /usr/bin/python2.7
 find-links = http://download.zope.org/distribution/
 	http://download.ztfy.org/thirdparty/
 	http://dist.plone.org/thirdparty/
-initialization = if not sys.argv[1:]: sys.argv[1:] = ["src/"]
-python = buildout
+initialization = if not sys.argv[1:]: sys.argv[1:] = ["src"]
 recipe = zc.recipe.egg
 scripts = pyflakes
 
 [pyflakesrun]
 __buildout_installed__ = 
-__buildout_signature__ = collective.recipe.cmd-0.6-py2.7.egg zc.buildout-1.5.2-py2.7.egg setuptools-0.6c11-py2.7.egg
-cmds = ./bin/pyflakes
+__buildout_signature__ = collective.recipe.cmd-0.6-py2.7.egg zc.buildout-2.2.1-py2.7.egg setuptools-3.5.1-py2.7.egg
+cmds = /home/tflorac/Dropbox/src/ztfy.myams/bin/pyflakes
 on_install = true
 recipe = collective.recipe.cmd
 
 [test]
-__buildout_installed__ = /home/tflorac/Dropbox/src/ztfy.myams/parts/test/site-packages/sitecustomize.py
-	/home/tflorac/Dropbox/src/ztfy.myams/parts/test/site-packages/site.py
+__buildout_installed__ = /home/tflorac/Dropbox/src/ztfy.myams/parts/test
 	/home/tflorac/Dropbox/src/ztfy.myams/bin/test
-__buildout_signature__ = zc.recipe.testrunner-1.4.0-py2.7.egg z3c.recipe.scripts-1.0.1-py2.7.egg setuptools-0.6c11-py2.7.egg zope.testrunner-4.0.4-py2.7.egg zc.buildout-1.5.2-py2.7.egg zc.recipe.egg-1.3.2-py2.7.egg zope.interface-3.7.0-py2.7-linux-x86_64.egg zope.exceptions-3.6.2-py2.7.egg
+__buildout_signature__ = zc.recipe.testrunner-2.0.0-py2.7.egg zc.recipe.egg-2.0.1-py2.7.egg setuptools-3.5.1-py2.7.egg zope.testrunner-4.0.4-py2.7.egg zc.buildout-2.2.1-py2.7.egg zope.interface-3.7.0-py2.7-linux-x86_64.egg zope.exceptions-3.6.2-py2.7.egg
 _b = /home/tflorac/Dropbox/src/ztfy.myams/bin
 _d = /home/tflorac/Dropbox/src/ztfy.myams/develop-eggs
 _e = /var/local/eggs
-allowed-eggs-from-site-packages = *
 bin-directory = /home/tflorac/Dropbox/src/ztfy.myams/bin
 develop-eggs-directory = /home/tflorac/Dropbox/src/ztfy.myams/develop-eggs
 eggs = ztfy.myams [test]
 eggs-directory = /var/local/eggs
-exec-sitecustomize = true
-executable = /usr/bin/python2.7
 find-links = http://download.zope.org/distribution/
 	http://download.ztfy.org/thirdparty/
 	http://dist.plone.org/thirdparty/
-include-site-packages = false
-location = /home/tflorac/Dropbox/src/ztfy.myams/parts/test/working-directory
-parts-directory = /home/tflorac/Dropbox/src/ztfy.myams/parts/test
-python = buildout
+location = /home/tflorac/Dropbox/src/ztfy.myams/parts/test
 recipe = zc.recipe.testrunner
 script = /home/tflorac/Dropbox/src/ztfy.myams/bin/test
-
-[buildout]
-installed_develop_eggs = 
-
-[buildout]
-parts = i18n pyflakes pyflakesrun test package
-
-[buildout]
-parts = pyflakes pyflakesrun test package i18n
-
-[buildout]
-parts = pyflakesrun test package i18n pyflakes
-
-[buildout]
-parts = test package i18n pyflakes pyflakesrun
-
-[buildout]
-parts = package i18n pyflakes pyflakesrun test
-
-[buildout]
-installed_develop_eggs = 
-
-[buildout]
-parts = i18n pyflakes pyflakesrun test package
-
-[buildout]
-parts = pyflakes pyflakesrun test package i18n
-
-[buildout]
-parts = pyflakesrun test package i18n pyflakes
-
-[buildout]
-parts = test package i18n pyflakes pyflakesrun
-
-[buildout]
-parts = package i18n pyflakes pyflakesrun test
-
-[buildout]
-installed_develop_eggs = 
-
-[buildout]
-parts = i18n pyflakes pyflakesrun test package
-
-[buildout]
-parts = pyflakes pyflakesrun test package i18n
-
-[buildout]
-parts = pyflakesrun test package i18n pyflakes
-
-[buildout]
-parts = test package i18n pyflakes pyflakesrun
-
-[buildout]
-parts = package i18n pyflakes pyflakesrun test
--- a/buildout.cfg	Mon May 12 00:35:54 2014 +0200
+++ b/buildout.cfg	Mon May 12 16:59:41 2014 +0200
@@ -5,8 +5,16 @@
 versions = versions
 newest = false
 allow-picked-versions = false
-src = src/
+src = src
 develop = .
+          /var/local/src/ztfy-bb/ztfy.base
+          /var/local/src/ztfy-bb/ztfy.baseskin
+          /var/local/src/ztfy-bb/ztfy.extfile
+          /var/local/src/ztfy-bb/ztfy.file
+          /var/local/src/ztfy-bb/ztfy.jqueryui
+          /var/local/src/ztfy-bb/ztfy.security
+          /var/local/src/ztfy-bb/ztfy.skin
+          /var/local/src/ztfy-bb/ztfy.utils
 parts = package i18n pyflakes pyflakesrun test
 
 [package]
@@ -32,7 +40,7 @@
 [pyflakesrun]
 recipe = collective.recipe.cmd
 on_install = true
-cmds = ${buildout:develop}/bin/${pyflakes:scripts}
+cmds = ${buildout:directory}/bin/${pyflakes:scripts}
 
 [test]
 recipe = zc.recipe.testrunner
@@ -40,3 +48,4 @@
 
 [versions]
 ztfy.myams = 0.1.0
+setuptools = 3.5.1
--- a/docs/README.txt	Mon May 12 00:35:54 2014 +0200
+++ b/docs/README.txt	Mon May 12 16:59:41 2014 +0200
@@ -3,4 +3,15 @@
 Introduction
 ============
 
-A ZTFY package providing a new Bootstrap based skin
+A ZTFY package providing a new Bootstrap-based application management skin
+
+
+What is it?
+===========
+
+MyAMS, "My Application Management Skin", is a new ZTFY package which provides a complete application
+management skin based on Bootstrap. It is heavilly using AJAX and HTML5 "data" API, and already includes a few
+JQuery plug-ins like DataTables or Validate.
+
+No end-user or even developer documentation is available yet. I hope to be able to produce one as well as
+a complete demonstration site as soon as possible.
--- a/src/ztfy.myams.egg-info/PKG-INFO	Mon May 12 00:35:54 2014 +0200
+++ b/src/ztfy.myams.egg-info/PKG-INFO	Mon May 12 16:59:41 2014 +0200
@@ -11,7 +11,18 @@
         Introduction
         ============
         
-        A ZTFY package providing a new Bootstrap based skin
+        A ZTFY package providing a new Bootstrap-based application management skin
+        
+        
+        What is it?
+        ===========
+        
+        MyAMS, "My Application Management Skin", is a new ZTFY package which provides a complete application
+        management skin based on Bootstrap. It is heavilly using AJAX and HTML5 "data" API, and already includes a few
+        JQuery plug-ins like DataTables or Validate.
+        
+        No end-user or even developer documentation is available yet. I hope to be able to produce one as well as
+        a complete demonstration site as soon as possible.
         
         
         - Thierry Florac <tflorac@ulthar.net> - Author
--- a/src/ztfy.myams.egg-info/requires.txt	Mon May 12 00:35:54 2014 +0200
+++ b/src/ztfy.myams.egg-info/requires.txt	Mon May 12 16:59:41 2014 +0200
@@ -3,19 +3,34 @@
 z3c.form
 z3c.formjs
 z3c.formui
-z3c.jsonrpc
-z3c.language.negotiator
-z3c.language.session
-z3c.language.switch
-z3c.layer.pagelet
-z3c.pagelet
+z3c.json
 z3c.table
-zc.catalog
+z3c.template
+zope.annotation
+zope.authentication
 zope.component
+zope.container
+zope.event
+zope.exceptions
+zope.i18n
 zope.i18nmessageid
 zope.interface
+zope.lifecycleevent
+zope.location
+zope.pagetemplate
+zope.publisher
+zope.schema
+zope.security
+zope.session
+zope.site
+zope.tales
+zope.traversing
 zope.viewlet
+ztfy.baseskin
+ztfy.extfile
+ztfy.file
 ztfy.skin
+ztfy.utils
 
 [test]
 zope.testing
\ No newline at end of file
--- a/src/ztfy/myams/resources/js/myams.js	Mon May 12 00:35:54 2014 +0200
+++ b/src/ztfy/myams/resources/js/myams.js	Mon May 12 16:59:41 2014 +0200
@@ -60,7 +60,7 @@
 	 * JQuery 'econtains' expression
 	 * Case insensitive contains expression
 	 */
-	$.expr[":"].econtains = function(obj, index, meta, stack) {
+	$.expr[":"].econtains = function(obj, index, meta /*, stack*/) {
 		return (obj.textContent || obj.innerText || $(obj).text() || "").toLowerCase() == meta[3].toLowerCase();
 	};
 
@@ -69,7 +69,7 @@
 	 * JQuery 'withtext' expression
 	 * Case sensitive exact search expression
 	 */
-	$.expr[":"].withtext = function(obj, index, meta, stack) {
+	$.expr[":"].withtext = function(obj, index, meta /*, stack*/) {
 		return (obj.textContent || obj.innerText || $(obj).text() || "") == meta[3];
 	};
 
@@ -77,7 +77,7 @@
 	/**
 	 * JQuery filter on parents class
 	 */
-	$.expr[':'].parents = function(obj, index, meta, stack) {
+	$.expr[':'].parents = function(obj, index, meta /*, stack*/) {
 		return $(obj).parents(meta[3]).length > 0;
 	};
 
@@ -283,8 +283,10 @@
 		// public method for url decoding
 		decode : function (utftext) {
 			var string = "";
-			var i = 0;
-			var c = c1 = c2 = 0;
+			var i = 0,
+				c = 0,
+				c2 = 0,
+				c3 = 0;
 
 			while ( i < utftext.length ) {
 
@@ -315,7 +317,7 @@
 	 * MyAMS extensions to JQuery
 	 */
 	if (window.MyAMS === undefined) {
-		MyAMS = {
+		window.MyAMS = {
 			devmode: true,
 			throttle_delay: 350,
 			menu_speed: 235,
@@ -369,6 +371,19 @@
 
 
 	/**
+	 * Generate a random ID
+	 *
+	 * @param length
+	 */
+	MyAMS.generateId = function() {
+		function s4() {
+			return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
+		}
+		return s4() + s4() + s4() + s4();
+	};
+
+
+	/**
 	 * Get and execute a function given by name
 	 * Small piece of code by Jason Bunting
 	 */
@@ -379,7 +394,7 @@
 			return functionName;
 		var namespaces = functionName.split(".");
 		var func = namespaces.pop();
-		var context = (context === undefined || context === null) ? window : context;
+		context = (context === undefined || context === null) ? window : context;
 		for (var i=0; i < namespaces.length; i++) {
 			try {
 				context = context[namespaces[i]];
@@ -409,10 +424,9 @@
 	 * {MyAMS.baseURL}
 	 */
 	MyAMS.getSource = function(url) {
-		var src = url.replace(/{[^{}]*}/g, function(match) {
+		return url.replace(/{[^{}]*}/g, function(match) {
 			return ams.getFunctionByName(match.substr(1, match.length-2));
 		});
-		return src;
 	};
 
 	MyAMS.getScript = function(url, callback, options) {
@@ -448,7 +462,7 @@
 
 		stop: function(event) {
 			if (!event) {
-				var event = window.event;
+				event = window.event;
 			}
 			if (event) {
 				if (event.stopPropagation) {
@@ -513,7 +527,7 @@
 		/**
 		 * Default JQuery AJAX error handler
 		 */
-		ajax: function(event, request, settings) {
+		ajax: function(event, request /*, settings*/) {
 			if (request.statusText == 'OK')
 				return;
 			ams.skin.messageBox('error', {
@@ -565,8 +579,8 @@
 		 */
 		check: function(checker, source, callback, options) {
 			if (typeof(callback) == 'object') {
-				var options = callback;
-				var callback = undefined;
+				options = callback;
+				callback = undefined;
 			}
 			var defaults = {
 				async: typeof(callback) == 'function'
@@ -611,7 +625,7 @@
 				callback = ams.getFunctionByName(callback);
 			delete options.callback;
 
-			var result;
+			var result = undefined;
 			var defaults = {
 				url: addr,
 				type: 'post',
@@ -619,7 +633,7 @@
 				async: typeof(callback) == 'function',
 				data: $.param(data, true),
 				dataType: 'json',
-				success: callback || function(data, status) {
+				success: callback || function(data /*, status*/) {
 					result = data.result;
 				},
 				error: ams.error.show
@@ -633,7 +647,9 @@
 		 * Extract data type and result from response
 		 */
 		getResponse: function(request) {
-			var content_type = request.getResponseHeader('content-type');
+			var content_type = request.getResponseHeader('content-type'),
+				data_type,
+				result;
 			if (content_type.startsWith('application/javascript')) {
 				data_type = 'script';
 				result = request.responseText;
@@ -683,6 +699,7 @@
 		 */
 		handleJSON: function(result, form) {
 			var status = result.status;
+			var url;
 			switch (status) {
 				case 'error':
 					ams.form.showErrors(form, result);
@@ -705,14 +722,14 @@
 				case 'reload':
 					if (result.close_form != false)
 						ams.dialog.close(form);
-					var url = result.location;
+					url = result.location;
 					if (url.startsWith('#'))
 						ams.skin.loadURL(url.substr(1), result.target || '#content');
 					else
 						ams.skin.loadURL(url, result.target || '#content');
 					break;
 				case 'redirect':
-					var url = result.location;
+					url = result.location;
 					if (result.window) {
 						window.open(url, result.window, result.options);
 					} else {
@@ -889,7 +906,7 @@
 		 */
 		submit: function(form, handler, submit_options) {
 			// Check params
-			var form = $(form);
+			form = $(form);
 			if (!form.exists())
 				return false;
 			if (typeof(handler) == 'object') {
@@ -974,11 +991,11 @@
 										cache: false,
 										data: form_data,
 										dataType: data.amsFormDatatype,
-										beforeSerialize: function(form, options) {
+										beforeSerialize: function(/*form, options*/) {
 											if (typeof(tinyMCE) != 'undefined')
 												tinyMCE.triggerSave();
 										},
-										beforeSubmit: function(data, form, options) {
+										beforeSubmit: function(data, form /*, options*/) {
 											form.data('submitted', true);
 										},
 										error: function(request, status, error) {
@@ -1221,10 +1238,11 @@
 			} else {
 				header = errors.widgets && (errors.widgets.length > 1) ? ams.i18n.ERRORS_OCCURED : ams.i18n.ERROR_OCCURED;
 				var message = new Array();
-				for (var index in errors.messages) {
+				var index;
+				for (index in errors.messages) {
 					if (!$.isNumeric(index))
 						continue;
-					message.push(errors.messages[index])
+					message.push(errors.messages[index].message || errors.messages[index]);
 				}
 				for (index in errors.widgets) {
 					if (!$.isNumeric(index))
@@ -1493,13 +1511,14 @@
 			}
 
 			// Load, run and register new plug-ins
+			var name;
 			$('[data-ams-plugins]', element).each(function() {
 				var source = $(this);
 				var plugins = {}
 				if (typeof(source.data('ams-plugins')) === 'string') {
 					var names = source.data('ams-plugins').split(/\s+/);
 					for (var index in names) {
-						var name = names[index];
+						name = names[index];
 						var plugin_options = {
 							src: source.data('ams-plugin-' + name + '-src'),
 							css: source.data('ams-plugin-' + name + '-css'),
@@ -1512,7 +1531,7 @@
 				} else {
 					plugins = source.data('ams-plugins');
 				}
-				for (var name in plugins) {
+				for (name in plugins) {
 					if (ams.plugins.enabled[name] === undefined) {
 						var plugin = plugins[name];
 						ams.getScript(plugin.src, function() {
@@ -1653,19 +1672,26 @@
 						var checker = $('<label class="checkbox"></label>');
 						var input = $('<input type="checkbox">').attr('name', data.amsCheckerFieldname)
 																.attr('id', (data.amsCheckerFieldname ||
-																			 ('checker_'+(+new Date()).toString())).replace(/\./, '_'))
+																			 ('checker_'+ams.generateId())).replace(/\./, '_'))
 																.val(data.amsCheckerState == 'on')
 																.on('change', function(e) {
+																	e.preventDefault();
+																	var veto = {};
+																	legend.trigger('ams.checker.before-switch', [legend, veto]);
+																	if (veto.veto)
+																		return;
 																	if ($(this).is(':checked')) {
 																		if (data.amsCheckerMode == 'disable')
 																			fieldset.removeAttr('disabled')
 																		else
-																			fieldset.removeClass('switched')
+																			fieldset.removeClass('switched');
+																		legend.trigger('ams.checker.opened', [legend]);
 																	} else {
 																		if (data.amsCheckerMode == 'disable')
 																			fieldset.attr('disabled', 'disabled');
 																		else
 																			fieldset.addClass('switched');
+																		legend.trigger('ams.checker.closed', [legend]);
 																	}
 																})
 																.appendTo(checker);
@@ -2064,8 +2090,9 @@
 												}
 											};
 											var settings = $.extend({}, data_options, data.amsDatatableOptions);
+											var index;
 											if (extensions.length > 0) {
-												for (var index in extensions) {
+												for (index in extensions) {
 													switch (extensions[index]) {
 														case 'autofill':
 															ams.ajax.check($.fn.dataTable.AutoFill,
@@ -2125,7 +2152,7 @@
 											var plugin = table.dataTable(settings);
 											ams.executeFunctionByName(data.amsDatatableAfterInitCallback, table, plugin, settings);
 											if (extensions.length > 0) {
-												for (var index in extensions) {
+												for (index in extensions) {
 													switch(extensions[index]) {
 														case 'autofill':
 															var af_settings = $.extend({}, data.amsDatatableAutofillOptions, settings.autofill);
@@ -2492,7 +2519,7 @@
 		alert: function(parent, status, header, message, subtitle, margin) {
 			$('.alert', parent).remove();
 			if (status == 'error')
-				var status = 'danger';
+				status = 'danger';
 			var content = '<div class="' + (margin ? 'margin-10' : '') + ' alert alert-block alert-' + status + ' fade in">' +
 							'<a class="close" data-dismiss="alert"><i class="fa fa-check"></i></a>' +
 							'<h4 class="alert-heading">' +
@@ -2536,9 +2563,9 @@
 		 */
 		messageBox: function(status, options, callback) {
 			if (typeof(status) == 'object') {
-				var callback = options;
-				var options = status || {};
-				var status = 'info';
+				callback = options;
+				options = status || {};
+				status = 'info';
 			}
 			ams.ajax.check(ams.notify,
 						   ams.baseURL + 'myams-notify' + (ams.devmode ? '.js' : '.min.js'),
@@ -2567,9 +2594,9 @@
 		 */
 		smallBox: function(status, options, callback) {
 			if (typeof(status) == 'object') {
-				var callback = options;
-				var options = status || {};
-				var status = 'info';
+				callback = options;
+				options = status || {};
+				status = 'info';
 			}
 			ams.ajax.check(ams.notify,
 						   ams.baseURL + 'myams-notify' + (ams.devmode ? '.js' : '.min.js'),
@@ -2674,7 +2701,7 @@
 				callback = options;
 				options = {};
 			}
-			var container = $(container);
+			container = $(container);
 			var defaults = {
 				type: 'GET',
 				url: url,
--- a/src/ztfy/myams/resources/js/myams.min.js	Mon May 12 00:35:54 2014 +0200
+++ b/src/ztfy/myams/resources/js/myams.min.js	Mon May 12 16:59:41 2014 +0200
@@ -1,1 +1,1 @@
-(function(b){String.prototype.startsWith=function(e){var c=this.length;var d=e.length;if(c<d){return false}return(this.substr(0,d)==e)};String.prototype.endsWith=function(e){var c=this.length;var d=e.length;if(c<d){return false}return(this.substr(c-d)==e)};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(d){var c=this.length;var e=Number(arguments[1])||0;e=(e<0)?Math.ceil(e):Math.floor(e);if(e<0){e+=c}for(;e<c;e++){if(e in this&&this[e]===d){return e}}return -1}}b.expr[":"].econtains=function(f,d,e,c){return(f.textContent||f.innerText||b(f).text()||"").toLowerCase()==e[3].toLowerCase()};b.expr[":"].withtext=function(f,d,e,c){return(f.textContent||f.innerText||b(f).text()||"")==e[3]};b.expr[":"].parents=function(f,d,e,c){return b(f).parents(e[3]).length>0};if(b.scrollbarWidth===undefined){b.scrollbarWidth=function(){var d,e,c;if(c===undefined){d=b('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body");e=d.children();c=e.innerWidth()-e.height(99).innerWidth();d.remove()}return c}}b.fn.extend({exists:function(){return b(this).length>0},style:function(d,g,c){var f=this.get(0);if(typeof f=="undefined"){return}var e=this.get(0).style;if(typeof d!="undefined"){if(typeof g!="undefined"){c=typeof c!="undefined"?c:"";e.setProperty(d,g,c);return this}else{return e.getPropertyValue(d)}}else{return e}},removeClassPrefix:function(c){this.each(function(e,f){var d=f.className.split(" ").map(function(g){return g.startsWith(c)?"":g});f.className=b.trim(d.join(" "))});return this},myams_menu:function(c){var e={accordion:"true",speed:200,closedSign:'<em class="fa fa-angle-down"></em>',openedSign:'<em class="fa fa-angle-up"></em>'};var d=b.extend({},e,c);var f=b(this);f.find("LI").each(function(){var g=b(this);if(g.find("UL").size()>0){g.find("A:first").append("<b class='collapse-sign'>"+d.closedSign+"</b>");var h=g.find("A:first");if(h.attr("href")=="#"){h.click(function(){return false})}}});f.find("LI.active").each(function(){var g=b(this).parents("UL");var h=g.parent("LI");g.slideDown(d.speed);h.find("b:first").html(d.openedSign);h.addClass("open")});f.find("LI A").on("click",function(){var j=b(this);var g=j.parent().find("UL");if(g.size()!=0){if(d.accordion){if(!g.is(":visible")){var i=j.parent().parents("UL");var k=f.find("UL:visible");k.each(function(l){var m=true;i.each(function(n){if(i[n]==k[l]){m=false;return false}});if(m){if(g!=k[l]){b(k[l]).slideUp(d.speed,function(){j.parent("LI").find("b:first").html(d.closedSign);j.parent("LI").removeClass("open")})}}})}}var h=j.parent().find("UL:first");if(!j.attr("href").replace(/^#/,"")&&h.is(":visible")&&!h.hasClass("active")){h.slideUp(d.speed,function(){j.parent("LI").removeClass("open").find("B:first").delay(d.speed).html(d.closedSign)})}else{h.slideDown(d.speed,function(){j.parent("LI").addClass("open").find("B:first").delay(d.speed).html(d.openedSign)})}}})}});b.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");var d="";for(var g=0;g<e.length;g++){var f=e.charCodeAt(g);if(f<128){d+=String.fromCharCode(f)}else{if((f>127)&&(f<2048)){d+=String.fromCharCode((f>>6)|192);d+=String.fromCharCode((f&63)|128)}else{d+=String.fromCharCode((f>>12)|224);d+=String.fromCharCode(((f>>6)&63)|128);d+=String.fromCharCode((f&63)|128)}}}return d},decode:function(d){var e="";var f=0;var g=c1=c2=0;while(f<d.length){g=d.charCodeAt(f);if(g<128){e+=String.fromCharCode(g);f++}else{if((g>191)&&(g<224)){c2=d.charCodeAt(f+1);e+=String.fromCharCode(((g&31)<<6)|(c2&63));f+=2}else{c2=d.charCodeAt(f+1);c3=d.charCodeAt(f+2);e+=String.fromCharCode(((g&15)<<12)|((c2&63)<<6)|(c3&63));f+=3}}}return e}};if(window.MyAMS===undefined){MyAMS={devmode:true,throttle_delay:350,menu_speed:235,navbar_height:49,ajax_nav:true,enable_widgets:true,enable_mobile:false,enable_fastclick:false,ismobile:(/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()))}}var a=MyAMS;MyAMS.baseURL=(function(){var c=b("script:last");var d=c.attr("src");return d.substring(0,d.lastIndexOf("/")+1)})();MyAMS.getQueryVar=function(e,f){if(e.indexOf("?")<0){return false}if(!e.endsWith("&")){e+="&"}var c=new RegExp(".*?[&\\?]"+f+"=(.*?)&.*");var d=e.replace(c,"$1");return d==e?false:d};MyAMS.rgb2hex=function(c){return"#"+b.map(c.match(/\b(\d+)\b/g),function(d){return("0"+parseInt(d).toString(16)).slice(-2)}).join("")};MyAMS.getFunctionByName=function(h,d){if(h===undefined){return undefined}else{if(typeof(h)=="function"){return h}}var g=h.split(".");var f=g.pop();var d=(d===undefined||d===null)?window:d;for(var c=0;c<g.length;c++){try{d=d[g[c]]}catch(j){return undefined}}try{return d[f]}catch(j){return undefined}};MyAMS.executeFunctionByName=function(f,d){var e=a.getFunctionByName(f,window);if(typeof(e)=="function"){var c=Array.prototype.slice.call(arguments,2);return e.apply(d,c)}};MyAMS.getSource=function(c){var d=c.replace(/{[^{}]*}/g,function(e){return a.getFunctionByName(e.substr(1,e.length-2))});return d};MyAMS.getScript=function(d,g,c){var f={dataType:"script",url:a.getSource(d),success:g,error:a.error.show,cache:true,async:true};var e=b.extend({},f,c);return b.ajax(e)};MyAMS.getCSS=function(c,f){var e=b("HEAD");var d=b('link[data-ams-id="'+f+'"]',e);if(d.length==0){b("<link />").attr({rel:"stylesheet",type:"text/css",href:a.getSource(c),"data-ams-id":f}).appendTo(e)}};MyAMS.event={stop:function(c){if(!c){var c=window.event}if(c){if(c.stopPropagation){c.stopPropagation();c.preventDefault()}else{c.cancelBubble=true;c.returnValue=false}}}};MyAMS.browser={getInternetExplorerVersion:function(){var e=-1;if(navigator.appName=="Microsoft Internet Explorer"){var c=navigator.userAgent;var d=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(d.exec(c)!=null){e=parseFloat(RegExp.$1)}}return e},checkVersion:function(){var d="You're not using Windows Internet Explorer.";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=8){d="You're using a recent copy of Windows Internet Explorer."}else{d="You should upgrade your copy of Windows Internet Explorer."}}alert(d)},isIE8orlower:function(){var d="0";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=9){d=0}else{d=1}}return d}};MyAMS.error={ajax:function(e,d,c){if(d.statusText=="OK"){return}a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+e.type+"</h4><p>"+d.statusText+"</p>",icon:"fa fa-warning animated shake",timeout:10000});if(window.console){console.error(e);console.debug(d)}},show:function(e,c,d){if(!d){return}a.skin.messageBox("error",{title:a.i18n.ERRORS_OCCURED,content:"<h4>"+c+"</h4><p>"+d+"</p>",icon:"fa fa-warning animated shake",timeout:10000});if(window.console){console.error(d);console.debug(e)}}};MyAMS.ajax={check:function(d,f,h,c){if(typeof(h)=="object"){var c=h;var h=undefined}var g={async:typeof(h)=="function"};var e=b.extend({},g,c);if(d===undefined){a.getScript(f,function(){if(typeof(h)=="function"){h(true,c)}},e)}else{if(typeof(h)=="function"){h(false,c)}}},getAddr:function(d){var c=d||b("HTML HEAD BASE").attr("href")||window.location.href;return c.substr(0,c.lastIndexOf("/")+1)},post:function(e,g,d,j){if(e.startsWith(window.location.protocol)){var i=e}else{i=this.getAddr()+e}if(typeof(d)=="function"){j=d;d={}}else{if(!d){d={}}}if(typeof(j)=="undefined"){j=d.callback}if(typeof(j)=="string"){j=a.getFunctionByName(j)}delete d.callback;var c;var h={url:i,type:"post",cache:false,async:typeof(j)=="function",data:b.param(g,true),dataType:"json",success:j||function(l,k){c=l.result},error:a.error.show};var f=b.extend({},h,d);b.ajax(f);return c},getResponse:function(d){var c=d.getResponseHeader("content-type");if(c.startsWith("application/javascript")){data_type="script";result=d.responseText}else{if(c.startsWith("text/html")){data_type="html";result=d.responseText}else{if(c.startsWith("text/xml")){data_type="xml";result=d.responseText}else{result=d.responseJSON;if(result){data_type="json"}else{try{result=JSON.parse(d.responseText);data_type="json"}catch(f){result=d.responseText;data_type="text"}}}}}return{content_type:data_type,data:result}},handleJSON:function(k,e){var f=k.status;switch(f){case"error":a.form.showErrors(e,k);break;case"success":if(k.close_form!=false){a.dialog.close(e)}break;case"message":case"messagebox":break;case"callback":case"callbacks":if(k.close_form!=false){a.dialog.close(e)}break;case"modal":a.dialog.open(k.location);break;case"reload":if(k.close_form!=false){a.dialog.close(e)}var c=k.location;if(c.startsWith("#")){a.skin.loadURL(c.substr(1),k.target||"#content")}else{a.skin.loadURL(c,k.target||"#content")}break;case"redirect":var c=k.location;if(k.window){window.open(c,k.window,k.options)}else{window.location.href=c}break;default:console.log("Unhandled status: "+f);break}if(k.content){var h=k.content;var d=b(h.target||e||"#content");d.html(h.html);a.initContent(d)}if(k.message){var j=k.message;if(typeof(j)=="string"){a.skin.alert(b(e||"#content"),f,"",j)}else{a.skin.alert(b(j.target||e||"#content"),j.status||"success",j.header,j.body,j.subtitle)}}if(k.messagebox){j=k.messagebox;if(typeof(j)=="string"){a.skin.messageBox("info",{title:a.i18n.ERROR_OCCURED,content:j,timeout:10000})}else{a.skin.messageBox(j.status||"info",{title:j.title||a.i18n.ERROR_OCCURED,content:j.content,icon:j.icon,number:j.number,timeout:j.timeout||10000})}}if(k.callback){a.executeFunctionByName(k.callback,e,k.options)}if(k.callbacks){for(var g in k.callbacks){if(!b.isNumeric(g)){continue}var i=k.callbacks[g];a.executeFunctionByName(i,e,i.options)}}}};MyAMS.jsonrpc={getAddr:function(e){var c=e||b("HTML HEAD BASE").attr("href")||window.location.href;var d=c.replace(/\+\+skin\+\+\w+\//,"");return d.substr(0,d.lastIndexOf("/")+1)},query:function(d,f,c,e){a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){var g;if(typeof(c)=="function"){e=c;c={}}else{if(!c){c={}}}if(typeof(e)=="undefined"){e=c.callback}if(typeof(e)=="string"){e=a.getFunctionByName(e)}delete c.callback;var i={};if(typeof(d)=="string"){i.query=d}else{if(typeof(d)=="object"){b.extend(i,d)}}b.extend(i,c);var h={url:a.jsonrpc.getAddr(c.url),type:"post",cache:false,method:f,params:i,async:typeof(e)=="function",success:e||function(k,j){g=k.result},error:a.error.show};b.jsonRpc(h);return g})},post:function(e,c,d){a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){var f;if(typeof(c)=="function"){d=c;c={}}else{if(!c){c={}}}if(typeof(d)=="undefined"){d=c.callback}if(typeof(d)=="string"){d=a.getFunctionByName(d)}delete c.callback;var g={url:a.jsonrpc.getAddr(c.url),type:"post",cache:false,method:e,params:c,async:typeof(d)=="function",success:d||function(i,h){f=i.result},error:a.error.show};b.jsonRpc(g);return f})}};MyAMS.form={submit:function(e,d,f){var e=b(e);if(!e.exists()){return false}if(typeof(d)=="object"){f=d;d=undefined}if(e.data("submitted")){a.skin.messageBox("warning",{title:a.i18n.WAIT,content:a.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:5000});return false}if(!a.form._checkSubmitValidators(e)){return false}b(".alert, SPAN.state-error",e).remove();b(".state-error",e).removeClassPrefix("state-");var c=b(e.data("ams-submit-button"));if(c){c.button("loading")}a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+(a.devmode?".js":".min.js"),function(){function i(l,x){var q=l.data();var m=q.amsFormOptions;if(f){var v=f.formDataInitCallback}if(v){delete f.formDataInitCallback}else{v=q.amsFormDataInitCallback}if(v){if(typeof(v)=="function"){var t=v.call(l)}else{t=a.executeFunctionByName(v,l)}}else{t=q.amsFormData||{}}var r=b(l.data("ams-submit-button"));var w,s;if(r){w=r.data("ams-form-handler");s=r.data("ams-form-submit-target")}var p=l.attr("action").replace(/#/,"");if(p.startsWith(window.location.protocol)){var k=p}else{k=a.ajax.getAddr()+p}k+=d||w||q.amsFormHandler||"";if(q.amsFormInitSubmitTarget){var u=b(s||q.amsFormSubmitTarget||"#content");a.executeFunctionByName(q.amsFormInitSubmit||"MyAMS.form.initSubmit",l,u)}else{if(!q.amsFormHideSubmitFooter){a.executeFunctionByName(q.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",l)}}var j=typeof(x.uuid)!="undefined";if(j){if(k.indexOf("X-Progress-ID")<0){k+="?X-Progress-ID="+x.uuid}delete x.uuid}var o={url:k,type:"post",cache:false,data:t,dataType:q.amsFormDatatype,beforeSerialize:function(z,y){if(typeof(tinyMCE)!="undefined"){tinyMCE.triggerSave()}},beforeSubmit:function(A,z,y){z.data("submitted",true)},error:function(B,y,z){a.error.show(B,y,z);if(l.is(":visible")){var A=l.data("ams-submit-button");if(A){A.button("reset")}a.form.finalizeSubmitFooter.call(l)}l.data("submitted",false);l.removeData("ams-submit-button")},success:function(y,z,C,B){var D;var A=B.data("ams-submit-button");if(A){D=A.data("ams-form-submit-callback")}if(!D){D=a.getFunctionByName(q.amsFormSubmitCallback)||a.form._submitCallback}D.call(B,y,z,C,B);if(B.is(":visible")&&A){A.button("reset")}B.data("submitted",false);B.removeData("ams-submit-button")},iframe:j};var n=b.extend({},o,x,m,f);b(l).ajaxSubmit(n)}var h=b('INPUT[type="file"]',e).length>0;if(h){a.ajax.check(b.progressBar,a.baseURL+"ext/jquery-progressbar"+(a.devmode?".js":".min.js"));var g=b.extend({},{uuid:b.progressBar.submit(e)});i(e,g)}else{i(e,{})}});return false},initSubmit:function(e,d){var c=b(this);var f='<i class="fa fa-3x fa-gear fa-spin"></i>';if(!d){d=c.data("ams-form-submit-message")}if(d){f+="<strong>"+d+"</strong>"}b(e).html('<div class="row margin-20"><div class="text-center">'+f+"</div></div>");b(e).parents(".hidden").removeClass("hidden")},initSubmitFooter:function(d){var c=b(this);var f='<i class="fa fa-3x fa-gear fa-spin"></i>';if(!d){d=b(this).data("ams-form-submit-message")}if(d){f+='<strong class="submit-message align-top padding-left-10 margin-top-10">'+d+"</strong>"}var e=b("footer",c);b("button",e).hide();e.append('<div class="row"><div class="text-center">'+f+"</div></div>")},finalizeSubmitFooter:function(d){var c=b(this);var e=b("footer",c);if(e){b(".row",e).remove();b("button",e).show()}},_submitCallback:function(m,e,d,c){if(c.is(":visible")){a.form.finalizeSubmitFooter.call(c);var g=c.data("ams-submit-button");if(g){g.button("reset")}}var f=c.data();if(f.amsFormDatatype){var j=f.amsFormDatatype}else{var h=a.ajax.getResponse(d);j=h.content_type;m=h.data}switch(j){case"json":a.ajax.handleJSON(m,c);break;case"script":break;case"xml":break;case"html":case"text":default:if(g&&(g.data("ams-keep-modal")!==true)){a.dialog.close(c)}if(g){var i=b(g.amsFormSubmitTarget||f.amsFormSubmitTarget||"#content")}else{i=b(f.amsFormSubmitTarget||"#content")}if(!i.exists()){i=b("body")}i.parents(".hidden").removeClass("hidden");b(".alert",i.parents(".alerts-container")).remove();i.css({opacity:"0.0"}).html(m).delay(50).animate({opacity:"1.0"},300);a.initContent(i)}var k=d.getResponseHeader("X-AMS-Callback");if(k){var l=d.getResponseHeader("X-AMS-Callback-Options");a.executeFunctionByName(k,c,l===undefined?{}:JSON.parse(l))}},_getSubmitValidators:function(d){var c=new Array();var e=d.data("ams-form-validator");if(e){c.push([d,e])}b("[data-ams-form-validator]",d).each(function(){var f=b(this);c.push([f,f.data("ams-form-validator")])});return c},_checkSubmitValidators:function(e){var g=a.form._getSubmitValidators(e);if(!g.length){return true}var f=new Array();var l=true;for(var i in g){if(!b.isNumeric(i)){continue}var d=g[i];var c=d[0];var j=d[1];var k=a.executeFunctionByName(j,e,c);if(k===false){l=false}else{if(typeof(k)=="string"){f.push(k)}else{if(l.length&&(l.length>0)){f=f.concat(l)}}}}if(f.length>0){var h=f.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(e,"danger",h,f);return false}else{return l}},showErrors:function(e,h){if(typeof(h)=="string"){a.skin.alert(e,"error",a.i18n.ERROR_OCCURED,h)}else{if(h instanceof Array){var g=h.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(e,"error",g,h)}else{g=h.widgets&&(h.widgets.length>1)?a.i18n.ERRORS_OCCURED:a.i18n.ERROR_OCCURED;var d=new Array();for(var c in h.messages){if(!b.isNumeric(c)){continue}d.push(h.messages[c])}for(c in h.widgets){if(!b.isNumeric(c)){continue}var f=h.widgets[c];b('[name="'+f.name+'"]',e).parent("label").removeClassPrefix("state-").addClass("state-error").after('<span for="name" class="state-error">'+f.message+"</span>");if(f.label){d.push(f.label+" : "+f.message)}}a.skin.alert(e,"error",g,d,h.error_message)}}}};MyAMS.dialog={open:function(d,c){a.ajax.check(b.fn.modalmanager,a.baseURL+"ext/bootstrap-modalmanager"+(a.devmode?".js":".min.js"),function(){a.ajax.check(b.fn.modal.defaults,a.baseURL+"ext/bootstrap-modal"+(a.devmode?".js":".min.js"),function(f){if(f){b(document).off("click.modal");b.fn.modal.defaults.spinner=b.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>'}if(typeof(d)=="string"){var e=d}else{e=d.attr("href")||d.data("ams-url")}if(!e){return}b("body").modalmanager("loading");if(e.indexOf("#")==0){b(e).modal("show")}else{b.get(e,c,function(j,i,h){b("body").modalmanager("removeLoading");var k=a.ajax.getResponse(h);var p=k.content_type;var q=k.data;switch(p){case"json":a.ajax.handleJSON(q,b(b(d).data("ams-json-target")||"#content"));break;case"script":break;case"xml":break;case"html":case"text":default:var l=b(q);var n=b(".modal-dialog",l.wrap("<div></div>").parent());var m=n.data();var o={overflow:m.amsModalOverflow||".modal-viewport",maxHeight:m.amsModalMaxHeight===undefined?function(){return b(window).height()-b(".modal-header",l).outerHeight(true)-b("footer",l).outerHeight(true)-85}:a.getFunctionByName(m.amsModalMaxHeight)};var g=b.extend({},o,m.amsModalOptions);g=a.executeFunctionByName(m.amsModalInitCallback,n,g)||g;b("<div>").addClass("modal fade").append(l).modal(g);a.initContent(l)}})}})})},shown:function(i){function h(k){var l=b(".scrollmarker.top",c);var j=c.scrollTop();if(j>0){l.show()}else{l.hide()}var e=b(".scrollmarker.bottom",c);if(f+j>=c.get(0).scrollHeight){e.hide()}else{e.show()}}var g=i.target;var c=b(".modal-viewport",g);if(c.length==0){return}var f=parseInt(c.css("max-height"));var d=b.scrollbarWidth();if(c.height()==f){b("<div></div>").addClass("scrollmarker").addClass("top").css("top",0).css("width",c.width()-d).hide().appendTo(c);b("<div></div>").addClass("scrollmarker").addClass("bottom").css("top",f-20).css("width",c.width()-d).appendTo(c);c.scroll(h);c.off("resize").on("resize",h)}else{b(".scrollmarker",c).remove()}},close:function(d){var e=d.parents(".modal").data("modal");if(e){var c=b("body").data("modalmanager");if(c&&(c.getOpenModals().indexOf(e)>=0)){e.hide()}}}};MyAMS.helpers={select2FormatSelection:function(d,c){if(d instanceof Array){b(d).each(function(){if(typeof(this)=="object"){c.append(this.text)}else{c.append(this)}})}else{if(typeof(d)=="object"){c.append(d.text)}else{c.append(d)}}},select2QueryUrlResultsCallback:function(e,d,c){switch(e.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+e.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:10000});break;default:return{results:e.results||e,more:e.has_more||false,context:e.context}}},select2QueryMethodSuccessCallback:function(f,d,e){var c=f.result;switch(c.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+c.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:10000});break;default:e.callback({results:c.results||c,more:c.has_more||false,context:c.context})}}};MyAMS.plugins={init:function(d){a.plugins.initData(d);var e=new Array();b("[data-ams-plugins-disabled]",d).each(function(){var g=b(this).data("ams-plugins-disabled").split(/\s+/);for(var h in g){e.push(g[h])}});for(var c in a.plugins.enabled){if(e.indexOf(c)>=0){continue}var f=a.plugins.enabled[c];if(typeof(f)=="function"){f(d)}}b("[data-ams-plugins]",d).each(function(){var l=b(this);var g={};if(typeof(l.data("ams-plugins"))==="string"){var m=l.data("ams-plugins").split(/\s+/);for(var j in m){var i=m[j];var h={src:l.data("ams-plugin-"+i+"-src"),css:l.data("ams-plugin-"+i+"-css"),callback:l.data("ams-plugin-"+i+"-callback"),register:l.data("ams-plugin-"+i+"-register"),async:l.data("ams-plugin-"+i+"-async")};g[i]=h}}else{g=l.data("ams-plugins")}for(var i in g){if(a.plugins.enabled[i]===undefined){var k=g[i];a.getScript(k.src,function(){var p=k.callback;if(p){var o=a.getFunctionByName(p);if(typeof(o)=="function"){o(d)}if(k.register!==false){a.plugins.enabled[i]=o}}else{if(k.register!==false){a.plugins.enabled[i]=null}}var n=k.css;if(n){a.getCSS(n,i+"_css")}},{async:k.async===undefined?true:k.async})}}})},initData:function(c){b("[data-ams-data]",c).each(function(){var e=b(this);var f=e.data("ams-data");for(var d in f){e.attr("data-"+d,f[d])}})},enabled:{hint:function(c){var d=b(".hint:not(:parents(.nohints))",c);if(d.length>0){a.ajax.check(b.fn.tipsy,a.baseURL+"ext/jquery-tipsy"+(a.devmode?".js":".min.js"),function(){a.getCSS(a.baseURL+"../css/ext/jquery-tipsy"+(a.devmode?".css":".min.css"),"jquery-tipsy");d.each(function(){var i=b(this);var h=i.data();var f={html:h.amsHintHtml,title:a.getFunctionByName(h.amsHintTitleGetter)||function(){var j=b(this);return j.attr("original-title")||j.attr(h.amsHintTitleAttr||"title")||(h.amsHintHtml?j.html():j.text())},opacity:h.amsHintOpacity,gravity:h.amsHintGravity||"sw",offset:h.amsHintOffset||0};var e=b.extend({},f,h.amsHintOptions);e=a.executeFunctionByName(h.amsHintInitCallback,i,e)||e;var g=i.tipsy(e);a.executeFunctionByName(h.amsHintAfterInitCallback,i,g,e)})})}},switcher:function(c){b("LEGEND.switcher",c).each(function(){var e=b(this);var d=e.parent("fieldset");var f=e.data();if(!f.amsSwitcher){b('<i class="fa fa-fw"></i>').prependTo(b(this)).addClass(f.amsSwitcherState=="open"?(f.amsSwitcherMinusClass||"fa-minus"):(f.amsSwitcherPlusClass||"fa-plus"));e.on("click",function(h){h.preventDefault();var g={};e.trigger("ams.switcher.before-switch",[e,g]);if(g.veto){return}if(d.hasClass("switched")){d.removeClass("switched");b(".fa",e).removeClass(f.amsSwitcherPlusClass||"fa-plus").addClass(f.amsSwitcherMinusClass||"fa-minus");e.trigger("ams.switcher.opened",[e])}else{d.addClass("switched");b(".fa",e).removeClass(f.amsSwitcherMinusClass||"fa-minus").addClass(f.amsSwitcherPlusClass||"fa-plus");e.trigger("ams.switcher.closed",[e])}});if(f.amsSwitcherState!="open"){d.addClass("switched")}e.data("ams-switcher","on")}})},checker:function(c){b("LEGEND.checker",c).each(function(){var g=b(this);var d=g.parent("fieldset");var h=g.data();if(!h.amsChecker){var f=b('<label class="checkbox"></label>');var e=b('<input type="checkbox">').attr("name",h.amsCheckerFieldname).attr("id",(h.amsCheckerFieldname||("checker_"+(+new Date()).toString())).replace(/\./,"_")).val(h.amsCheckerState=="on").on("change",function(i){if(b(this).is(":checked")){if(h.amsCheckerMode=="disable"){d.removeAttr("disabled")}else{d.removeClass("switched")}}else{if(h.amsCheckerMode=="disable"){d.attr("disabled","disabled")}else{d.addClass("switched")}}}).appendTo(f);b(".legend",g).attr("for",e.attr("id"));f.append("<i></i>").prependTo(g);if(h.amsCheckerState=="on"){e.attr("checked",true)}else{d.addClass("switched")}g.data("ams-checker","on")}})},slider:function(c){var d=b(".slider",c);if(d.length>0){a.ajax.check(b.fn.slider,a.baseURL+"ext/bootstrap-slider.min.js",function(){d.each(function(){var h=b(this);var i=h.data();var f={};var e=b.extend({},f,h.data.amsSliderOptions);e=a.executeFunctionByName(i.amsSliderInitCallback,h,e)||e;var g=h.slider(e);a.executeFunctionByName(i.amsSliderAfterInitCallback,h,g,e)})})}},select2:function(d){var c=b(".select2",d);if(c.length>0){a.ajax.check(b.fn.select2,a.baseURL+"ext/jquery-select2-3.4.5"+(a.devmode?".js":".min.js"),function(){c.each(function(){var e=b(this);var j=e.data();var h={placeholder:j.amsSelect2Placeholder,multiple:j.amsSelect2Multiple,minimumInputLength:j.amsSelect2MinimumInputLength||0,maximumSelectionSize:j.amsSelect2MaximumSelectionSize,openOnEnter:j.amsSelect2EnterOpen===undefined?true:j.amsSelect2EnterOpen,allowClear:j.amsSelect2AllowClear===undefined?true:j.amsSelect2AllowClear,width:j.amsSelect2Width||"100%",initSelection:a.getFunctionByName(j.amsSelect2InitSelection),formatSelection:j.amsSelect2FormatSelection===undefined?a.helpers.select2FormatSelection:a.getFunctionByName(j.amsSelect2FormatSelection),formatResult:a.getFunctionByName(j.amsSelect2FormatResult),formatNoMatches:j.amsSelect2FormatResult===undefined?function(k){return a.i18n.SELECT2_NOMATCHES}:a.getFunctionByName(j.amsSelect2FormatResult),formatInputTooShort:j.amsSelect2FormatInputTooShort===undefined?function(k,l){var m=l-k.length;return a.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooShort),formatInputTooLong:j.amsSelect2FormatInputTooLong===undefined?function(l,k){var m=l.length-k;return a.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooLong),formatSelectionTooBig:j.amsSelect2FormatSelectionTooBig===undefined?function(k){return a.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,k).replace(/\{1\}/,k==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatSelectionTooBig),formatLoadMore:j.amsSelect2FormatLoadMore===undefined?function(k){return a.i18n.SELECT2_LOADMORE}:a.getFunctionByName(j.amsSelect2FormatLoadMore),formatSearching:j.amsSelect2FormatSearching===undefined?function(){return a.i18n.SELECT2_SEARCHING}:a.getFunctionByName(j.amsSelect2FormatSearching),separator:j.amsSelect2Separator||",",tokenSeparators:j.amsSelect2TokensSeparators||[","],tokenizer:a.getFunctionByName(j.amsSelect2Tokenizer)};switch(e.context.type){case"text":case"hidden":if(!h.initSelection){var f=e.data("ams-select2-values");if(f){h.initSelection=function(k,m){var l=[];b(k.val().split(h.separator)).each(function(){l.push({id:this,text:f[this]||this})});m(l)}}}break;default:break}if(j.amsSelect2Query){h.query=a.getFunctionByName(j.amsSelect2Query);h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryUrl){h.ajax={url:j.amsSelect2QueryUrl,quietMillis:j.amsSelect2QuietMillis||200,type:j.amsSelect2QueryType||"POST",dataType:j.amsSelect2QueryDatatype||"json",data:function(m,n,l){var k={};k[j.amsSelect2QueryParamName||"query"]=m;k[j.amsSelect2PageParamName||"page"]=n;k[j.amsSelect2ContextParamName||"context"]=l;return b.extend({},k,j.amsSelect2QueryOptions)},results:a.helpers.select2QueryUrlResultsCallback};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryMethod){h.query=function(k){var l={url:j.amsSelect2MethodTarget||a.jsonrpc.getAddr(),type:j.amsSelect2MethodType||"POST",cache:false,method:j.amsSelect2QueryMethod,params:j.amsSelect2QueryParams||{},success:function(n,m){return a.helpers.select2QueryMethodSuccessCallback(n,m,k)},error:a.error.show};l.params[j.amsSelect2QueryParamName||"query"]=k.term;l.params[j.amsSelect2PageParamName||"page"]=k.page;l.params[j.amsSelect2ContextParamName||"context"]=k.context;l=b.extend({},l,j.amsSelect2QueryOptions);l=a.executeFunctionByName(j.amsSelect2QueryInitCallback,e,l)||l;a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){b.jsonRpc(l)})};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2Tags){h.tags=j.amsSelect2Tags}else{if(j.amsSelect2Data){h.data=j.amsSelect2Data}}}}}if(j.amsSelect2EnableFreeTags){h.createSearchChoice=function(k){return{id:k,text:k}}}var g=b.extend({},h,j.amsSelect2Options);g=a.executeFunctionByName(j.amsSelect2InitCallback,e,g)||g;var i=e.select2(g);a.executeFunctionByName(j.amsSelect2AfterInitCallback,e,i,g);e.on("change",function(){var k=b(e.get(0).form).data("validator");if(k!==undefined){b(e).valid()}})})})}},maskedit:function(d){var c=b("[data-mask]",d);if(c.length>0){a.ajax.check(b.fn.mask,a.baseURL+"ext/jquery-maskedinput-1.3.1.min.js",function(){c.each(function(){var e=b(this);var i=e.data();var g={placeholder:i.amsMaskeditPlaceholder||"X"};var f=b.extend({},g,i.amsMaskeditOptions);f=a.executeFunctionByName(i.amsMaskeditInitCallback,e,f)||f;var h=e.mask(e.attr("data-mask"),f);a.executeFunctionByName(i.amsMaskeditAfterInitCallback,e,h,f)})})}},datepicker:function(c){var d=b(".datepicker",c);if(d.length>0){d.each(function(){var e=b(this);var i=e.data();var g={dateFormat:i.amsDatepickerFormat||"dd/mm/yy",prevText:'<i class="fa fa-chevron-left"></i>',nextText:'<i class="fa fa-chevron-right"></i>',changeMonth:i.amsDatepickerChangeMonth,changeYear:i.amsDatepickerChangeYear,showButtonPanel:!i.amsDatepickerHidePanel};var f=b.extend({},g,i.amsDatepickerOptions);f=a.executeFunctionByName(i.amsDatepickerInitCallback,e,f)||f;var h=e.datepicker(f);a.executeFunctionByName(i.amsDatepickerAfterInitCallback,e,h,f)})}},typeahead:function(d){var c=b(".typeahead",d);if(c.length>0){a.ajax.check(b.fn.typeahead,a.baseURL+"ext/jquery-typeahead"+(a.devmode?".js":".min.js"),function(){c.each(function(){var e=b(this);var i=e.data();var g={};var f=b.extend({},g,i.amsTypeaheadOptions);f=a.executeFunctionByName(i.amsTypeaheadInitCallback,e,f)||f;var h=e.typeahead(f);a.executeFunctionByName(i.amsTypeaheadAfterInitCallback,e,h,f)})})}},validate:function(d){var c=b("FORM:not([novalidate])",d);if(c.length>0){a.ajax.check(b.fn.validate,a.baseURL+"ext/jquery-validate-1.11.1"+(a.devmode?".js":".min.js"),function(g){if(g){b.validator.setDefaults({highlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(h,i){if(i.parent("label").length){h.insertAfter(i.parent())}else{h.insertAfter(i)}}});if(a.plugins.i18n){for(var e in a.plugins.i18n.validate){var f=a.plugins.i18n.validate[e];if((typeof(f)=="string")&&(f.indexOf("{0}")>-1)){a.plugins.i18n.validate[e]=b.validator.format(f)}}b.extend(b.validator.messages,a.plugins.i18n.validate)}}c.each(function(){var k=b(this);var l=k.data();var i={ignore:null,submitHandler:k.attr("data-async")!==undefined?l.amsFormSubmitHandler===undefined?function(){a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+(a.devmode?".js":".min.js"));return a.form.submit(k)}:a.getFunctionByName(l.amsFormSubmitHandler):undefined};var h=b.extend({},i,l.amsValidateOptions);h=a.executeFunctionByName(l.amsValidateInitCallback,k,h)||h;var j=k.validate(h);a.executeFunctionByName(l.amsValidateAfterInitCallback,k,j,h)})})}},datatable:function(d){var c=b(".datatable",d);if(c.length>0){a.ajax.check(b.fn.dataTable,a.baseURL+"ext/jquery-dataTables-1.9.4"+(a.devmode?".js":".min.js"),function(e){if(e){b.fn.dataTableExt.oSort["numeric-comma-asc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((f<i)?-1:((f>i)?1:0))};b.fn.dataTableExt.oSort["numeric-comma-desc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((f<i)?1:((f>i)?-1:0))}}b(c).each(function(){a.ajax.check(b.fn.dataTableExt.oPagination.bootstrap_full,a.baseURL+"myams-dataTables"+(a.devmode?".js":".min.js"));var s=b(this);var v=s.data();var u=(v.amsDatatableExtensions||"").split(/\s+/);var h=v.amsDatatableSdom||"W"+((u.indexOf("colreorder")>=0||u.indexOf("colreorderwithresize")>=0)?"R":"")+"<'dt-top-row'"+(u.indexOf("colvis")>=0?"C":"")+((v.amsDatatablePagination===false||v.amsDatatablePaginationSize===false)?"":"L")+(v.amsDatatableGlobalFilter===false?"":"F")+">r<'dt-wrapper't"+(u.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'i><'col-sm-6 text-right'p>>";var q={bJQueryUI:false,bFilter:v.amsDatatableGlobalFilter!==false,bPaginate:v.amsDatatablePagination!==false,bInfo:v.amsDatatableInfo!==false,bSort:v.amsDatatableSort!==false,bDeferRender:true,bAutoWidth:false,iDisplayLength:v.amsDatatableDisplayLength||25,sPaginationType:v.amsDatatablePaginationType||"bootstrap_full",sDom:h,oLanguage:a.plugins.i18n.datatables,fnInitComplete:function(y,x){b(".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 t=b.extend({},q,v.amsDatatableOptions);if(u.length>0){for(var j in u){switch(u[j]){case"autofill":a.ajax.check(b.fn.dataTable.AutoFill,a.baseURL+"ext/jquery-dataTables-autoFill"+(a.devmode?".js":".min.js"));break;case"columnfilter":a.ajax.check(b.fn.columnFilter,a.baseURL+"ext/jquery-dataTables-columnFilter"+(a.devmode?".js":".min.js"));break;case"colreorder":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorder"+(a.devmode?".js":".min.js"));break;case"colreorderwithresize":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorderWithResize"+(a.devmode?".js":".min.js"));break;case"colvis":a.ajax.check(b.fn.dataTable.ColVis,a.baseURL+"ext/jquery-dataTables-colVis"+(a.devmode?".js":".min.js"));var m={activate:"click",sAlign:"right"};t.oColVis=b.extend({},m,v.amsDatatableColvisOptions);break;case"fixedcolumns":a.ajax.check(b.fn.dataTable.FixedColumns,a.baseURL+"ext/jquery-dataTables-fixedColumns"+(a.devmode?".js":".min.js"));break;case"fixedheader":a.ajax.check(b.fn.dataTable.FixedHeader,a.baseURL+"ext/jquery-dataTables-fixedHeader"+(a.devmode?".js":".min.js"));break;case"keytable":a.ajax.check(window.KeyTable,a.baseURL+"ext/jquery-dataTables-keyTable"+(a.devmode?".js":".min.js"));break;case"rowgrouping":a.ajax.check(b.fn.rowGrouping,a.baseURL+"ext/jquery-dataTables-rowGrouping"+(a.devmode?".js":".min.js"));break;case"rowreordering":a.ajax.check(b.fn.rowReordering,a.baseURL+"ext/jquery-dataTables-rowReordering"+(a.devmode?".js":".min.js"));break;case"scroller":a.ajax.check(b.fn.dataTable.Scroller,a.baseURL+"ext/jquery-dataTables-scroller"+(a.devmode?".js":".min.js"));break;default:break}}}t=a.executeFunctionByName(v.amsDatatableInitCallback,s,t)||t;var g=s.dataTable(t);a.executeFunctionByName(v.amsDatatableAfterInitCallback,s,g,t);if(u.length>0){for(var j in u){switch(u[j]){case"autofill":var w=b.extend({},v.amsDatatableAutofillOptions,t.autofill);w=a.executeFunctionByName(v.amsDatatableAutofillInitCallback,s,w)||w;s.data("ams-autofill",v.amsDatatableAutofillConstructor===undefined?new b.fn.dataTable.AutoFill(s,w):a.executeFunctionByName(v.amsDatatableAutofillConstructor,s,g,w));break;case"columnfilter":var k={sPlaceHolder:"head:after"};var l=b.extend({},k,v.amsDatatableColumnfilterOptions,t.columnfilter);l=a.executeFunctionByName(v.amsDatatableColumnfilterInitCallback,s,l)||l;s.data("ams-columnfilter",v.amsDatatableColumnfilterConstructor===undefined?g.columnFilter(l):a.executeFunctionByName(v.amsDatatableColumnfilterConstructor,s,g,l));break;case"fixedcolumns":var f=b.extend({},v.amsDatatableFixedcolumnsOptions,t.fixedcolumns);f=a.executeFunctionByName(v.amsDatatableFixedcolumnsInitCallback,s,f)||f;s.data("ams-fixedcolumns",v.amsDatatableFixedcolumnsConstructor===undefined?new b.fn.dataTable.FixedColumns(s,f):a.executeFunctionByName(v.amsDatatableFixedcolumnsConstructor,s,g,f));break;case"fixedheader":var r=b.extend({},v.amsDatatableFixedheaderOptions,t.fixedheader);r=a.executeFunctionByName(v.amsDatatableFixedheadeInitCallback,s,r)||r;s.data("ams-fixedheader",v.amsDatatableFixedheaderConstructor===undefined?new b.fn.dataTable.FixedHeader(s,r):a.executeFunctionByName(v.amsDatatableFixedheaderConstructor,s,g,r));break;case"keytable":var i={table:s.get(0),datatable:g};var p=b.extend({},i,v.amsDatatableKeytableOptions,t.keytable);p=a.executeFunctionByName(v.amsDatatableKeytableInitCallback,s,p)||p;s.data("ams-keytable",v.amsDatatableKeytableConstructor===undefined?new KeyTable(p):a.executeFunctionByName(v.amsDatatableKeytableConstructor,s,g,p));break;case"rowgrouping":var o=b.extend({},v.amsDatatableRowgroupingOptions,t.rowgrouping);o=a.executeFunctionByName(v.amsDatatableRowgroupingInitCallback,s,o)||o;s.data("ams-rowgrouping",v.amsDatatableRowgroupingConstructor===undefined?s.rowGrouping(o):a.executeFunctionByName(v.amsDatatableRowgroupingConstructor,s,g,o));break;case"rowreordering":var n=b.extend({},v.amsDatatableRowreorderingOptions,t.rowreordering);n=a.executeFunctionByName(v.amsDatatableRowreorderingInitCallback,s,n)||n;s.data("ams-rowreordering",v.amsDatatableRowreorderingConstructor===undefined?s.rowReordering(n):a.executeFunctionByName(v.amsDatatableRowreorderingConstructor,s,g,n));break;default:break}}}})})}},graphs:function(d){var c=b(".sparkline",d);if(c.length>0){a.ajax.check(a.graphs,a.baseURL+"myams-graphs"+(a.devmode?".js":".min.js"),function(){a.graphs.init(c)})}},scrollbars:function(c){var d=b(".scrollbar",c);if(d.length>0){a.ajax.check(b.event.special.mousewheel,a.baseURL+"ext/jquery-mousewheel.min.js",function(){a.ajax.check(b.fn.mCustomScrollbar,a.baseURL+"ext/jquery-mCustomScrollbar"+(a.devmode?".js":".min.js"),function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar")}d.each(function(){var j=b(this);var i=j.data();var g={theme:i.amsScrollbarTheme||"light"};var f=b.extend({},g,i.amsScrollbarOptions);f=a.executeFunctionByName(i.amsScrollbarInitCallback,j,f)||f;var h=j.mCustomScrollbar(f);a.executeFunctionByName(i.amsScrollbarAfterInitCallback,j,h,f)})})})}}}};MyAMS.callbacks={init:function(c){b("[data-ams-callback]",c).each(function(){var d=this;var e=b(d).data();var f=a.getFunctionByName(e.amsCallback);if(f===undefined){if(e.amsCallbackSource){a.getScript(e.amsCallbackSource,function(){a.executeFunctionByName(e.amsCallback,d,e.amsCallbackOptions)})}else{if(window.console){console.warn("Undefined callback: "+e.amsCallback)}}}else{f.call(d,e.amsCallbackOptions)}})},alert:function(k){var f=b(this).data();var c=b.extend({},k,f.amsAlertOptions);var i=b(f.amsAlertParent||c.parent||this);var e=f.amsAlertStatus||c.status||"info";var g=f.amsAlertHeader||c.header;var j=f.amsAlertMessage||c.message;var h=f.amsAlertSubtitle||c.subtitle;var d=f.amsAlertMargin===undefined?(c.margin===undefined?false:c.margin):f.amsAlertMargin;a.skin.alert(i,e,g,j,h,d)},messageBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsMessageboxOptions);var e=b.extend({},f,{title:g.amsMessageboxTitle||f.title||"",content:g.amsMessageboxContent||f.content||"",icon:g.amsMessageboxIcon||f.icon,number:g.amsMessageboxNumber||f.number,timeout:g.amsMessageboxTimeout||f.icon});var c=g.amsMessageboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsMessageboxCallback||f.callback);a.skin.messageBox(c,e,h)},smallBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsSmallboxOptions);var e=b.extend({},f,{title:g.amsSmallboxTitle||f.title||"",content:g.amsSmallboxContent||f.content||"",icon:g.amsSmallboxIcon||f.icon,iconSmall:g.amsSmallboxIconSmall||f.iconSmall,timeout:g.amsSmallboxTimeout||f.icon});var c=g.amsSmallboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsSmallboxCallback||f.callback);a.skin.smallBox(c,e,h)}};MyAMS.events={init:function(c){b("[data-ams-events-handlers]",c).each(function(){var e=b(this);var d=e.data("ams-events-handlers");for(var f in d){e.on(f,a.getFunctionByName(d[f]))}})}};MyAMS.skin={_setPageHeight:function(){var e=b("#main").height();var c=a.left_panel.height();var d=b(window).height()-a.navbar_height;if(e>d){a.left_panel.css("min-height",e);a.root.css("min-height",e+a.navbar_height)}else{a.left_panel.css("min-height",d);a.root.css("min-height",d)}},_checkMobileWidth:function(){if(b(window).width()<979){a.root.addClass("mobile-view-activated")}else{if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("mobile-view-activated")}}},_showShortcutButtons:function(){a.shortcuts.animate({height:"show"},200,"easeOutCirc");a.root.addClass("shortcut-on")},_hideShortcutButtons:function(){a.shortcuts.animate({height:"hide"},300,"easeOutCirc");a.root.removeClass("shortcut-on")},checkNotification:function(){$this=b("#activity > .badge");if(parseInt($this.text())>0){$this.removeClass("hidden").addClass("bg-color-red bounceIn animated")}else{$this.addClass("hidden").removeClass("bg-color-red bounceIn animated")}},_initDesktopWidgets:function(c){if(a.enable_widgets){var d=b(".ams-widget",c);if(d.length>0){a.ajax.check(b.fn.MyAMSWidget,a.baseURL+"myams-widgets"+(a.devmode?".js":".min.js"),function(){d.each(function(){var h=b(this);var g=h.data();var f={deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"};var e=b.extend({},f,g.amsWidgetOptions);e=a.executeFunctionByName(g.amsWidgetInitcallback,h,e)||e;h.MyAMSWidget(e)});MyAMSWidget.initWidgetsGrid(b(".ams-widget-grid",c))})}}},_initMobileWidgets:function(c){if(a.enable_mobile&&a.enable_widgets){a.skin._initDesktopWidgets(c)}},alert:function(j,d,e,k,i,c){b(".alert",j).remove();if(d=="error"){var d="danger"}var g='<div class="'+(c?"margin-10":"")+" alert alert-block alert-"+d+' 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> '+e+"</h4>"+(i?("<p>"+i+"</p>"):"")+"<ul>";if(typeof(k)=="string"){g+="<li>"+k+"</li>"}else{for(var f in k){if(!b.isNumeric(f)){continue}g+="<li>"+k[f]+"</li>"}}g+="</ul></div>";var h=b(g).prependTo(j);if(j.exists){a.ajax.check(b.scrollTo,a.baseURL+"ext/jquery-scrollTo.min.js",function(){b.scrollTo(j,{offset:{top:-50}})})}},bigBox:function(c,d){a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){a.notify.messageBox(c,d)})},messageBox:function(c,d,e){if(typeof(c)=="object"){var e=d;var d=c||{};var c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.bigBox(d,e)})},smallBox:function(c,d,e){if(typeof(c)=="object"){var e=d;var d=c||{};var c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.smallBox(d,e)})},_drawBreadCrumb:function(){var c=b("#ribbon OL.breadcrumb");c.empty().append(b("<li></li>").append(b("<a></a>").text(a.i18n.HOME).attr("href",b('nav a[href!="#"]:first').attr("href"))));b("nav LI.active >A").each(function(){var f=b(this);var d=b.trim(f.clone().children(".badge").remove().end().text());var e=b("<li></li>").append(f.attr("href").replace(/^#/,"")?b("<a></a>").html(d).attr("href",f.attr("href")):d);c.append(e)})},checkURL:function(){function c(i){b("nav .active").removeClass("active");i.addClass("open").addClass("active");i.parents("li").addClass("open active").children("ul").addClass("active").show();i.parents("li:first").removeClass("open");i.parents("ul").addClass(i.attr("href").replace(/^#/,"")?"active":"").show()}var f=location.hash;var e=f.replace(/^#/,"");if(e){var d=b("#content");if(!d.exists()){d=b("body")}var g=b('nav A[href="'+f+'"]');if(g.exists()){c(g)}a.skin.loadURL(e,d);document.title=b("[data-ams-page-title]:first",d).data("ams-page-title")||b('nav A[href="'+f+'"]').attr("title")||document.title}else{var h=b("[data-ams-active-menu]").data("ams-active-menu");if(h){g=b('nav A[href="'+h+'"]')}else{g=b('nav >UL >LI >A[href!="#"]').first()}if(g.exists()){c(g);if(h){a.skin._drawBreadCrumb()}else{window.location.hash=g.attr("href")}}}},loadURL:function(e,c,d,h){if(e.startsWith("#")){e=e.substr(1)}if(typeof(d)=="function"){h=d;d={}}var c=b(c);var g={type:"GET",url:e,dataType:"html",cache:false,beforeSend:function(){c.html('<h1><i class="fa fa-cog fa-spin"></i> Loading... </h1>');if(c[0]==b("#content")[0]){a.skin._drawBreadCrumb();document.title=b(".breadcrumb LI:last-child").text();b("html, body").animate({scrollTop:0},"fast")}else{c.animate({scrollTop:0},"fast")}},success:function(m,j,l){if(h){a.executeFunctionByName(h,this,m,j,l,d)}else{var k=a.ajax.getResponse(l);var n=k.content_type;var i=k.data;switch(n){case"json":a.ajax.handleJSON(i,c);break;case"script":break;case"xml":break;case"html":case"text":default:c.parents(".hidden").removeClass("hidden");b(".alert",c.parents(".alerts-container")).remove();c.css({opacity:"0.0"}).html(m).delay(50).animate({opacity:"1.0"},300);a.initContent(c)}}},error:function(k,j,i){c.html('<h3 class="error"><i class="fa fa-warning txt-color-orangeDark"></i> '+a.i18n.ERROR+i+"</h3>"+k.responseText)},async:false};var f=b.extend({},g,d);b.ajax(f)},logout:function(){window.location=a.loginURL}};MyAMS.initPage=function(){a.root=b("BODY");a.left_panel=b("#left-panel");a.shortcuts=b("#shortcut");b(document).ajaxError(a.error.ajax);if(!a.isMobile){a.root.addClass("desktop-detected");a.device="desktop"}else{a.root.addClass("mobile-detected");a.device="mobile";if(a.enable_fastclick){a.ajax.check(b.fn.noClickDelay,a.baseURL+"/ext/jquery-smartclick"+(a.devmode?".js":".min.js"),function(){b("NAV UL A").noClickDelay();b("#hide-menu A").noClickDelay()})}}b("#hide-menu >:first-child > A").click(function(c){b("BODY").toggleClass("hidden-menu");c.preventDefault()});b("#show-shortcut").click(function(c){if(a.shortcuts.is(":visible")){a.skin._hideShortcutButtons()}else{a.skin._showShortcutButtons()}c.preventDefault()});b(document).mouseup(function(c){if(!a.shortcuts.is(c.target)&&a.shortcuts.has(c.target).length===0){a.skin._hideShortcutButtons()}});b("#search-mobile").click(function(){a.root.addClass("search-mobile")});b("#cancel-search-js").click(function(){a.root.removeClass("search-mobile")});b("#activity").click(function(d){var c=b(this);var f=c.next(".ajax-dropdown");if(!f.is(":visible")){f.css("left",c.position().left-f.innerWidth()/2+c.innerWidth()/2).fadeIn(150);c.addClass("active")}else{f.fadeOut(150);c.removeClass("active")}d.preventDefault()});a.skin.checkNotification();b(document).mouseup(function(c){var d=b(".ajax-dropdown");if(!d.is(c.target)&&d.has(c.target).length===0){d.fadeOut(150).prev().removeClass("active")}});b('input[name="activity"]').change(function(){var c=b(this).data("ams-url");container=b(".ajax-notifications");a.skin.loadURL(c,container)});b("#logout a").click(function(c){c.preventDefault();a.loginURL=b(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>"+b("#show-shortcut").text()+"</strong></span> ?",content:a.i18n.LOGOUT_COMMENT,buttons:"["+a.i18n.BTN_NO+"]["+a.i18n.BTN_YES+"]"},function(d){if(d==a.i18n.BTN_YES){a.root.addClass("animated fadeOutUp");setTimeout(a.skin.logout,1000)}})});b("NAV UL").myams_menu({accordion:true,speed:a.menu_speed});b(".minifyme").click(function(c){b("BODY").toggleClass("minified");b(this).effect("highlight",{},500);c.preventDefault()});b("#refresh").click(function(c){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(d){if(d==a.i18n.BTN_OK&&localStorage){localStorage.clear();location.reload()}});c.preventDefault()});b("BODY").on("click",function(d){var c=b(this);if(!c.is(d.target)&&c.has(d.target).length===0&&b(".popover").has(d.target).length===0){c.popover("hide")}});a.ajax.check(b.resize,a.baseURL+"ext/jquery-resize"+(a.devmode?".js":".min.js"),function(){b("#main").resize(function(){a.skin._setPageHeight();a.skin._checkMobileWidth()});b("nav").resize(function(){a.skin._setPageHeight()})});if(a.ajax_nav){if(b("nav").length>0){a.skin.checkURL()}b(document).on("click",'a[href="#"]',function(c){c.preventDefault()});b(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(g){var d=b(g.currentTarget);var c=d.attr("href")||d.data("ams-url");if(!c||c.startsWith("javascript:")||d.attr("target")){return}g.preventDefault();var f=d.data("ams-target");if(f){a.skin.loadURL(c,f,d.data("ams-link-options"),d.data("ams-link-callback"))}else{if(c.startsWith("#")){if(c!=location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=c},150)}else{window.location.hash=c}}}else{window.location=c}}});b(document).on("click",'a[target="_blank"]',function(c){c.preventDefault();window.open(b(c.currentTarget).attr("href"))});b(document).on("click",'a[target="_top"]',function(c){c.preventDefault();window.location=b(c.currentTarget).attr("href")});b(window).on("hashchange",a.skin.checkURL)}b(document).off("click.modal").on("click",'[data-toggle="modal"]',function(d){d.preventDefault();var c=b(this);a.dialog.open(c);if(c.parents("#shortcut").exists()){setTimeout(a.skin._hideShortcutButtons,300)}});b(document).on("shown.bs.modal",a.dialog.shown);b(document).on("click",'button[type="submit"], button.submit',function(){var c=b(this);b(c.get(0).form).data("ams-submit-button",c)});b(document).on("click","[data-ams-click-handler]",function(f){var d=b(this);var c=d.data();if(c.amsClickHandler){if(c.amsClickKeepDefault!==true){f.preventDefault()}var g=a.getFunctionByName(c.amsClickHandler);if(g!==undefined){g.call(d,c.amsClickHandlerOptions)}}});b(document).on("change","[data-ams-change-handler]",function(f){var d=b(this);var c=d.data();if(c.amsChangeHandler){if(c.amsChangeKeepDefault!==true){f.preventDefault()}var g=a.getFunctionByName(c.amsChangeHandler);if(g!==undefined){g.call(d,c.amsChangeHandlerOptions)}}});b(document).on("change",'input[type="file"]',function(f){f.preventDefault();var c=b(this);var d=c.parent(".button");if(d.exists()&&d.parent().hasClass("input-file")){d.next('input[type="text"]').val(c.val())}});b("a[data-toggle=tab]",".nav-tabs").on("click",function(c){if(b(this).parent("li").hasClass("disabled")){c.preventDefault();return false}});b(document).on("show.bs.tab",function(f){var c=b(f.target);var d=c.data();if(d.amsUrl){if(d.amsTabLoaded){return}a.skin.loadURL(d.amsUrl,c.attr("href"));if(d.amsTabLoadOnce){c.data("ams-tab-loaded",true)}}});a.plugins.enabled.hint(document);if((window.location.hash=="")||(a.getQueryVar(window.location.href,"came_from")!=false)){a.initContent(document)}};MyAMS.initContent=function(c){b(".tipsy").remove();b("[rel=tooltip]",c).tooltip();b("[rel=popover]",c).popover();b("[rel=popover-hover]",c).popover({trigger:"hover"});a.plugins.init(c);a.callbacks.init(c);a.events.init(c);if(a.device==="desktop"){a.skin._initDesktopWidgets(c)}else{a.skin._initMobileWidgets(c)}a.skin._setPageHeight()};MyAMS.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",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_YES:"Yes",BTN_NO:"No",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_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}",DT_COLUMNS:"Columns"};b(document).ready(function(){b=jQuery.noConflict();var c=b("HTML").attr("lang")||b("HTML").attr("xml:lang");if(c&&!c.startsWith("en")){MyAMS.getScript(MyAMS.baseURL+"i18n/myams_"+c.substr(0,2)+".js",function(){MyAMS.initPage()})}else{MyAMS.initPage()}})})(jQuery);
\ No newline at end of file
+(function(b){String.prototype.startsWith=function(e){var c=this.length;var d=e.length;if(c<d){return false}return(this.substr(0,d)==e)};String.prototype.endsWith=function(e){var c=this.length;var d=e.length;if(c<d){return false}return(this.substr(c-d)==e)};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(d){var c=this.length;var e=Number(arguments[1])||0;e=(e<0)?Math.ceil(e):Math.floor(e);if(e<0){e+=c}for(;e<c;e++){if(e in this&&this[e]===d){return e}}return -1}}b.expr[":"].econtains=function(e,c,d){return(e.textContent||e.innerText||b(e).text()||"").toLowerCase()==d[3].toLowerCase()};b.expr[":"].withtext=function(e,c,d){return(e.textContent||e.innerText||b(e).text()||"")==d[3]};b.expr[":"].parents=function(e,c,d){return b(e).parents(d[3]).length>0};if(b.scrollbarWidth===undefined){b.scrollbarWidth=function(){var d,e,c;if(c===undefined){d=b('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body");e=d.children();c=e.innerWidth()-e.height(99).innerWidth();d.remove()}return c}}b.fn.extend({exists:function(){return b(this).length>0},style:function(d,g,c){var f=this.get(0);if(typeof f=="undefined"){return}var e=this.get(0).style;if(typeof d!="undefined"){if(typeof g!="undefined"){c=typeof c!="undefined"?c:"";e.setProperty(d,g,c);return this}else{return e.getPropertyValue(d)}}else{return e}},removeClassPrefix:function(c){this.each(function(e,f){var d=f.className.split(" ").map(function(g){return g.startsWith(c)?"":g});f.className=b.trim(d.join(" "))});return this},myams_menu:function(c){var e={accordion:"true",speed:200,closedSign:'<em class="fa fa-angle-down"></em>',openedSign:'<em class="fa fa-angle-up"></em>'};var d=b.extend({},e,c);var f=b(this);f.find("LI").each(function(){var g=b(this);if(g.find("UL").size()>0){g.find("A:first").append("<b class='collapse-sign'>"+d.closedSign+"</b>");var h=g.find("A:first");if(h.attr("href")=="#"){h.click(function(){return false})}}});f.find("LI.active").each(function(){var g=b(this).parents("UL");var h=g.parent("LI");g.slideDown(d.speed);h.find("b:first").html(d.openedSign);h.addClass("open")});f.find("LI A").on("click",function(){var j=b(this);var g=j.parent().find("UL");if(g.size()!=0){if(d.accordion){if(!g.is(":visible")){var i=j.parent().parents("UL");var k=f.find("UL:visible");k.each(function(l){var m=true;i.each(function(n){if(i[n]==k[l]){m=false;return false}});if(m){if(g!=k[l]){b(k[l]).slideUp(d.speed,function(){j.parent("LI").find("b:first").html(d.closedSign);j.parent("LI").removeClass("open")})}}})}}var h=j.parent().find("UL:first");if(!j.attr("href").replace(/^#/,"")&&h.is(":visible")&&!h.hasClass("active")){h.slideUp(d.speed,function(){j.parent("LI").removeClass("open").find("B:first").delay(d.speed).html(d.closedSign)})}else{h.slideDown(d.speed,function(){j.parent("LI").addClass("open").find("B:first").delay(d.speed).html(d.openedSign)})}}})}});b.UTF8={encode:function(e){e=e.replace(/\r\n/g,"\n");var d="";for(var g=0;g<e.length;g++){var f=e.charCodeAt(g);if(f<128){d+=String.fromCharCode(f)}else{if((f>127)&&(f<2048)){d+=String.fromCharCode((f>>6)|192);d+=String.fromCharCode((f&63)|128)}else{d+=String.fromCharCode((f>>12)|224);d+=String.fromCharCode(((f>>6)&63)|128);d+=String.fromCharCode((f&63)|128)}}}return d},decode:function(d){var f="";var h=0,j=0,g=0,e=0;while(h<d.length){j=d.charCodeAt(h);if(j<128){f+=String.fromCharCode(j);h++}else{if((j>191)&&(j<224)){g=d.charCodeAt(h+1);f+=String.fromCharCode(((j&31)<<6)|(g&63));h+=2}else{g=d.charCodeAt(h+1);e=d.charCodeAt(h+2);f+=String.fromCharCode(((j&15)<<12)|((g&63)<<6)|(e&63));h+=3}}}return f}};if(window.MyAMS===undefined){window.MyAMS={devmode:true,throttle_delay:350,menu_speed:235,navbar_height:49,ajax_nav:true,enable_widgets:true,enable_mobile:false,enable_fastclick:false,ismobile:(/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()))}}var a=MyAMS;MyAMS.baseURL=(function(){var c=b("script:last");var d=c.attr("src");return d.substring(0,d.lastIndexOf("/")+1)})();MyAMS.getQueryVar=function(e,f){if(e.indexOf("?")<0){return false}if(!e.endsWith("&")){e+="&"}var c=new RegExp(".*?[&\\?]"+f+"=(.*?)&.*");var d=e.replace(c,"$1");return d==e?false:d};MyAMS.rgb2hex=function(c){return"#"+b.map(c.match(/\b(\d+)\b/g),function(d){return("0"+parseInt(d).toString(16)).slice(-2)}).join("")};MyAMS.generateId=function(){function c(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return c()+c()+c()+c()};MyAMS.getFunctionByName=function(h,d){if(h===undefined){return undefined}else{if(typeof(h)=="function"){return h}}var g=h.split(".");var f=g.pop();d=(d===undefined||d===null)?window:d;for(var c=0;c<g.length;c++){try{d=d[g[c]]}catch(j){return undefined}}try{return d[f]}catch(j){return undefined}};MyAMS.executeFunctionByName=function(f,d){var e=a.getFunctionByName(f,window);if(typeof(e)=="function"){var c=Array.prototype.slice.call(arguments,2);return e.apply(d,c)}};MyAMS.getSource=function(c){return c.replace(/{[^{}]*}/g,function(d){return a.getFunctionByName(d.substr(1,d.length-2))})};MyAMS.getScript=function(d,g,c){var f={dataType:"script",url:a.getSource(d),success:g,error:a.error.show,cache:true,async:true};var e=b.extend({},f,c);return b.ajax(e)};MyAMS.getCSS=function(c,f){var e=b("HEAD");var d=b('link[data-ams-id="'+f+'"]',e);if(d.length==0){b("<link />").attr({rel:"stylesheet",type:"text/css",href:a.getSource(c),"data-ams-id":f}).appendTo(e)}};MyAMS.event={stop:function(c){if(!c){c=window.event}if(c){if(c.stopPropagation){c.stopPropagation();c.preventDefault()}else{c.cancelBubble=true;c.returnValue=false}}}};MyAMS.browser={getInternetExplorerVersion:function(){var e=-1;if(navigator.appName=="Microsoft Internet Explorer"){var c=navigator.userAgent;var d=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(d.exec(c)!=null){e=parseFloat(RegExp.$1)}}return e},checkVersion:function(){var d="You're not using Windows Internet Explorer.";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=8){d="You're using a recent copy of Windows Internet Explorer."}else{d="You should upgrade your copy of Windows Internet Explorer."}}alert(d)},isIE8orlower:function(){var d="0";var c=this.getInternetExplorerVersion();if(c>-1){if(c>=9){d=0}else{d=1}}return d}};MyAMS.error={ajax:function(d,c){if(c.statusText=="OK"){return}a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+d.type+"</h4><p>"+c.statusText+"</p>",icon:"fa fa-warning animated shake",timeout:10000});if(window.console){console.error(d);console.debug(c)}},show:function(e,c,d){if(!d){return}a.skin.messageBox("error",{title:a.i18n.ERRORS_OCCURED,content:"<h4>"+c+"</h4><p>"+d+"</p>",icon:"fa fa-warning animated shake",timeout:10000});if(window.console){console.error(d);console.debug(e)}}};MyAMS.ajax={check:function(d,f,h,c){if(typeof(h)=="object"){c=h;h=undefined}var g={async:typeof(h)=="function"};var e=b.extend({},g,c);if(d===undefined){a.getScript(f,function(){if(typeof(h)=="function"){h(true,c)}},e)}else{if(typeof(h)=="function"){h(false,c)}}},getAddr:function(d){var c=d||b("HTML HEAD BASE").attr("href")||window.location.href;return c.substr(0,c.lastIndexOf("/")+1)},post:function(e,g,d,j){if(e.startsWith(window.location.protocol)){var i=e}else{i=this.getAddr()+e}if(typeof(d)=="function"){j=d;d={}}else{if(!d){d={}}}if(typeof(j)=="undefined"){j=d.callback}if(typeof(j)=="string"){j=a.getFunctionByName(j)}delete d.callback;var c=undefined;var h={url:i,type:"post",cache:false,async:typeof(j)=="function",data:b.param(g,true),dataType:"json",success:j||function(k){c=k.result},error:a.error.show};var f=b.extend({},h,d);b.ajax(f);return c},getResponse:function(f){var d=f.getResponseHeader("content-type"),h,c;if(d.startsWith("application/javascript")){h="script";c=f.responseText}else{if(d.startsWith("text/html")){h="html";c=f.responseText}else{if(d.startsWith("text/xml")){h="xml";c=f.responseText}else{c=f.responseJSON;if(c){h="json"}else{try{c=JSON.parse(f.responseText);h="json"}catch(g){c=f.responseText;h="text"}}}}}return{content_type:h,data:c}},handleJSON:function(k,e){var f=k.status;var c;switch(f){case"error":a.form.showErrors(e,k);break;case"success":if(k.close_form!=false){a.dialog.close(e)}break;case"message":case"messagebox":break;case"callback":case"callbacks":if(k.close_form!=false){a.dialog.close(e)}break;case"modal":a.dialog.open(k.location);break;case"reload":if(k.close_form!=false){a.dialog.close(e)}c=k.location;if(c.startsWith("#")){a.skin.loadURL(c.substr(1),k.target||"#content")}else{a.skin.loadURL(c,k.target||"#content")}break;case"redirect":c=k.location;if(k.window){window.open(c,k.window,k.options)}else{window.location.href=c}break;default:console.log("Unhandled status: "+f);break}if(k.content){var h=k.content;var d=b(h.target||e||"#content");d.html(h.html);a.initContent(d)}if(k.message){var j=k.message;if(typeof(j)=="string"){a.skin.alert(b(e||"#content"),f,"",j)}else{a.skin.alert(b(j.target||e||"#content"),j.status||"success",j.header,j.body,j.subtitle)}}if(k.messagebox){j=k.messagebox;if(typeof(j)=="string"){a.skin.messageBox("info",{title:a.i18n.ERROR_OCCURED,content:j,timeout:10000})}else{a.skin.messageBox(j.status||"info",{title:j.title||a.i18n.ERROR_OCCURED,content:j.content,icon:j.icon,number:j.number,timeout:j.timeout||10000})}}if(k.callback){a.executeFunctionByName(k.callback,e,k.options)}if(k.callbacks){for(var g in k.callbacks){if(!b.isNumeric(g)){continue}var i=k.callbacks[g];a.executeFunctionByName(i,e,i.options)}}}};MyAMS.jsonrpc={getAddr:function(e){var c=e||b("HTML HEAD BASE").attr("href")||window.location.href;var d=c.replace(/\+\+skin\+\+\w+\//,"");return d.substr(0,d.lastIndexOf("/")+1)},query:function(d,f,c,e){a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){var g;if(typeof(c)=="function"){e=c;c={}}else{if(!c){c={}}}if(typeof(e)=="undefined"){e=c.callback}if(typeof(e)=="string"){e=a.getFunctionByName(e)}delete c.callback;var i={};if(typeof(d)=="string"){i.query=d}else{if(typeof(d)=="object"){b.extend(i,d)}}b.extend(i,c);var h={url:a.jsonrpc.getAddr(c.url),type:"post",cache:false,method:f,params:i,async:typeof(e)=="function",success:e||function(k,j){g=k.result},error:a.error.show};b.jsonRpc(h);return g})},post:function(e,c,d){a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){var f;if(typeof(c)=="function"){d=c;c={}}else{if(!c){c={}}}if(typeof(d)=="undefined"){d=c.callback}if(typeof(d)=="string"){d=a.getFunctionByName(d)}delete c.callback;var g={url:a.jsonrpc.getAddr(c.url),type:"post",cache:false,method:e,params:c,async:typeof(d)=="function",success:d||function(i,h){f=i.result},error:a.error.show};b.jsonRpc(g);return f})}};MyAMS.form={submit:function(e,d,f){e=b(e);if(!e.exists()){return false}if(typeof(d)=="object"){f=d;d=undefined}if(e.data("submitted")){a.skin.messageBox("warning",{title:a.i18n.WAIT,content:a.i18n.FORM_SUBMITTED,icon:"fa fa-save shake animated",timeout:5000});return false}if(!a.form._checkSubmitValidators(e)){return false}b(".alert, SPAN.state-error",e).remove();b(".state-error",e).removeClassPrefix("state-");var c=b(e.data("ams-submit-button"));if(c){c.button("loading")}a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+(a.devmode?".js":".min.js"),function(){function i(l,x){var q=l.data();var m=q.amsFormOptions;if(f){var v=f.formDataInitCallback}if(v){delete f.formDataInitCallback}else{v=q.amsFormDataInitCallback}if(v){if(typeof(v)=="function"){var t=v.call(l)}else{t=a.executeFunctionByName(v,l)}}else{t=q.amsFormData||{}}var r=b(l.data("ams-submit-button"));var w,s;if(r){w=r.data("ams-form-handler");s=r.data("ams-form-submit-target")}var p=l.attr("action").replace(/#/,"");if(p.startsWith(window.location.protocol)){var k=p}else{k=a.ajax.getAddr()+p}k+=d||w||q.amsFormHandler||"";if(q.amsFormInitSubmitTarget){var u=b(s||q.amsFormSubmitTarget||"#content");a.executeFunctionByName(q.amsFormInitSubmit||"MyAMS.form.initSubmit",l,u)}else{if(!q.amsFormHideSubmitFooter){a.executeFunctionByName(q.amsFormInitSubmit||"MyAMS.form.initSubmitFooter",l)}}var j=typeof(x.uuid)!="undefined";if(j){if(k.indexOf("X-Progress-ID")<0){k+="?X-Progress-ID="+x.uuid}delete x.uuid}var o={url:k,type:"post",cache:false,data:t,dataType:q.amsFormDatatype,beforeSerialize:function(){if(typeof(tinyMCE)!="undefined"){tinyMCE.triggerSave()}},beforeSubmit:function(z,y){y.data("submitted",true)},error:function(B,y,z){a.error.show(B,y,z);if(l.is(":visible")){var A=l.data("ams-submit-button");if(A){A.button("reset")}a.form.finalizeSubmitFooter.call(l)}l.data("submitted",false);l.removeData("ams-submit-button")},success:function(y,z,C,B){var D;var A=B.data("ams-submit-button");if(A){D=A.data("ams-form-submit-callback")}if(!D){D=a.getFunctionByName(q.amsFormSubmitCallback)||a.form._submitCallback}D.call(B,y,z,C,B);if(B.is(":visible")&&A){A.button("reset")}B.data("submitted",false);B.removeData("ams-submit-button")},iframe:j};var n=b.extend({},o,x,m,f);b(l).ajaxSubmit(n)}var h=b('INPUT[type="file"]',e).length>0;if(h){a.ajax.check(b.progressBar,a.baseURL+"ext/jquery-progressbar"+(a.devmode?".js":".min.js"));var g=b.extend({},{uuid:b.progressBar.submit(e)});i(e,g)}else{i(e,{})}});return false},initSubmit:function(e,d){var c=b(this);var f='<i class="fa fa-3x fa-gear fa-spin"></i>';if(!d){d=c.data("ams-form-submit-message")}if(d){f+="<strong>"+d+"</strong>"}b(e).html('<div class="row margin-20"><div class="text-center">'+f+"</div></div>");b(e).parents(".hidden").removeClass("hidden")},initSubmitFooter:function(d){var c=b(this);var f='<i class="fa fa-3x fa-gear fa-spin"></i>';if(!d){d=b(this).data("ams-form-submit-message")}if(d){f+='<strong class="submit-message align-top padding-left-10 margin-top-10">'+d+"</strong>"}var e=b("footer",c);b("button",e).hide();e.append('<div class="row"><div class="text-center">'+f+"</div></div>")},finalizeSubmitFooter:function(d){var c=b(this);var e=b("footer",c);if(e){b(".row",e).remove();b("button",e).show()}},_submitCallback:function(m,e,d,c){if(c.is(":visible")){a.form.finalizeSubmitFooter.call(c);var g=c.data("ams-submit-button");if(g){g.button("reset")}}var f=c.data();if(f.amsFormDatatype){var j=f.amsFormDatatype}else{var h=a.ajax.getResponse(d);j=h.content_type;m=h.data}switch(j){case"json":a.ajax.handleJSON(m,c);break;case"script":break;case"xml":break;case"html":case"text":default:if(g&&(g.data("ams-keep-modal")!==true)){a.dialog.close(c)}if(g){var i=b(g.amsFormSubmitTarget||f.amsFormSubmitTarget||"#content")}else{i=b(f.amsFormSubmitTarget||"#content")}if(!i.exists()){i=b("body")}i.parents(".hidden").removeClass("hidden");b(".alert",i.parents(".alerts-container")).remove();i.css({opacity:"0.0"}).html(m).delay(50).animate({opacity:"1.0"},300);a.initContent(i)}var k=d.getResponseHeader("X-AMS-Callback");if(k){var l=d.getResponseHeader("X-AMS-Callback-Options");a.executeFunctionByName(k,c,l===undefined?{}:JSON.parse(l))}},_getSubmitValidators:function(d){var c=new Array();var e=d.data("ams-form-validator");if(e){c.push([d,e])}b("[data-ams-form-validator]",d).each(function(){var f=b(this);c.push([f,f.data("ams-form-validator")])});return c},_checkSubmitValidators:function(e){var g=a.form._getSubmitValidators(e);if(!g.length){return true}var f=new Array();var l=true;for(var i in g){if(!b.isNumeric(i)){continue}var d=g[i];var c=d[0];var j=d[1];var k=a.executeFunctionByName(j,e,c);if(k===false){l=false}else{if(typeof(k)=="string"){f.push(k)}else{if(l.length&&(l.length>0)){f=f.concat(l)}}}}if(f.length>0){var h=f.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(e,"danger",h,f);return false}else{return l}},showErrors:function(e,h){if(typeof(h)=="string"){a.skin.alert(e,"error",a.i18n.ERROR_OCCURED,h)}else{if(h instanceof Array){var g=h.length==1?a.i18n.ERROR_OCCURED:a.i18n.ERRORS_OCCURED;a.skin.alert(e,"error",g,h)}else{g=h.widgets&&(h.widgets.length>1)?a.i18n.ERRORS_OCCURED:a.i18n.ERROR_OCCURED;var d=new Array();var c;for(c in h.messages){if(!b.isNumeric(c)){continue}d.push(h.messages[c].message||h.messages[c])}for(c in h.widgets){if(!b.isNumeric(c)){continue}var f=h.widgets[c];b('[name="'+f.name+'"]',e).parent("label").removeClassPrefix("state-").addClass("state-error").after('<span for="name" class="state-error">'+f.message+"</span>");if(f.label){d.push(f.label+" : "+f.message)}}a.skin.alert(e,"error",g,d,h.error_message)}}}};MyAMS.dialog={open:function(d,c){a.ajax.check(b.fn.modalmanager,a.baseURL+"ext/bootstrap-modalmanager"+(a.devmode?".js":".min.js"),function(){a.ajax.check(b.fn.modal.defaults,a.baseURL+"ext/bootstrap-modal"+(a.devmode?".js":".min.js"),function(f){if(f){b(document).off("click.modal");b.fn.modal.defaults.spinner=b.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>'}if(typeof(d)=="string"){var e=d}else{e=d.attr("href")||d.data("ams-url")}if(!e){return}b("body").modalmanager("loading");if(e.indexOf("#")==0){b(e).modal("show")}else{b.get(e,c,function(j,i,h){b("body").modalmanager("removeLoading");var k=a.ajax.getResponse(h);var p=k.content_type;var q=k.data;switch(p){case"json":a.ajax.handleJSON(q,b(b(d).data("ams-json-target")||"#content"));break;case"script":break;case"xml":break;case"html":case"text":default:var l=b(q);var n=b(".modal-dialog",l.wrap("<div></div>").parent());var m=n.data();var o={overflow:m.amsModalOverflow||".modal-viewport",maxHeight:m.amsModalMaxHeight===undefined?function(){return b(window).height()-b(".modal-header",l).outerHeight(true)-b("footer",l).outerHeight(true)-85}:a.getFunctionByName(m.amsModalMaxHeight)};var g=b.extend({},o,m.amsModalOptions);g=a.executeFunctionByName(m.amsModalInitCallback,n,g)||g;b("<div>").addClass("modal fade").append(l).modal(g);a.initContent(l)}})}})})},shown:function(i){function h(k){var l=b(".scrollmarker.top",c);var j=c.scrollTop();if(j>0){l.show()}else{l.hide()}var e=b(".scrollmarker.bottom",c);if(f+j>=c.get(0).scrollHeight){e.hide()}else{e.show()}}var g=i.target;var c=b(".modal-viewport",g);if(c.length==0){return}var f=parseInt(c.css("max-height"));var d=b.scrollbarWidth();if(c.height()==f){b("<div></div>").addClass("scrollmarker").addClass("top").css("top",0).css("width",c.width()-d).hide().appendTo(c);b("<div></div>").addClass("scrollmarker").addClass("bottom").css("top",f-20).css("width",c.width()-d).appendTo(c);c.scroll(h);c.off("resize").on("resize",h)}else{b(".scrollmarker",c).remove()}},close:function(d){var e=d.parents(".modal").data("modal");if(e){var c=b("body").data("modalmanager");if(c&&(c.getOpenModals().indexOf(e)>=0)){e.hide()}}}};MyAMS.helpers={select2FormatSelection:function(d,c){if(d instanceof Array){b(d).each(function(){if(typeof(this)=="object"){c.append(this.text)}else{c.append(this)}})}else{if(typeof(d)=="object"){c.append(d.text)}else{c.append(d)}}},select2QueryUrlResultsCallback:function(e,d,c){switch(e.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+e.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:10000});break;default:return{results:e.results||e,more:e.has_more||false,context:e.context}}},select2QueryMethodSuccessCallback:function(f,d,e){var c=f.result;switch(c.status){case"error":a.skin.messageBox("error",{title:a.i18n.ERROR_OCCURED,content:"<h4>"+c.error_message+"</h4>",icon:"fa fa-warning animated shake",timeout:10000});break;default:e.callback({results:c.results||c,more:c.has_more||false,context:c.context})}}};MyAMS.plugins={init:function(e){a.plugins.initData(e);var f=new Array();b("[data-ams-plugins-disabled]",e).each(function(){var h=b(this).data("ams-plugins-disabled").split(/\s+/);for(var i in h){f.push(h[i])}});for(var d in a.plugins.enabled){if(f.indexOf(d)>=0){continue}var g=a.plugins.enabled[d];if(typeof(g)=="function"){g(e)}}var c;b("[data-ams-plugins]",e).each(function(){var l=b(this);var h={};if(typeof(l.data("ams-plugins"))==="string"){var m=l.data("ams-plugins").split(/\s+/);for(var j in m){c=m[j];var i={src:l.data("ams-plugin-"+c+"-src"),css:l.data("ams-plugin-"+c+"-css"),callback:l.data("ams-plugin-"+c+"-callback"),register:l.data("ams-plugin-"+c+"-register"),async:l.data("ams-plugin-"+c+"-async")};h[c]=i}}else{h=l.data("ams-plugins")}for(c in h){if(a.plugins.enabled[c]===undefined){var k=h[c];a.getScript(k.src,function(){var p=k.callback;if(p){var o=a.getFunctionByName(p);if(typeof(o)=="function"){o(e)}if(k.register!==false){a.plugins.enabled[c]=o}}else{if(k.register!==false){a.plugins.enabled[c]=null}}var n=k.css;if(n){a.getCSS(n,c+"_css")}},{async:k.async===undefined?true:k.async})}}})},initData:function(c){b("[data-ams-data]",c).each(function(){var e=b(this);var f=e.data("ams-data");for(var d in f){e.attr("data-"+d,f[d])}})},enabled:{hint:function(c){var d=b(".hint:not(:parents(.nohints))",c);if(d.length>0){a.ajax.check(b.fn.tipsy,a.baseURL+"ext/jquery-tipsy"+(a.devmode?".js":".min.js"),function(){a.getCSS(a.baseURL+"../css/ext/jquery-tipsy"+(a.devmode?".css":".min.css"),"jquery-tipsy");d.each(function(){var i=b(this);var h=i.data();var f={html:h.amsHintHtml,title:a.getFunctionByName(h.amsHintTitleGetter)||function(){var j=b(this);return j.attr("original-title")||j.attr(h.amsHintTitleAttr||"title")||(h.amsHintHtml?j.html():j.text())},opacity:h.amsHintOpacity,gravity:h.amsHintGravity||"sw",offset:h.amsHintOffset||0};var e=b.extend({},f,h.amsHintOptions);e=a.executeFunctionByName(h.amsHintInitCallback,i,e)||e;var g=i.tipsy(e);a.executeFunctionByName(h.amsHintAfterInitCallback,i,g,e)})})}},switcher:function(c){b("LEGEND.switcher",c).each(function(){var e=b(this);var d=e.parent("fieldset");var f=e.data();if(!f.amsSwitcher){b('<i class="fa fa-fw"></i>').prependTo(b(this)).addClass(f.amsSwitcherState=="open"?(f.amsSwitcherMinusClass||"fa-minus"):(f.amsSwitcherPlusClass||"fa-plus"));e.on("click",function(h){h.preventDefault();var g={};e.trigger("ams.switcher.before-switch",[e,g]);if(g.veto){return}if(d.hasClass("switched")){d.removeClass("switched");b(".fa",e).removeClass(f.amsSwitcherPlusClass||"fa-plus").addClass(f.amsSwitcherMinusClass||"fa-minus");e.trigger("ams.switcher.opened",[e])}else{d.addClass("switched");b(".fa",e).removeClass(f.amsSwitcherMinusClass||"fa-minus").addClass(f.amsSwitcherPlusClass||"fa-plus");e.trigger("ams.switcher.closed",[e])}});if(f.amsSwitcherState!="open"){d.addClass("switched")}e.data("ams-switcher","on")}})},checker:function(c){b("LEGEND.checker",c).each(function(){var g=b(this);var d=g.parent("fieldset");var h=g.data();if(!h.amsChecker){var f=b('<label class="checkbox"></label>');var e=b('<input type="checkbox">').attr("name",h.amsCheckerFieldname).attr("id",(h.amsCheckerFieldname||("checker_"+a.generateId())).replace(/\./,"_")).val(h.amsCheckerState=="on").on("change",function(j){j.preventDefault();var i={};g.trigger("ams.checker.before-switch",[g,i]);if(i.veto){return}if(b(this).is(":checked")){if(h.amsCheckerMode=="disable"){d.removeAttr("disabled")}else{d.removeClass("switched")}g.trigger("ams.checker.opened",[g])}else{if(h.amsCheckerMode=="disable"){d.attr("disabled","disabled")}else{d.addClass("switched")}g.trigger("ams.checker.closed",[g])}}).appendTo(f);b(".legend",g).attr("for",e.attr("id"));f.append("<i></i>").prependTo(g);if(h.amsCheckerState=="on"){e.attr("checked",true)}else{d.addClass("switched")}g.data("ams-checker","on")}})},slider:function(c){var d=b(".slider",c);if(d.length>0){a.ajax.check(b.fn.slider,a.baseURL+"ext/bootstrap-slider.min.js",function(){d.each(function(){var h=b(this);var i=h.data();var f={};var e=b.extend({},f,h.data.amsSliderOptions);e=a.executeFunctionByName(i.amsSliderInitCallback,h,e)||e;var g=h.slider(e);a.executeFunctionByName(i.amsSliderAfterInitCallback,h,g,e)})})}},select2:function(d){var c=b(".select2",d);if(c.length>0){a.ajax.check(b.fn.select2,a.baseURL+"ext/jquery-select2-3.4.5"+(a.devmode?".js":".min.js"),function(){c.each(function(){var e=b(this);var j=e.data();var h={placeholder:j.amsSelect2Placeholder,multiple:j.amsSelect2Multiple,minimumInputLength:j.amsSelect2MinimumInputLength||0,maximumSelectionSize:j.amsSelect2MaximumSelectionSize,openOnEnter:j.amsSelect2EnterOpen===undefined?true:j.amsSelect2EnterOpen,allowClear:j.amsSelect2AllowClear===undefined?true:j.amsSelect2AllowClear,width:j.amsSelect2Width||"100%",initSelection:a.getFunctionByName(j.amsSelect2InitSelection),formatSelection:j.amsSelect2FormatSelection===undefined?a.helpers.select2FormatSelection:a.getFunctionByName(j.amsSelect2FormatSelection),formatResult:a.getFunctionByName(j.amsSelect2FormatResult),formatNoMatches:j.amsSelect2FormatResult===undefined?function(k){return a.i18n.SELECT2_NOMATCHES}:a.getFunctionByName(j.amsSelect2FormatResult),formatInputTooShort:j.amsSelect2FormatInputTooShort===undefined?function(k,l){var m=l-k.length;return a.i18n.SELECT2_INPUT_TOOSHORT.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooShort),formatInputTooLong:j.amsSelect2FormatInputTooLong===undefined?function(l,k){var m=l.length-k;return a.i18n.SELECT2_INPUT_TOOLONG.replace(/\{0\}/,m).replace(/\{1\}/,m==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatInputTooLong),formatSelectionTooBig:j.amsSelect2FormatSelectionTooBig===undefined?function(k){return a.i18n.SELECT2_SELECTION_TOOBIG.replace(/\{0\}/,k).replace(/\{1\}/,k==1?"":a.i18n.SELECT2_PLURAL)}:a.getFunctionByName(j.amsSelect2FormatSelectionTooBig),formatLoadMore:j.amsSelect2FormatLoadMore===undefined?function(k){return a.i18n.SELECT2_LOADMORE}:a.getFunctionByName(j.amsSelect2FormatLoadMore),formatSearching:j.amsSelect2FormatSearching===undefined?function(){return a.i18n.SELECT2_SEARCHING}:a.getFunctionByName(j.amsSelect2FormatSearching),separator:j.amsSelect2Separator||",",tokenSeparators:j.amsSelect2TokensSeparators||[","],tokenizer:a.getFunctionByName(j.amsSelect2Tokenizer)};switch(e.context.type){case"text":case"hidden":if(!h.initSelection){var f=e.data("ams-select2-values");if(f){h.initSelection=function(k,m){var l=[];b(k.val().split(h.separator)).each(function(){l.push({id:this,text:f[this]||this})});m(l)}}}break;default:break}if(j.amsSelect2Query){h.query=a.getFunctionByName(j.amsSelect2Query);h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryUrl){h.ajax={url:j.amsSelect2QueryUrl,quietMillis:j.amsSelect2QuietMillis||200,type:j.amsSelect2QueryType||"POST",dataType:j.amsSelect2QueryDatatype||"json",data:function(m,n,l){var k={};k[j.amsSelect2QueryParamName||"query"]=m;k[j.amsSelect2PageParamName||"page"]=n;k[j.amsSelect2ContextParamName||"context"]=l;return b.extend({},k,j.amsSelect2QueryOptions)},results:a.helpers.select2QueryUrlResultsCallback};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2QueryMethod){h.query=function(k){var l={url:j.amsSelect2MethodTarget||a.jsonrpc.getAddr(),type:j.amsSelect2MethodType||"POST",cache:false,method:j.amsSelect2QueryMethod,params:j.amsSelect2QueryParams||{},success:function(n,m){return a.helpers.select2QueryMethodSuccessCallback(n,m,k)},error:a.error.show};l.params[j.amsSelect2QueryParamName||"query"]=k.term;l.params[j.amsSelect2PageParamName||"page"]=k.page;l.params[j.amsSelect2ContextParamName||"context"]=k.context;l=b.extend({},l,j.amsSelect2QueryOptions);l=a.executeFunctionByName(j.amsSelect2QueryInitCallback,e,l)||l;a.ajax.check(b.jsonRpc,a.baseURL+"ext/jquery-jsonrpc"+(a.devmode?".js":".min.js"),function(){b.jsonRpc(l)})};h.minimumInputLength=j.amsSelect2MinimumInputLength||1}else{if(j.amsSelect2Tags){h.tags=j.amsSelect2Tags}else{if(j.amsSelect2Data){h.data=j.amsSelect2Data}}}}}if(j.amsSelect2EnableFreeTags){h.createSearchChoice=function(k){return{id:k,text:k}}}var g=b.extend({},h,j.amsSelect2Options);g=a.executeFunctionByName(j.amsSelect2InitCallback,e,g)||g;var i=e.select2(g);a.executeFunctionByName(j.amsSelect2AfterInitCallback,e,i,g);e.on("change",function(){var k=b(e.get(0).form).data("validator");if(k!==undefined){b(e).valid()}})})})}},maskedit:function(d){var c=b("[data-mask]",d);if(c.length>0){a.ajax.check(b.fn.mask,a.baseURL+"ext/jquery-maskedinput-1.3.1.min.js",function(){c.each(function(){var e=b(this);var i=e.data();var g={placeholder:i.amsMaskeditPlaceholder||"X"};var f=b.extend({},g,i.amsMaskeditOptions);f=a.executeFunctionByName(i.amsMaskeditInitCallback,e,f)||f;var h=e.mask(e.attr("data-mask"),f);a.executeFunctionByName(i.amsMaskeditAfterInitCallback,e,h,f)})})}},datepicker:function(c){var d=b(".datepicker",c);if(d.length>0){d.each(function(){var e=b(this);var i=e.data();var g={dateFormat:i.amsDatepickerFormat||"dd/mm/yy",prevText:'<i class="fa fa-chevron-left"></i>',nextText:'<i class="fa fa-chevron-right"></i>',changeMonth:i.amsDatepickerChangeMonth,changeYear:i.amsDatepickerChangeYear,showButtonPanel:!i.amsDatepickerHidePanel};var f=b.extend({},g,i.amsDatepickerOptions);f=a.executeFunctionByName(i.amsDatepickerInitCallback,e,f)||f;var h=e.datepicker(f);a.executeFunctionByName(i.amsDatepickerAfterInitCallback,e,h,f)})}},typeahead:function(d){var c=b(".typeahead",d);if(c.length>0){a.ajax.check(b.fn.typeahead,a.baseURL+"ext/jquery-typeahead"+(a.devmode?".js":".min.js"),function(){c.each(function(){var e=b(this);var i=e.data();var g={};var f=b.extend({},g,i.amsTypeaheadOptions);f=a.executeFunctionByName(i.amsTypeaheadInitCallback,e,f)||f;var h=e.typeahead(f);a.executeFunctionByName(i.amsTypeaheadAfterInitCallback,e,h,f)})})}},validate:function(d){var c=b("FORM:not([novalidate])",d);if(c.length>0){a.ajax.check(b.fn.validate,a.baseURL+"ext/jquery-validate-1.11.1"+(a.devmode?".js":".min.js"),function(g){if(g){b.validator.setDefaults({highlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").addClass("state-error")},unhighlight:function(h){b(h).closest(".form-group, label:not(:parents(.form-group))").removeClass("state-error")},errorElement:"span",errorClass:"state-error",errorPlacement:function(h,i){if(i.parent("label").length){h.insertAfter(i.parent())}else{h.insertAfter(i)}}});if(a.plugins.i18n){for(var e in a.plugins.i18n.validate){var f=a.plugins.i18n.validate[e];if((typeof(f)=="string")&&(f.indexOf("{0}")>-1)){a.plugins.i18n.validate[e]=b.validator.format(f)}}b.extend(b.validator.messages,a.plugins.i18n.validate)}}c.each(function(){var k=b(this);var l=k.data();var i={ignore:null,submitHandler:k.attr("data-async")!==undefined?l.amsFormSubmitHandler===undefined?function(){a.ajax.check(b.fn.ajaxSubmit,a.baseURL+"ext/jquery-form-3.49"+(a.devmode?".js":".min.js"));return a.form.submit(k)}:a.getFunctionByName(l.amsFormSubmitHandler):undefined};var h=b.extend({},i,l.amsValidateOptions);h=a.executeFunctionByName(l.amsValidateInitCallback,k,h)||h;var j=k.validate(h);a.executeFunctionByName(l.amsValidateAfterInitCallback,k,j,h)})})}},datatable:function(d){var c=b(".datatable",d);if(c.length>0){a.ajax.check(b.fn.dataTable,a.baseURL+"ext/jquery-dataTables-1.9.4"+(a.devmode?".js":".min.js"),function(e){if(e){b.fn.dataTableExt.oSort["numeric-comma-asc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((f<i)?-1:((f>i)?1:0))};b.fn.dataTableExt.oSort["numeric-comma-desc"]=function(h,g){var f=h.replace(/,/,".").replace(/ /g,"");var i=g.replace(/,/,".").replace(/ /g,"");f=parseFloat(f);i=parseFloat(i);return((f<i)?1:((f>i)?-1:0))}}b(c).each(function(){a.ajax.check(b.fn.dataTableExt.oPagination.bootstrap_full,a.baseURL+"myams-dataTables"+(a.devmode?".js":".min.js"));var s=b(this);var v=s.data();var u=(v.amsDatatableExtensions||"").split(/\s+/);var h=v.amsDatatableSdom||"W"+((u.indexOf("colreorder")>=0||u.indexOf("colreorderwithresize")>=0)?"R":"")+"<'dt-top-row'"+(u.indexOf("colvis")>=0?"C":"")+((v.amsDatatablePagination===false||v.amsDatatablePaginationSize===false)?"":"L")+(v.amsDatatableGlobalFilter===false?"":"F")+">r<'dt-wrapper't"+(u.indexOf("scroller")>=0?"S":"")+"><'dt-row dt-bottom-row'<'row'<'col-sm-6'i><'col-sm-6 text-right'p>>";var q={bJQueryUI:false,bFilter:v.amsDatatableGlobalFilter!==false,bPaginate:v.amsDatatablePagination!==false,bInfo:v.amsDatatableInfo!==false,bSort:v.amsDatatableSort!==false,bDeferRender:true,bAutoWidth:false,iDisplayLength:v.amsDatatableDisplayLength||25,sPaginationType:v.amsDatatablePaginationType||"bootstrap_full",sDom:h,oLanguage:a.plugins.i18n.datatables,fnInitComplete:function(y,x){b(".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 t=b.extend({},q,v.amsDatatableOptions);var j;if(u.length>0){for(j in u){switch(u[j]){case"autofill":a.ajax.check(b.fn.dataTable.AutoFill,a.baseURL+"ext/jquery-dataTables-autoFill"+(a.devmode?".js":".min.js"));break;case"columnfilter":a.ajax.check(b.fn.columnFilter,a.baseURL+"ext/jquery-dataTables-columnFilter"+(a.devmode?".js":".min.js"));break;case"colreorder":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorder"+(a.devmode?".js":".min.js"));break;case"colreorderwithresize":a.ajax.check(b.fn.dataTable.ColReorder,a.baseURL+"ext/jquery-dataTables-colReorderWithResize"+(a.devmode?".js":".min.js"));break;case"colvis":a.ajax.check(b.fn.dataTable.ColVis,a.baseURL+"ext/jquery-dataTables-colVis"+(a.devmode?".js":".min.js"));var m={activate:"click",sAlign:"right"};t.oColVis=b.extend({},m,v.amsDatatableColvisOptions);break;case"fixedcolumns":a.ajax.check(b.fn.dataTable.FixedColumns,a.baseURL+"ext/jquery-dataTables-fixedColumns"+(a.devmode?".js":".min.js"));break;case"fixedheader":a.ajax.check(b.fn.dataTable.FixedHeader,a.baseURL+"ext/jquery-dataTables-fixedHeader"+(a.devmode?".js":".min.js"));break;case"keytable":a.ajax.check(window.KeyTable,a.baseURL+"ext/jquery-dataTables-keyTable"+(a.devmode?".js":".min.js"));break;case"rowgrouping":a.ajax.check(b.fn.rowGrouping,a.baseURL+"ext/jquery-dataTables-rowGrouping"+(a.devmode?".js":".min.js"));break;case"rowreordering":a.ajax.check(b.fn.rowReordering,a.baseURL+"ext/jquery-dataTables-rowReordering"+(a.devmode?".js":".min.js"));break;case"scroller":a.ajax.check(b.fn.dataTable.Scroller,a.baseURL+"ext/jquery-dataTables-scroller"+(a.devmode?".js":".min.js"));break;default:break}}}t=a.executeFunctionByName(v.amsDatatableInitCallback,s,t)||t;var g=s.dataTable(t);a.executeFunctionByName(v.amsDatatableAfterInitCallback,s,g,t);if(u.length>0){for(j in u){switch(u[j]){case"autofill":var w=b.extend({},v.amsDatatableAutofillOptions,t.autofill);w=a.executeFunctionByName(v.amsDatatableAutofillInitCallback,s,w)||w;s.data("ams-autofill",v.amsDatatableAutofillConstructor===undefined?new b.fn.dataTable.AutoFill(s,w):a.executeFunctionByName(v.amsDatatableAutofillConstructor,s,g,w));break;case"columnfilter":var k={sPlaceHolder:"head:after"};var l=b.extend({},k,v.amsDatatableColumnfilterOptions,t.columnfilter);l=a.executeFunctionByName(v.amsDatatableColumnfilterInitCallback,s,l)||l;s.data("ams-columnfilter",v.amsDatatableColumnfilterConstructor===undefined?g.columnFilter(l):a.executeFunctionByName(v.amsDatatableColumnfilterConstructor,s,g,l));break;case"fixedcolumns":var f=b.extend({},v.amsDatatableFixedcolumnsOptions,t.fixedcolumns);f=a.executeFunctionByName(v.amsDatatableFixedcolumnsInitCallback,s,f)||f;s.data("ams-fixedcolumns",v.amsDatatableFixedcolumnsConstructor===undefined?new b.fn.dataTable.FixedColumns(s,f):a.executeFunctionByName(v.amsDatatableFixedcolumnsConstructor,s,g,f));break;case"fixedheader":var r=b.extend({},v.amsDatatableFixedheaderOptions,t.fixedheader);r=a.executeFunctionByName(v.amsDatatableFixedheadeInitCallback,s,r)||r;s.data("ams-fixedheader",v.amsDatatableFixedheaderConstructor===undefined?new b.fn.dataTable.FixedHeader(s,r):a.executeFunctionByName(v.amsDatatableFixedheaderConstructor,s,g,r));break;case"keytable":var i={table:s.get(0),datatable:g};var p=b.extend({},i,v.amsDatatableKeytableOptions,t.keytable);p=a.executeFunctionByName(v.amsDatatableKeytableInitCallback,s,p)||p;s.data("ams-keytable",v.amsDatatableKeytableConstructor===undefined?new KeyTable(p):a.executeFunctionByName(v.amsDatatableKeytableConstructor,s,g,p));break;case"rowgrouping":var o=b.extend({},v.amsDatatableRowgroupingOptions,t.rowgrouping);o=a.executeFunctionByName(v.amsDatatableRowgroupingInitCallback,s,o)||o;s.data("ams-rowgrouping",v.amsDatatableRowgroupingConstructor===undefined?s.rowGrouping(o):a.executeFunctionByName(v.amsDatatableRowgroupingConstructor,s,g,o));break;case"rowreordering":var n=b.extend({},v.amsDatatableRowreorderingOptions,t.rowreordering);n=a.executeFunctionByName(v.amsDatatableRowreorderingInitCallback,s,n)||n;s.data("ams-rowreordering",v.amsDatatableRowreorderingConstructor===undefined?s.rowReordering(n):a.executeFunctionByName(v.amsDatatableRowreorderingConstructor,s,g,n));break;default:break}}}})})}},graphs:function(d){var c=b(".sparkline",d);if(c.length>0){a.ajax.check(a.graphs,a.baseURL+"myams-graphs"+(a.devmode?".js":".min.js"),function(){a.graphs.init(c)})}},scrollbars:function(c){var d=b(".scrollbar",c);if(d.length>0){a.ajax.check(b.event.special.mousewheel,a.baseURL+"ext/jquery-mousewheel.min.js",function(){a.ajax.check(b.fn.mCustomScrollbar,a.baseURL+"ext/jquery-mCustomScrollbar"+(a.devmode?".js":".min.js"),function(e){if(e){a.getCSS(a.baseURL+"../css/ext/jquery-mCustomScrollbar.css","jquery-mCustomScrollbar")}d.each(function(){var j=b(this);var i=j.data();var g={theme:i.amsScrollbarTheme||"light"};var f=b.extend({},g,i.amsScrollbarOptions);f=a.executeFunctionByName(i.amsScrollbarInitCallback,j,f)||f;var h=j.mCustomScrollbar(f);a.executeFunctionByName(i.amsScrollbarAfterInitCallback,j,h,f)})})})}}}};MyAMS.callbacks={init:function(c){b("[data-ams-callback]",c).each(function(){var d=this;var e=b(d).data();var f=a.getFunctionByName(e.amsCallback);if(f===undefined){if(e.amsCallbackSource){a.getScript(e.amsCallbackSource,function(){a.executeFunctionByName(e.amsCallback,d,e.amsCallbackOptions)})}else{if(window.console){console.warn("Undefined callback: "+e.amsCallback)}}}else{f.call(d,e.amsCallbackOptions)}})},alert:function(k){var f=b(this).data();var c=b.extend({},k,f.amsAlertOptions);var i=b(f.amsAlertParent||c.parent||this);var e=f.amsAlertStatus||c.status||"info";var g=f.amsAlertHeader||c.header;var j=f.amsAlertMessage||c.message;var h=f.amsAlertSubtitle||c.subtitle;var d=f.amsAlertMargin===undefined?(c.margin===undefined?false:c.margin):f.amsAlertMargin;a.skin.alert(i,e,g,j,h,d)},messageBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsMessageboxOptions);var e=b.extend({},f,{title:g.amsMessageboxTitle||f.title||"",content:g.amsMessageboxContent||f.content||"",icon:g.amsMessageboxIcon||f.icon,number:g.amsMessageboxNumber||f.number,timeout:g.amsMessageboxTimeout||f.icon});var c=g.amsMessageboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsMessageboxCallback||f.callback);a.skin.messageBox(c,e,h)},smallBox:function(d){var g=b(this).data();var f=b.extend({},d,g.amsSmallboxOptions);var e=b.extend({},f,{title:g.amsSmallboxTitle||f.title||"",content:g.amsSmallboxContent||f.content||"",icon:g.amsSmallboxIcon||f.icon,iconSmall:g.amsSmallboxIconSmall||f.iconSmall,timeout:g.amsSmallboxTimeout||f.icon});var c=g.amsSmallboxStatus||f.status||"info";var h=a.getFunctionByName(g.amsSmallboxCallback||f.callback);a.skin.smallBox(c,e,h)}};MyAMS.events={init:function(c){b("[data-ams-events-handlers]",c).each(function(){var e=b(this);var d=e.data("ams-events-handlers");for(var f in d){e.on(f,a.getFunctionByName(d[f]))}})}};MyAMS.skin={_setPageHeight:function(){var e=b("#main").height();var c=a.left_panel.height();var d=b(window).height()-a.navbar_height;if(e>d){a.left_panel.css("min-height",e);a.root.css("min-height",e+a.navbar_height)}else{a.left_panel.css("min-height",d);a.root.css("min-height",d)}},_checkMobileWidth:function(){if(b(window).width()<979){a.root.addClass("mobile-view-activated")}else{if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("mobile-view-activated")}}},_showShortcutButtons:function(){a.shortcuts.animate({height:"show"},200,"easeOutCirc");a.root.addClass("shortcut-on")},_hideShortcutButtons:function(){a.shortcuts.animate({height:"hide"},300,"easeOutCirc");a.root.removeClass("shortcut-on")},checkNotification:function(){$this=b("#activity > .badge");if(parseInt($this.text())>0){$this.removeClass("hidden").addClass("bg-color-red bounceIn animated")}else{$this.addClass("hidden").removeClass("bg-color-red bounceIn animated")}},_initDesktopWidgets:function(c){if(a.enable_widgets){var d=b(".ams-widget",c);if(d.length>0){a.ajax.check(b.fn.MyAMSWidget,a.baseURL+"myams-widgets"+(a.devmode?".js":".min.js"),function(){d.each(function(){var h=b(this);var g=h.data();var f={deleteSettingsKey:"#deletesettingskey-options",deletePositionKey:"#deletepositionkey-options"};var e=b.extend({},f,g.amsWidgetOptions);e=a.executeFunctionByName(g.amsWidgetInitcallback,h,e)||e;h.MyAMSWidget(e)});MyAMSWidget.initWidgetsGrid(b(".ams-widget-grid",c))})}}},_initMobileWidgets:function(c){if(a.enable_mobile&&a.enable_widgets){a.skin._initDesktopWidgets(c)}},alert:function(j,d,e,k,i,c){b(".alert",j).remove();if(d=="error"){d="danger"}var g='<div class="'+(c?"margin-10":"")+" alert alert-block alert-"+d+' 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> '+e+"</h4>"+(i?("<p>"+i+"</p>"):"")+"<ul>";if(typeof(k)=="string"){g+="<li>"+k+"</li>"}else{for(var f in k){if(!b.isNumeric(f)){continue}g+="<li>"+k[f]+"</li>"}}g+="</ul></div>";var h=b(g).prependTo(j);if(j.exists){a.ajax.check(b.scrollTo,a.baseURL+"ext/jquery-scrollTo.min.js",function(){b.scrollTo(j,{offset:{top:-50}})})}},bigBox:function(c,d){a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){a.notify.messageBox(c,d)})},messageBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.bigBox(d,e)})},smallBox:function(c,d,e){if(typeof(c)=="object"){e=d;d=c||{};c="info"}a.ajax.check(a.notify,a.baseURL+"myams-notify"+(a.devmode?".js":".min.js"),function(){switch(c){case"error":case"danger":d.color="#C46A69";break;case"warning":d.color="#C79121";break;case"success":d.color="#739E73";break;default:d.color=d.color||"#3276B1"}d.sound=false;a.notify.smallBox(d,e)})},_drawBreadCrumb:function(){var c=b("#ribbon OL.breadcrumb");c.empty().append(b("<li></li>").append(b("<a></a>").text(a.i18n.HOME).attr("href",b('nav a[href!="#"]:first').attr("href"))));b("nav LI.active >A").each(function(){var f=b(this);var d=b.trim(f.clone().children(".badge").remove().end().text());var e=b("<li></li>").append(f.attr("href").replace(/^#/,"")?b("<a></a>").html(d).attr("href",f.attr("href")):d);c.append(e)})},checkURL:function(){function c(i){b("nav .active").removeClass("active");i.addClass("open").addClass("active");i.parents("li").addClass("open active").children("ul").addClass("active").show();i.parents("li:first").removeClass("open");i.parents("ul").addClass(i.attr("href").replace(/^#/,"")?"active":"").show()}var f=location.hash;var e=f.replace(/^#/,"");if(e){var d=b("#content");if(!d.exists()){d=b("body")}var g=b('nav A[href="'+f+'"]');if(g.exists()){c(g)}a.skin.loadURL(e,d);document.title=b("[data-ams-page-title]:first",d).data("ams-page-title")||b('nav A[href="'+f+'"]').attr("title")||document.title}else{var h=b("[data-ams-active-menu]").data("ams-active-menu");if(h){g=b('nav A[href="'+h+'"]')}else{g=b('nav >UL >LI >A[href!="#"]').first()}if(g.exists()){c(g);if(h){a.skin._drawBreadCrumb()}else{window.location.hash=g.attr("href")}}}},loadURL:function(e,c,d,h){if(e.startsWith("#")){e=e.substr(1)}if(typeof(d)=="function"){h=d;d={}}c=b(c);var g={type:"GET",url:e,dataType:"html",cache:false,beforeSend:function(){c.html('<h1><i class="fa fa-cog fa-spin"></i> Loading... </h1>');if(c[0]==b("#content")[0]){a.skin._drawBreadCrumb();document.title=b(".breadcrumb LI:last-child").text();b("html, body").animate({scrollTop:0},"fast")}else{c.animate({scrollTop:0},"fast")}},success:function(m,j,l){if(h){a.executeFunctionByName(h,this,m,j,l,d)}else{var k=a.ajax.getResponse(l);var n=k.content_type;var i=k.data;switch(n){case"json":a.ajax.handleJSON(i,c);break;case"script":break;case"xml":break;case"html":case"text":default:c.parents(".hidden").removeClass("hidden");b(".alert",c.parents(".alerts-container")).remove();c.css({opacity:"0.0"}).html(m).delay(50).animate({opacity:"1.0"},300);a.initContent(c)}}},error:function(k,j,i){c.html('<h3 class="error"><i class="fa fa-warning txt-color-orangeDark"></i> '+a.i18n.ERROR+i+"</h3>"+k.responseText)},async:false};var f=b.extend({},g,d);b.ajax(f)},logout:function(){window.location=a.loginURL}};MyAMS.initPage=function(){a.root=b("BODY");a.left_panel=b("#left-panel");a.shortcuts=b("#shortcut");b(document).ajaxError(a.error.ajax);if(!a.isMobile){a.root.addClass("desktop-detected");a.device="desktop"}else{a.root.addClass("mobile-detected");a.device="mobile";if(a.enable_fastclick){a.ajax.check(b.fn.noClickDelay,a.baseURL+"/ext/jquery-smartclick"+(a.devmode?".js":".min.js"),function(){b("NAV UL A").noClickDelay();b("#hide-menu A").noClickDelay()})}}b("#hide-menu >:first-child > A").click(function(c){b("BODY").toggleClass("hidden-menu");c.preventDefault()});b("#show-shortcut").click(function(c){if(a.shortcuts.is(":visible")){a.skin._hideShortcutButtons()}else{a.skin._showShortcutButtons()}c.preventDefault()});b(document).mouseup(function(c){if(!a.shortcuts.is(c.target)&&a.shortcuts.has(c.target).length===0){a.skin._hideShortcutButtons()}});b("#search-mobile").click(function(){a.root.addClass("search-mobile")});b("#cancel-search-js").click(function(){a.root.removeClass("search-mobile")});b("#activity").click(function(d){var c=b(this);var f=c.next(".ajax-dropdown");if(!f.is(":visible")){f.css("left",c.position().left-f.innerWidth()/2+c.innerWidth()/2).fadeIn(150);c.addClass("active")}else{f.fadeOut(150);c.removeClass("active")}d.preventDefault()});a.skin.checkNotification();b(document).mouseup(function(c){var d=b(".ajax-dropdown");if(!d.is(c.target)&&d.has(c.target).length===0){d.fadeOut(150).prev().removeClass("active")}});b('input[name="activity"]').change(function(){var c=b(this).data("ams-url");container=b(".ajax-notifications");a.skin.loadURL(c,container)});b("#logout a").click(function(c){c.preventDefault();a.loginURL=b(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>"+b("#show-shortcut").text()+"</strong></span> ?",content:a.i18n.LOGOUT_COMMENT,buttons:"["+a.i18n.BTN_NO+"]["+a.i18n.BTN_YES+"]"},function(d){if(d==a.i18n.BTN_YES){a.root.addClass("animated fadeOutUp");setTimeout(a.skin.logout,1000)}})});b("NAV UL").myams_menu({accordion:true,speed:a.menu_speed});b(".minifyme").click(function(c){b("BODY").toggleClass("minified");b(this).effect("highlight",{},500);c.preventDefault()});b("#refresh").click(function(c){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(d){if(d==a.i18n.BTN_OK&&localStorage){localStorage.clear();location.reload()}});c.preventDefault()});b("BODY").on("click",function(d){var c=b(this);if(!c.is(d.target)&&c.has(d.target).length===0&&b(".popover").has(d.target).length===0){c.popover("hide")}});a.ajax.check(b.resize,a.baseURL+"ext/jquery-resize"+(a.devmode?".js":".min.js"),function(){b("#main").resize(function(){a.skin._setPageHeight();a.skin._checkMobileWidth()});b("nav").resize(function(){a.skin._setPageHeight()})});if(a.ajax_nav){if(b("nav").length>0){a.skin.checkURL()}b(document).on("click",'a[href="#"]',function(c){c.preventDefault()});b(document).on("click",'a[href!="#"]:not([data-toggle]), [data-ams-url]:not([data-toggle])',function(g){var d=b(g.currentTarget);var c=d.attr("href")||d.data("ams-url");if(!c||c.startsWith("javascript:")||d.attr("target")){return}g.preventDefault();var f=d.data("ams-target");if(f){a.skin.loadURL(c,f,d.data("ams-link-options"),d.data("ams-link-callback"))}else{if(c.startsWith("#")){if(c!=location.hash){if(a.root.hasClass("mobile-view-activated")){a.root.removeClass("hidden-menu");window.setTimeout(function(){window.location.hash=c},150)}else{window.location.hash=c}}}else{window.location=c}}});b(document).on("click",'a[target="_blank"]',function(c){c.preventDefault();window.open(b(c.currentTarget).attr("href"))});b(document).on("click",'a[target="_top"]',function(c){c.preventDefault();window.location=b(c.currentTarget).attr("href")});b(window).on("hashchange",a.skin.checkURL)}b(document).off("click.modal").on("click",'[data-toggle="modal"]',function(d){d.preventDefault();var c=b(this);a.dialog.open(c);if(c.parents("#shortcut").exists()){setTimeout(a.skin._hideShortcutButtons,300)}});b(document).on("shown.bs.modal",a.dialog.shown);b(document).on("click",'button[type="submit"], button.submit',function(){var c=b(this);b(c.get(0).form).data("ams-submit-button",c)});b(document).on("click","[data-ams-click-handler]",function(f){var d=b(this);var c=d.data();if(c.amsClickHandler){if(c.amsClickKeepDefault!==true){f.preventDefault()}var g=a.getFunctionByName(c.amsClickHandler);if(g!==undefined){g.call(d,c.amsClickHandlerOptions)}}});b(document).on("change","[data-ams-change-handler]",function(f){var d=b(this);var c=d.data();if(c.amsChangeHandler){if(c.amsChangeKeepDefault!==true){f.preventDefault()}var g=a.getFunctionByName(c.amsChangeHandler);if(g!==undefined){g.call(d,c.amsChangeHandlerOptions)}}});b(document).on("change",'input[type="file"]',function(f){f.preventDefault();var c=b(this);var d=c.parent(".button");if(d.exists()&&d.parent().hasClass("input-file")){d.next('input[type="text"]').val(c.val())}});b("a[data-toggle=tab]",".nav-tabs").on("click",function(c){if(b(this).parent("li").hasClass("disabled")){c.preventDefault();return false}});b(document).on("show.bs.tab",function(f){var c=b(f.target);var d=c.data();if(d.amsUrl){if(d.amsTabLoaded){return}a.skin.loadURL(d.amsUrl,c.attr("href"));if(d.amsTabLoadOnce){c.data("ams-tab-loaded",true)}}});a.plugins.enabled.hint(document);if((window.location.hash=="")||(a.getQueryVar(window.location.href,"came_from")!=false)){a.initContent(document)}};MyAMS.initContent=function(c){b(".tipsy").remove();b("[rel=tooltip]",c).tooltip();b("[rel=popover]",c).popover();b("[rel=popover-hover]",c).popover({trigger:"hover"});a.plugins.init(c);a.callbacks.init(c);a.events.init(c);if(a.device==="desktop"){a.skin._initDesktopWidgets(c)}else{a.skin._initMobileWidgets(c)}a.skin._setPageHeight()};MyAMS.i18n={INFO:"Information",WARNING:"!! WARNING !!",ERROR:"ERROR: ",WAIT:"Please wait!",FORM_SUBMITTED:"This form was already submitted...",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_YES:"Yes",BTN_NO:"No",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_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}",DT_COLUMNS:"Columns"};b(document).ready(function(){b=jQuery.noConflict();var c=b("HTML").attr("lang")||b("HTML").attr("xml:lang");if(c&&!c.startsWith("en")){MyAMS.getScript(MyAMS.baseURL+"i18n/myams_"+c.substr(0,2)+".js",function(){MyAMS.initPage()})}else{MyAMS.initPage()}})})(jQuery);
\ No newline at end of file