text: /*
      
      
  
       Creative Tim Modifications
       
       Lines: 239, 240 was changed from top: 5px to top: 50% and we added margin-top: -13px. In this way the close button will be aligned vertically 
       Line:242 - modified when the icon is set, we add the class "alert-with-icon", so there will be enough space for the icon.
  
  
  
  
  */
  
  
  /*
  * Project: Bootstrap Notify = v3.1.5
  * Description: Turns standard Bootstrap alerts into "Growl-like" notifications.
  * Author: Mouse0270 aka Robert McIntosh
  * License: MIT License
  * Website: https://github.com/mouse0270/bootstrap-growl
  */
  
  /* global define:false, require: false, jQuery:false */
  
  (function (factory) {
  	if (typeof define === 'function' && define.amd) {
  		// AMD. Register as an anonymous module.
  		define(['jquery'], factory);
  	} else if (typeof exports === 'object') {
  		// Node/CommonJS
  		factory(require('jquery'));
  	} else {
  		// Browser globals
  		factory(jQuery);
  	}
  }(function ($) {
  	// Create the defaults once
  	var defaults = {
  		element: 'body',
  		position: null,
  		type: "info",
  		allow_dismiss: true,
  		allow_duplicates: true,
  		newest_on_top: false,
  		showProgressbar: false,
  		placement: {
  			from: "top",
  			align: "right"
  		},
  		offset: 20,
  		spacing: 10,
  		z_index: 1031,
  		delay: 5000,
  		timer: 1000,
  		url_target: '_blank',
  		mouse_over: null,
  		animate: {
  			enter: 'animated fadeInDown',
  			exit: 'animated fadeOutUp'
  		},
  		onShow: null,
  		onShown: null,
  		onClose: null,
  		onClosed: null,
  		icon_type: 'class',
  		template: '<div data-notify="container" class="col-xs-11 col-sm-4 alert alert-{0}" role="alert"><button type="button" aria-hidden="true" class="close" data-notify="dismiss">&times;</button><span data-notify="icon"></span> <span data-notify="title">{1}</span> <span data-notify="message">{2}</span><div class="progress" data-notify="progressbar"><div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div></div><a href="{3}" target="{4}" data-notify="url"></a></div>'
  	};
  
  	String.format = function () {
  		var str = arguments[0];
  		for (var i = 1; i < arguments.length; i++) {
  			str = str.replace(RegExp("\\{" + (i - 1) + "\\}", "gm"), arguments[i]);
  		}
  		return str;
  	};
  
  	function isDuplicateNotification(notification) {
  		var isDupe = false;
  
  		$('[data-notify="container"]').each(function (i, el) {
  			var $el = $(el);
  			var title = $el.find('[data-notify="title"]').text().trim();
  			var message = $el.find('[data-notify="message"]').html().trim();
  
  			// The input string might be different than the actual parsed HTML string!
  			// (<br> vs <br /> for example)
  			// So we have to force-parse this as HTML here!
  			var isSameTitle = title === $("<div>" + notification.settings.content.title + "</div>").html().trim();
  			var isSameMsg = message === $("<div>" + notification.settings.content.message + "</div>").html().trim();
  			var isSameType = $el.hasClass('alert-' + notification.settings.type);
  
  			if (isSameTitle && isSameMsg && isSameType) {
  				//we found the dupe. Set the var and stop checking.
  				isDupe = true;
  			}
  			return !isDupe;
  		});
  
  		return isDupe;
  	}
  
  	function Notify(element, content, options) {
  		// Setup Content of Notify
  		var contentObj = {
  			content: {
  				message: typeof content === 'object' ? content.message : content,
  				title: content.title ? content.title : '',
  				icon: content.icon ? content.icon : '',
  				url: content.url ? content.url : '#',
  				target: content.target ? content.target : '-'
  			}
  		};
  
  		options = $.extend(true, {}, contentObj, options);
  		this.settings = $.extend(true, {}, defaults, options);
  		this._defaults = defaults;
  		if (this.settings.content.target === "-") {
  			this.settings.content.target = this.settings.url_target;
  		}
  		this.animations = {
  			start: 'webkitAnimationStart oanimationstart MSAnimationStart animationstart',
  			end: 'webkitAnimationEnd oanimationend MSAnimationEnd animationend'
  		};
  
  		if (typeof this.settings.offset === 'number') {
  			this.settings.offset = {
  				x: this.settings.offset,
  				y: this.settings.offset
  			};
  		}
  
  		//if duplicate messages are not allowed, then only continue if this new message is not a duplicate of one that it already showing
  		if (this.settings.allow_duplicates || (!this.settings.allow_duplicates && !isDuplicateNotification(this))) {
  			this.init();
  		}
  	}
  	
  	$.extend(Notify.prototype, {
  		init: function () {
  			var self = this;
  
  			this.buildNotify();
  			if (this.settings.content.icon) {
  				this.setIcon();
  			}
  			if (this.settings.content.url != "#") {
  				this.styleURL();
  			}
  			this.styleDismiss();
  			this.placement();
  			this.bind();
  
  			this.notify = {
  				$ele: this.$ele,
  				update: function (command, update) {
  					var commands = {};
  					if (typeof command === "string") {
  						commands[command] = update;
  					} else {
  						commands = command;
  					}
  					for (var cmd in commands) {
  						switch (cmd) {
  							case "type":
  								this.$ele.removeClass('alert-' + self.settings.type);
  								this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass('progress-bar-' + self.settings.type);
  								self.settings.type = commands[cmd];
  								this.$ele.addClass('alert-' + commands[cmd]).find('[data-notify="progressbar"] > .progress-bar').addClass('progress-bar-' + commands[cmd]);
  								break;
  							case "icon":
  								var $icon = this.$ele.find('[data-notify="icon"]');
  								if (self.settings.icon_type.toLowerCase() === 'class') {
  									$icon.removeClass(self.settings.content.icon).addClass(commands[cmd]);
  								} else {
  									if (!$icon.is('img')) {
  										$icon.find('img');
  									}
  									$icon.attr('src', commands[cmd]);
  								}
  								break;
  							case "progress":
  								var newDelay = self.settings.delay - (self.settings.delay * (commands[cmd] / 100));
  								this.$ele.data('notify-delay', newDelay);
  								this.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', commands[cmd]).css('width', commands[cmd] + '%');
  								break;
  							case "url":
  								this.$ele.find('[data-notify="url"]').attr('href', commands[cmd]);
  								break;
  							case "target":
  								this.$ele.find('[data-notify="url"]').attr('target', commands[cmd]);
  								break;
  							default:
  								this.$ele.find('[data-notify="' + cmd + '"]').html(commands[cmd]);
  						}
  					}
  					var posX = this.$ele.outerHeight() + parseInt(self.settings.spacing) + parseInt(self.settings.offset.y);
  					self.reposition(posX);
  				},
  				close: function () {
  					self.close();
  				}
  			};
  
  		},
  		buildNotify: function () {
  			var content = this.settings.content;
  			this.$ele = $(String.format(this.settings.template, this.settings.type, content.title, content.message, content.url, content.target));
  			this.$ele.attr('data-notify-position', this.settings.placement.from + '-' + this.settings.placement.align);
  			if (!this.settings.allow_dismiss) {
  				this.$ele.find('[data-notify="dismiss"]').css('display', 'none');
  			}
  			if ((this.settings.delay <= 0 && !this.settings.showProgressbar) || !this.settings.showProgressbar) {
  				this.$ele.find('[data-notify="progressbar"]').remove();
  			}
  		},
  		setIcon: function () {
      		
      		this.$ele.addClass('alert-with-icon');
      		
  			if (this.settings.icon_type.toLowerCase() === 'class') {
  				this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon);
  			} else {
  				if (this.$ele.find('[data-notify="icon"]').is('img')) {
  					this.$ele.find('[data-notify="icon"]').attr('src', this.settings.content.icon);
  				} else {
  					this.$ele.find('[data-notify="icon"]').append('<img src="' + this.settings.content.icon + '" alt="Notify Icon" />');
  				}
  			}
  		},
  		styleDismiss: function () {
  			this.$ele.find('[data-notify="dismiss"]').css({
  				position: 'absolute',
  				right: '10px',
  				top: '50%',
  				marginTop: '-13px',
  				zIndex: this.settings.z_index + 2
  			});
  		},
  		styleURL: function () {
  			this.$ele.find('[data-notify="url"]').css({
  				backgroundImage: 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)',
  				height: '100%',
  				left: 0,
  				position: 'absolute',
  				top: 0,
  				width: '100%',
  				zIndex: this.settings.z_index + 1
  			});
  		},
  		placement: function () {
  			var self = this,
  				offsetAmt = this.settings.offset.y,
  				css = {
  					display: 'inline-block',
  					margin: '0px auto',
  					position: this.settings.position ? this.settings.position : (this.settings.element === 'body' ? 'fixed' : 'absolute'),
  					transition: 'all .5s ease-in-out',
  					zIndex: this.settings.z_index
  				},
  				hasAnimation = false,
  				settings = this.settings;
  
  			$('[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])').each(function () {
  				offsetAmt = Math.max(offsetAmt, parseInt($(this).css(settings.placement.from)) + parseInt($(this).outerHeight()) + parseInt(settings.spacing));
  			});
  			if (this.settings.newest_on_top === true) {
  				offsetAmt = this.settings.offset.y;
  			}
  			css[this.settings.placement.from] = offsetAmt + 'px';
  
  			switch (this.settings.placement.align) {
  				case "left":
  				case "right":
  					css[this.settings.placement.align] = this.settings.offset.x + 'px';
  					break;
  				case "center":
  					css.left = 0;
  					css.right = 0;
  					break;
  			}
  			this.$ele.css(css).addClass(this.settings.animate.enter);
  			$.each(Array('webkit-', 'moz-', 'o-', 'ms-', ''), function (index, prefix) {
  				self.$ele[0].style[prefix + 'AnimationIterationCount'] = 1;
  			});
  
  			$(this.settings.element).append(this.$ele);
  
  			if (this.settings.newest_on_top === true) {
  				offsetAmt = (parseInt(offsetAmt) + parseInt(this.settings.spacing)) + this.$ele.outerHeight();
  				this.reposition(offsetAmt);
  			}
  
  			if ($.isFunction(self.settings.onShow)) {
  				self.settings.onShow.call(this.$ele);
  			}
  
  			this.$ele.one(this.animations.start, function () {
  				hasAnimation = true;
  			}).one(this.animations.end, function () {
  				if ($.isFunction(self.settings.onShown)) {
  					self.settings.onShown.call(this);
  				}
  			});
  
  			setTimeout(function () {
  				if (!hasAnimation) {
  					if ($.isFunction(self.settings.onShown)) {
  						self.settings.onShown.call(this);
  					}
  				}
  			}, 600);
  		},
  		bind: function () {
  			var self = this;
  
  			this.$ele.find('[data-notify="dismiss"]').on('click', function () {
  				self.close();
  			});
  
  			this.$ele.mouseover(function () {
  				$(this).data('data-hover', "true");
  			}).mouseout(function () {
  				$(this).data('data-hover', "false");
  			});
  			this.$ele.data('data-hover', "false");
  
  			if (this.settings.delay > 0) {
  				self.$ele.data('notify-delay', self.settings.delay);
  				var timer = setInterval(function () {
  					var delay = parseInt(self.$ele.data('notify-delay')) - self.settings.timer;
  					if ((self.$ele.data('data-hover') === 'false' && self.settings.mouse_over === "pause") || self.settings.mouse_over != "pause") {
  						var percent = ((self.settings.delay - delay) / self.settings.delay) * 100;
  						self.$ele.data('notify-delay', delay);
  						self.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', percent).css('width', percent + '%');
  					}
  					if (delay <= -(self.settings.timer)) {
  						clearInterval(timer);
  						self.close();
  					}
  				}, self.settings.timer);
  			}
  		},
  		close: function () {
  			var self = this,
  				posX = parseInt(this.$ele.css(this.settings.placement.from)),
  				hasAnimation = false;
  
  			this.$ele.data('closing', 'true').addClass(this.settings.animate.exit);
  			self.reposition(posX);
  
  			if ($.isFunction(self.settings.onClose)) {
  				self.settings.onClose.call(this.$ele);
  			}
  
  			this.$ele.one(this.animations.start, function () {
  				hasAnimation = true;
  			}).one(this.animations.end, function () {
  				$(this).remove();
  				if ($.isFunction(self.settings.onClosed)) {
  					self.settings.onClosed.call(this);
  				}
  			});
  
  			setTimeout(function () {
  				if (!hasAnimation) {
  					self.$ele.remove();
  					if (self.settings.onClosed) {
  						self.settings.onClosed(self.$ele);
  					}
  				}
  			}, 600);
  		},
  		reposition: function (posX) {
  			var self = this,
  				notifies = '[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])',
  				$elements = this.$ele.nextAll(notifies);
  			if (this.settings.newest_on_top === true) {
  				$elements = this.$ele.prevAll(notifies);
  			}
  			$elements.each(function () {
  				$(this).css(self.settings.placement.from, posX);
  				posX = (parseInt(posX) + parseInt(self.settings.spacing)) + $(this).outerHeight();
  			});
  		}
  	});
  
  	$.notify = function (content, options) {
  		var plugin = new Notify(this, content, options);
  		return plugin.notify;
  	};
  	$.notifyDefaults = function (options) {
  		defaults = $.extend(true, {}, defaults, options);
  		return defaults;
  	};
  	$.notifyClose = function (command) {
  		if (typeof command === "undefined" || command === "all") {
  			$('[data-notify]').find('[data-notify="dismiss"]').trigger('click');
  		} else {
  			$('[data-notify-position="' + command + '"]').find('[data-notify="dismiss"]').trigger('click');
  		}
  	};
  
  }));
  
  !function($) {
      var Selectpicker = function(element, options, e) {
          if (e ) {
              e.stopPropagation();
              e.preventDefault();
          }
          this.$element = $(element);
          this.$newElement = null;
          this.button = null;
  
          //Merge defaults, options and data-attributes to make our options
          this.options = $.extend({}, $.fn.selectpicker.defaults, this.$element.data(), typeof options == 'object' && options);
  
          //If we have no title yet, check the attribute 'title' (this is missed by jq as its not a data-attribute
          if(this.options.title==null)
              this.options.title = this.$element.attr('title');
  
          //Expose public methods
          this.val = Selectpicker.prototype.val;
          this.render = Selectpicker.prototype.render;
          this.init();
      };
  
      Selectpicker.prototype = {
  
          constructor: Selectpicker,
  
          init: function (e) {
              var _this = this;
              this.$element.hide();
              this.multiple = this.$element.prop('multiple');
  
  
              var classList = this.$element.attr('class') !== undefined ? this.$element.attr('class').split(/\s+/) : '';
              var id = this.$element.attr('id');
              this.$element.after( this.createView() );
              this.$newElement = this.$element.next('.select');
              var select = this.$newElement;
              var menu = this.$newElement.find('.dropdown-menu');
              var menuArrow = this.$newElement.find('.dropdown-arrow');
              var menuA = menu.find('li > a');
              var liHeight = select.addClass('open').find('.dropdown-menu li > a').outerHeight();
              select.removeClass('open');
              var divHeight = menu.find('li .divider').outerHeight(true);
              var selectOffset_top = this.$newElement.offset().top;
              var size = 0;
              var menuHeight = 0;
              var selectHeight = this.$newElement.outerHeight();
              this.button = this.$newElement.find('> button');
              if (id !== undefined) {
                  this.button.attr('id', id);
                  $('label[for="' + id + '"]').click(function(){ select.find('button#'+id).focus(); })
              }
              for (var i = 0; i < classList.length; i++) {
                  if(classList[i] != 'selectpicker') {
                      this.$newElement.addClass(classList[i]);
                  }
              }
              //If we are multiple, then add the show-tick class by default
              if(this.multiple) {
                   this.$newElement.addClass('select-multiple');
              }
              this.button.addClass(this.options.style);
              menu.addClass(this.options.menuStyle);
              menuArrow.addClass(function() {
                  if (_this.options.menuStyle) {
                      return _this.options.menuStyle.replace('dropdown-', 'dropdown-arrow-');
                  }
              });
              this.checkDisabled();
              this.checkTabIndex();
              this.clickListener();
              var menuPadding = parseInt(menu.css('padding-top')) + parseInt(menu.css('padding-bottom')) + parseInt(menu.css('border-top-width')) + parseInt(menu.css('border-bottom-width'));
              if (this.options.size == 'auto') {
                  
                  // Creative Tim Changes: We changed the regular function made in bootstrap-select with this function so the getSize() will not be triggered one million times per second while you scroll.
                  
                  var getSize = debounce(function() {
                       var selectOffset_top_scroll = selectOffset_top - $(window).scrollTop();
                      var windowHeight = $(window).innerHeight();
                      var menuExtras = menuPadding + parseInt(menu.css('margin-top')) + parseInt(menu.css('margin-bottom')) + 2;
                      var selectOffset_bot = windowHeight - selectOffset_top_scroll - selectHeight - menuExtras;
                      menuHeight = selectOffset_bot;
                      if (select.hasClass('dropup')) {
                          menuHeight = selectOffset_top_scroll - menuExtras;
                      }
                      //limit menuHeight to 300px to have a smooth transition with cubic bezier on dropdown
                      if(menuHeight >= 300){
                          menuHeight = 300;
                      }
  
                      menu.css({'max-height' : menuHeight + 'px', 'overflow-y' : 'auto', 'min-height' : liHeight * 3 + 'px'});
                      
                  }, 50);
  
                  getSize;
                  $(window).on('scroll', getSize);
                  $(window).on('resize', getSize);
          
                  if (window.MutationObserver) {
                      new MutationObserver(getSize).observe(this.$element.get(0), {
                          childList: true
                      });
                  } else {
                      this.$element.bind('DOMNodeInserted', getSize);
                  }
              } else if (this.options.size && this.options.size != 'auto' && menu.find('li').length > this.options.size) {
                  var optIndex = menu.find("li > *").filter(':not(.divider)').slice(0,this.options.size).last().parent().index();
                  var divLength = menu.find("li").slice(0,optIndex + 1).find('.divider').length;
                  menuHeight = liHeight*this.options.size + divLength*divHeight + menuPadding;
                  menu.css({'max-height' : menuHeight + 'px', 'overflow-y' : 'scroll'});
                  //console.log('sunt in if');
              }
  
              // Listen for updates to the DOM and re render... (Use Mutation Observer when availiable)
              if (window.MutationObserver) {
                  new MutationObserver($.proxy(this.reloadLi, this)).observe(this.$element.get(0), {
                      childList: true
                  });
              } else {
                  this.$element.bind('DOMNodeInserted', $.proxy(this.reloadLi, this));
              }
  
              this.render();
          },
  
          createDropdown: function() {
              var drop =
                  "<div class='btn-group select'>" +                    
                      "<button class='btn dropdown-toggle clearfix' data-toggle='dropdown'>" +
                          "<span class='filter-option'></span>&nbsp;" +
                          "<span class='caret'></span>" +
                      "</button>" +
                      "<span class='dropdown-arrow'></span>" +
                      "<ul class='dropdown-menu' role='menu'>" +
                      "</ul>" +
                  "</div>";
  
              return $(drop);
          },
  
  
          createView: function() {
              var $drop = this.createDropdown();
              var $li = this.createLi();
              $drop.find('ul').append($li);
              return $drop;
          },
  
          reloadLi: function() {
              //Remove all children.
              this.destroyLi();
              //Re build
              $li = this.createLi();
              this.$newElement.find('ul').append( $li );
              //render view
              this.render();
          },
  
          destroyLi:function() {
              this.$newElement.find('li').remove();
          },
  
          createLi: function() {
  
              var _this = this;
              var _li = [];
              var _liA = [];
              var _liHtml = '';
  
              this.$element.find('option').each(function(){
                  _li.push($(this).text());
              });
  
              this.$element.find('option').each(function(index) {
                  //Get the class and text for the option
                  var optionClass = $(this).attr("class") !== undefined ? $(this).attr("class") : '';
                 	var text =  $(this).text();
                 	var subtext = $(this).data('subtext') !== undefined ? '<small class="muted">'+$(this).data('subtext')+'</small>' : '';
  
                  //Append any subtext to the main text.
                  text+=subtext;
  
                  if ($(this).parent().is('optgroup') && $(this).data('divider') != true) {
                      if ($(this).index() == 0) {
                          //Get the opt group label
                          var label = $(this).parent().attr('label');
                          var labelSubtext = $(this).parent().data('subtext') !== undefined ? '<small class="muted">'+$(this).parent().data('subtext')+'</small>' : '';
                          label += labelSubtext;
  
                          if ($(this)[0].index != 0) {
                              _liA.push(
                                  '<div class="divider"></div>'+
                                  '<dt>'+label+'</dt>'+ 
                                  _this.createA(text, "opt " + optionClass )
                                  );
                          } else {
                              _liA.push(
                                  '<dt>'+label+'</dt>'+ 
                                  _this.createA(text, "opt " + optionClass ));
                          }
                      } else {
                           _liA.push( _this.createA(text, "opt " + optionClass )  );
                      }
                  } else if ($(this).data('divider') == true) {
                      _liA.push('<div class="divider"></div>');
                  } else if ($(this).data('hidden') == true) {
  	                _liA.push('');
                  } else {
                      _liA.push( _this.createA(text, optionClass ) );
                  }
              });
  
              if (_li.length > 0) {
                  for (var i = 0; i < _li.length; i++) {
                      var $option = this.$element.find('option').eq(i);
                      _liHtml += "<li rel=" + i + ">" + _liA[i] + "</li>";
                  }
              }
  
              //If we dont have a selected item, and we dont have a title, select the first element so something is set in the button
              if(this.$element.find('option:selected').length==0 && !_this.options.title) {
                  this.$element.find('option').eq(0).prop('selected', true).attr('selected', 'selected');
              }
  
              return $(_liHtml);
          },
  
          createA:function(test, classes) {
           return '<a tabindex="-1" href="#" class="'+classes+'">' +
                   '<span class="">' + test + '</span>' +
                   '</a>';
  
          },
  
           render:function() {
              var _this = this;
  
              //Set width of select
               if (this.options.width == 'auto') {
                   var ulWidth = this.$newElement.find('.dropdown-menu').css('width');
                   this.$newElement.css('width',ulWidth);
               } else if (this.options.width && this.options.width != 'auto') {
                   this.$newElement.css('width',this.options.width);
               }
  
              //Update the LI to match the SELECT
              this.$element.find('option').each(function(index) {
                 _this.setDisabled(index, $(this).is(':disabled') || $(this).parent().is(':disabled') );
                 _this.setSelected(index, $(this).is(':selected') );
              });
  
  
  
              var selectedItems = this.$element.find('option:selected').map(function(index,value) {
                  if($(this).attr('title')!=undefined) {
                      return $(this).attr('title');
                  } else {
                      return $(this).text();
                  }
              }).toArray();
  
              //Convert all the values into a comma delimited string    
              var title = selectedItems.join(", ");
  
              //If this is multi select, and the selectText type is count, the show 1 of 2 selected etc..                    
              if(_this.multiple && _this.options.selectedTextFormat.indexOf('count') > -1) {
                  var max = _this.options.selectedTextFormat.split(">");
                  if( (max.length>1 && selectedItems.length > max[1]) || (max.length==1 && selectedItems.length>=2)) {
                      title = selectedItems.length +' of ' + this.$element.find('option').length + ' selected';
                  }
               }  
              
              //If we dont have a title, then use the default, or if nothing is set at all, use the not selected text
              if(!title) {
                  title = _this.options.title != undefined ? _this.options.title : _this.options.noneSelectedText;    
              }
              
              this.$element.next('.select').find('.filter-option').html( title );
  	    },
  	    
          
          
          setSelected:function(index, selected) {
              if(selected) {
                  this.$newElement.find('li').eq(index).addClass('selected');
              } else {
                  this.$newElement.find('li').eq(index).removeClass('selected');
              }
          },
          
          setDisabled:function(index, disabled) {
              if(disabled) {
                  this.$newElement.find('li').eq(index).addClass('disabled');
              } else {
                  this.$newElement.find('li').eq(index).removeClass('disabled');
              }
          },
         
          checkDisabled: function() {
              if (this.$element.is(':disabled')) {
                  this.button.addClass('disabled');
                  this.button.click(function(e) {
                      e.preventDefault();
                  });
              }
          },
  		
  		checkTabIndex: function() {
  			if (this.$element.is('[tabindex]')) {
  				var tabindex = this.$element.attr("tabindex");
  				this.button.attr('tabindex', tabindex);
  			}
  		},
  		
  		clickListener: function() {
              var _this = this;
              
              $('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); });
              
             
              
              this.$newElement.on('click', 'li a', function(e){
                  var clickedIndex = $(this).parent().index(),
                      $this = $(this).parent(),
                      $select = $this.parents('.select');
                  
                  
                  //Dont close on multi choice menu    
                  if(_this.multiple) {
                      e.stopPropagation();
                  }
                  
                  e.preventDefault();
                  
                  //Dont run if we have been disabled
                  if ($select.prev('select').not(':disabled') && !$(this).parent().hasClass('disabled')){
                      //Deselect all others if not multi select box
                      if (!_this.multiple) {
                          $select.prev('select').find('option').removeAttr('selected');
                          $select.prev('select').find('option').eq(clickedIndex).prop('selected', true).attr('selected', 'selected');
                      } 
                      //Else toggle the one we have chosen if we are multi selet.
                      else {
                          var selected = $select.prev('select').find('option').eq(clickedIndex).prop('selected');
                          
                          if(selected) {
                              $select.prev('select').find('option').eq(clickedIndex).removeAttr('selected');
                          } else {
                              $select.prev('select').find('option').eq(clickedIndex).prop('selected', true).attr('selected', 'selected');
                          }
                      }
                      
                      
                      $select.find('.filter-option').html($this.text());
                      $select.find('button').focus();
  
                      // Trigger select 'change'
                      $select.prev('select').trigger('change');
                  }
  
              });
              
             this.$newElement.on('click', 'li.disabled a, li dt, li .divider', function(e) {
                  e.preventDefault();
                  e.stopPropagation();
                  $select = $(this).parent().parents('.select');
                  $select.find('button').focus();
              });
  
              this.$element.on('change', function(e) {
                  _this.render();
              });
          },
          
          val:function(value) {
              
              if(value!=undefined) {
                  this.$element.val( value );
                  
                  this.$element.trigger('change');
                  return this.$element;
              } else {
                  return this.$element.val();
              }
          }
  
      };
  
      $.fn.selectpicker = function(option, event) {
         //get the args of the outer function..
         var args = arguments;
         var value;
         var chain = this.each(function () {
              var $this = $(this),
                  data = $this.data('selectpicker'),
                  options = typeof option == 'object' && option;
              
              if (!data) {
              	$this.data('selectpicker', (data = new Selectpicker(this, options, event)));
              } else {
              	for(var i in option) {
              		data[i]=option[i];
              	}
              }
              
              if (typeof option == 'string') {
                  //Copy the value of option, as once we shift the arguments
                  //it also shifts the value of option.
                  property = option;
                  if(data[property] instanceof Function) {
                      [].shift.apply(args);
                      value = data[property].apply(data, args);
                  } else {
                      value = data[property];
                  }
              }
          });
          
          if(value!=undefined) {
              return value;
          } else {
              return chain;
          } 
      };
  
      $.fn.selectpicker.defaults = {
          style: null,
          size: 'auto',
          title: null,
          selectedTextFormat : 'values',
          noneSelectedText : 'Nothing selected',
          width: null,
          menuStyle: null,
          toggleSize: null
      }
  
  }(window.jQuery);
  
  /* Chartist.js 0.9.4
   * Copyright © 2015 Gion Kunz
   * Free to use under the WTFPL license.
   * http://www.wtfpl.net/
   */
  
  !function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.Chartist=b()}):"object"==typeof exports?module.exports=b():a.Chartist=b()}(this,function(){var a={version:"0.9.4"};return function(a,b,c){"use strict";c.noop=function(a){return a},c.alphaNumerate=function(a){return String.fromCharCode(97+a%26)},c.extend=function(a){a=a||{};var b=Array.prototype.slice.call(arguments,1);return b.forEach(function(b){for(var d in b)"object"!=typeof b[d]||null===b[d]||b[d]instanceof Array?a[d]=b[d]:a[d]=c.extend({},a[d],b[d])}),a},c.replaceAll=function(a,b,c){return a.replace(new RegExp(b,"g"),c)},c.stripUnit=function(a){return"string"==typeof a&&(a=a.replace(/[^0-9\+-\.]/g,"")),+a},c.ensureUnit=function(a,b){return"number"==typeof a&&(a+=b),a},c.querySelector=function(a){return a instanceof Node?a:b.querySelector(a)},c.times=function(a){return Array.apply(null,new Array(a))},c.sum=function(a,b){return a+(b?b:0)},c.mapMultiply=function(a){return function(b){return b*a}},c.mapAdd=function(a){return function(b){return b+a}},c.serialMap=function(a,b){var d=[],e=Math.max.apply(null,a.map(function(a){return a.length}));return c.times(e).forEach(function(c,e){var f=a.map(function(a){return a[e]});d[e]=b.apply(null,f)}),d},c.roundWithPrecision=function(a,b){var d=Math.pow(10,b||c.precision);return Math.round(a*d)/d},c.precision=8,c.escapingMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"},c.serialize=function(a){return null===a||void 0===a?a:("number"==typeof a?a=""+a:"object"==typeof a&&(a=JSON.stringify({data:a})),Object.keys(c.escapingMap).reduce(function(a,b){return c.replaceAll(a,b,c.escapingMap[b])},a))},c.deserialize=function(a){if("string"!=typeof a)return a;a=Object.keys(c.escapingMap).reduce(function(a,b){return c.replaceAll(a,c.escapingMap[b],b)},a);try{a=JSON.parse(a),a=void 0!==a.data?a.data:a}catch(b){}return a},c.createSvg=function(a,b,d,e){var f;return b=b||"100%",d=d||"100%",Array.prototype.slice.call(a.querySelectorAll("svg")).filter(function(a){return a.getAttributeNS("http://www.w3.org/2000/xmlns/",c.xmlNs.prefix)}).forEach(function(b){a.removeChild(b)}),f=new c.Svg("svg").attr({width:b,height:d}).addClass(e).attr({style:"width: "+b+"; height: "+d+";"}),a.appendChild(f._node),f},c.reverseData=function(a){a.labels.reverse(),a.series.reverse();for(var b=0;b<a.series.length;b++)"object"==typeof a.series[b]&&void 0!==a.series[b].data?a.series[b].data.reverse():a.series[b]instanceof Array&&a.series[b].reverse()},c.getDataArray=function(a,b,d){function e(a){if(c.isFalseyButZero(a))return void 0;if((a.data||a)instanceof Array)return(a.data||a).map(e);if(a.hasOwnProperty("value"))return e(a.value);if(d){var b={};return"string"==typeof d?b[d]=c.getNumberOrUndefined(a):b.y=c.getNumberOrUndefined(a),b.x=a.hasOwnProperty("x")?c.getNumberOrUndefined(a.x):b.x,b.y=a.hasOwnProperty("y")?c.getNumberOrUndefined(a.y):b.y,b}return c.getNumberOrUndefined(a)}return(b&&!a.reversed||!b&&a.reversed)&&(c.reverseData(a),a.reversed=!a.reversed),a.series.map(e)},c.normalizePadding=function(a,b){return b=b||0,"number"==typeof a?{top:a,right:a,bottom:a,left:a}:{top:"number"==typeof a.top?a.top:b,right:"number"==typeof a.right?a.right:b,bottom:"number"==typeof a.bottom?a.bottom:b,left:"number"==typeof a.left?a.left:b}},c.getMetaData=function(a,b){var d=a.data?a.data[b]:a[b];return d?c.serialize(d.meta):void 0},c.orderOfMagnitude=function(a){return Math.floor(Math.log(Math.abs(a))/Math.LN10)},c.projectLength=function(a,b,c){return b/c.range*a},c.getAvailableHeight=function(a,b){return Math.max((c.stripUnit(b.height)||a.height())-(b.chartPadding.top+b.chartPadding.bottom)-b.axisX.offset,0)},c.getHighLow=function(a,b,d){function e(a){if(void 0===a)return void 0;if(a instanceof Array)for(var b=0;b<a.length;b++)e(a[b]);else{var c=d?+a[d]:+a;g&&c>f.high&&(f.high=c),h&&c<f.low&&(f.low=c)}}b=c.extend({},b,d?b["axis"+d.toUpperCase()]:{});var f={high:void 0===b.high?-Number.MAX_VALUE:+b.high,low:void 0===b.low?Number.MAX_VALUE:+b.low},g=void 0===b.high,h=void 0===b.low;return(g||h)&&e(a),(b.referenceValue||0===b.referenceValue)&&(f.high=Math.max(b.referenceValue,f.high),f.low=Math.min(b.referenceValue,f.low)),f.high<=f.low&&(0===f.low?f.high=1:f.low<0?f.high=0:f.low=0),f},c.isNum=function(a){return!isNaN(a)&&isFinite(a)},c.isFalseyButZero=function(a){return!a&&0!==a},c.getNumberOrUndefined=function(a){return isNaN(+a)?void 0:+a},c.getMultiValue=function(a,b){return c.isNum(a)?+a:a?a[b||"y"]||0:0},c.rho=function(a){function b(a,c){return a%c===0?c:b(c,a%c)}function c(a){return a*a+1}if(1===a)return a;var d,e=2,f=2;if(a%2===0)return 2;do e=c(e)%a,f=c(c(f))%a,d=b(Math.abs(e-f),a);while(1===d);return d},c.getBounds=function(a,b,d,e){var f,g,h,i=0,j={high:b.high,low:b.low};j.valueRange=j.high-j.low,j.oom=c.orderOfMagnitude(j.valueRange),j.step=Math.pow(10,j.oom),j.min=Math.floor(j.low/j.step)*j.step,j.max=Math.ceil(j.high/j.step)*j.step,j.range=j.max-j.min,j.numberOfSteps=Math.round(j.range/j.step);var k=c.projectLength(a,j.step,j),l=d>k,m=e?c.rho(j.range):0;if(e&&c.projectLength(a,1,j)>=d)j.step=1;else if(e&&m<j.step&&c.projectLength(a,m,j)>=d)j.step=m;else for(;;){if(l&&c.projectLength(a,j.step,j)<=d)j.step*=2;else{if(l||!(c.projectLength(a,j.step/2,j)>=d))break;if(j.step/=2,e&&j.step%1!==0){j.step*=2;break}}if(i++>1e3)throw new Error("Exceeded maximum number of iterations while optimizing scale step!")}for(g=j.min,h=j.max;g+j.step<=j.low;)g+=j.step;for(;h-j.step>=j.high;)h-=j.step;for(j.min=g,j.max=h,j.range=j.max-j.min,j.values=[],f=j.min;f<=j.max;f+=j.step)j.values.push(c.roundWithPrecision(f));return j},c.polarToCartesian=function(a,b,c,d){var e=(d-90)*Math.PI/180;return{x:a+c*Math.cos(e),y:b+c*Math.sin(e)}},c.createChartRect=function(a,b,d){var e=!(!b.axisX&&!b.axisY),f=e?b.axisY.offset:0,g=e?b.axisX.offset:0,h=a.width()||c.stripUnit(b.width)||0,i=a.height()||c.stripUnit(b.height)||0,j=c.normalizePadding(b.chartPadding,d);h=Math.max(h,f+j.left+j.right),i=Math.max(i,g+j.top+j.bottom);var k={padding:j,width:function(){return this.x2-this.x1},height:function(){return this.y1-this.y2}};return e?("start"===b.axisX.position?(k.y2=j.top+g,k.y1=Math.max(i-j.bottom,k.y2+1)):(k.y2=j.top,k.y1=Math.max(i-j.bottom-g,k.y2+1)),"start"===b.axisY.position?(k.x1=j.left+f,k.x2=Math.max(h-j.right,k.x1+1)):(k.x1=j.left,k.x2=Math.max(h-j.right-f,k.x1+1))):(k.x1=j.left,k.x2=Math.max(h-j.right,k.x1+1),k.y2=j.top,k.y1=Math.max(i-j.bottom,k.y2+1)),k},c.createGrid=function(a,b,d,e,f,g,h,i){var j={};j[d.units.pos+"1"]=a,j[d.units.pos+"2"]=a,j[d.counterUnits.pos+"1"]=e,j[d.counterUnits.pos+"2"]=e+f;var k=g.elem("line",j,h.join(" "));i.emit("draw",c.extend({type:"grid",axis:d,index:b,group:g,element:k},j))},c.createLabel=function(a,b,d,e,f,g,h,i,j,k,l){var m,n={};if(n[f.units.pos]=a+h[f.units.pos],n[f.counterUnits.pos]=h[f.counterUnits.pos],n[f.units.len]=b,n[f.counterUnits.len]=g-10,k){var o='<span class="'+j.join(" ")+'" style="'+f.units.len+": "+Math.round(n[f.units.len])+"px; "+f.counterUnits.len+": "+Math.round(n[f.counterUnits.len])+'px">'+e[d]+"</span>";m=i.foreignObject(o,c.extend({style:"overflow: visible;"},n))}else m=i.elem("text",n,j.join(" ")).text(e[d]);l.emit("draw",c.extend({type:"label",axis:f,index:d,group:i,element:m,text:e[d]},n))},c.getSeriesOption=function(a,b,c){if(a.name&&b.series&&b.series[a.name]){var d=b.series[a.name];return d.hasOwnProperty(c)?d[c]:b[c]}return b[c]},c.optionsProvider=function(b,d,e){function f(b){var f=h;if(h=c.extend({},j),d)for(i=0;i<d.length;i++){var g=a.matchMedia(d[i][0]);g.matches&&(h=c.extend(h,d[i][1]))}e&&!b&&e.emit("optionsChanged",{previousOptions:f,currentOptions:h})}function g(){k.forEach(function(a){a.removeListener(f)})}var h,i,j=c.extend({},b),k=[];if(!a.matchMedia)throw"window.matchMedia not found! Make sure you're using a polyfill.";if(d)for(i=0;i<d.length;i++){var l=a.matchMedia(d[i][0]);l.addListener(f),k.push(l)}return f(!0),{removeMediaQueryListeners:g,getCurrentOptions:function(){return c.extend({},h)}}}}(window,document,a),function(a,b,c){"use strict";c.Interpolation={},c.Interpolation.none=function(){return function(a,b){for(var d=new c.Svg.Path,e=!0,f=1;f<a.length;f+=2){var g=b[(f-1)/2];void 0===g.value?e=!0:e?(d.move(a[f-1],a[f],!1,g),e=!1):d.line(a[f-1],a[f],!1,g)}return d}},c.Interpolation.simple=function(a){var b={divisor:2};a=c.extend({},b,a);var d=1/Math.max(1,a.divisor);return function(a,b){for(var e=new c.Svg.Path,f=!0,g=2;g<a.length;g+=2){var h=a[g-2],i=a[g-1],j=a[g],k=a[g+1],l=(j-h)*d,m=b[g/2-1],n=b[g/2];void 0===m.value?f=!0:(f&&e.move(h,i,!1,m),void 0!==n.value&&(e.curve(h+l,i,j-l,k,j,k,!1,n),f=!1))}return e}},c.Interpolation.cardinal=function(a){function b(a,b){for(var c=[],d=!0,e=0;e<a.length;e+=2)void 0===b[e/2].value?d=!0:(d&&(c.push({pathCoordinates:[],valueData:[]}),d=!1),c[c.length-1].pathCoordinates.push(a[e],a[e+1]),c[c.length-1].valueData.push(b[e/2]));return c}var d={tension:1};a=c.extend({},d,a);var e=Math.min(1,Math.max(0,a.tension)),f=1-e;return function g(a,d){var h=b(a,d);if(h.length>1){var i=[];return h.forEach(function(a){i.push(g(a.pathCoordinates,a.valueData))}),c.Svg.Path.join(i)}if(a=h[0].pathCoordinates,d=h[0].valueData,a.length<=4)return c.Interpolation.none()(a,d);for(var j,k=(new c.Svg.Path).move(a[0],a[1],!1,d[0]),l=0,m=a.length;m-2*!j>l;l+=2){var n=[{x:+a[l-2],y:+a[l-1]},{x:+a[l],y:+a[l+1]},{x:+a[l+2],y:+a[l+3]},{x:+a[l+4],y:+a[l+5]}];j?l?m-4===l?n[3]={x:+a[0],y:+a[1]}:m-2===l&&(n[2]={x:+a[0],y:+a[1]},n[3]={x:+a[2],y:+a[3]}):n[0]={x:+a[m-2],y:+a[m-1]}:m-4===l?n[3]=n[2]:l||(n[0]={x:+a[l],y:+a[l+1]}),k.curve(e*(-n[0].x+6*n[1].x+n[2].x)/6+f*n[2].x,e*(-n[0].y+6*n[1].y+n[2].y)/6+f*n[2].y,e*(n[1].x+6*n[2].x-n[3].x)/6+f*n[2].x,e*(n[1].y+6*n[2].y-n[3].y)/6+f*n[2].y,n[2].x,n[2].y,!1,d[(l+2)/2])}return k}},c.Interpolation.step=function(a){var b={postpone:!0};return a=c.extend({},b,a),function(b,d){for(var e=new c.Svg.Path,f=!0,g=2;g<b.length;g+=2){var h=b[g-2],i=b[g-1],j=b[g],k=b[g+1],l=d[g/2-1],m=d[g/2];void 0===l.value?f=!0:(f&&e.move(h,i,!1,l),void 0!==m.value&&(a.postpone?e.line(j,i,!1,l):e.line(h,k,!1,m),e.line(j,k,!1,m),f=!1))}return e}}}(window,document,a),function(a,b,c){"use strict";c.EventEmitter=function(){function a(a,b){d[a]=d[a]||[],d[a].push(b)}function b(a,b){d[a]&&(b?(d[a].splice(d[a].indexOf(b),1),0===d[a].length&&delete d[a]):delete d[a])}function c(a,b){d[a]&&d[a].forEach(function(a){a(b)}),d["*"]&&d["*"].forEach(function(c){c(a,b)})}var d=[];return{addEventHandler:a,removeEventHandler:b,emit:c}}}(window,document,a),function(a,b,c){"use strict";function d(a){var b=[];if(a.length)for(var c=0;c<a.length;c++)b.push(a[c]);return b}function e(a,b){var d=b||this.prototype||c.Class,e=Object.create(d);c.Class.cloneDefinitions(e,a);var f=function(){var a,b=e.constructor||function(){};return a=this===c?Object.create(e):this,b.apply(a,Array.prototype.slice.call(arguments,0)),a};return f.prototype=e,f["super"]=d,f.extend=this.extend,f}function f(){var a=d(arguments),b=a[0];return a.splice(1,a.length-1).forEach(function(a){Object.getOwnPropertyNames(a).forEach(function(c){delete b[c],Object.defineProperty(b,c,Object.getOwnPropertyDescriptor(a,c))})}),b}c.Class={extend:e,cloneDefinitions:f}}(window,document,a),function(a,b,c){"use strict";function d(a,b,d){return a&&(this.data=a,this.eventEmitter.emit("data",{type:"update",data:this.data})),b&&(this.options=c.extend({},d?this.options:this.defaultOptions,b),this.initializeTimeoutId||(this.optionsProvider.removeMediaQueryListeners(),this.optionsProvider=c.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter))),this.initializeTimeoutId||this.createChart(this.optionsProvider.getCurrentOptions()),this}function e(){return this.initializeTimeoutId?a.clearTimeout(this.initializeTimeoutId):(a.removeEventListener("resize",this.resizeListener),this.optionsProvider.removeMediaQueryListeners()),this}function f(a,b){return this.eventEmitter.addEventHandler(a,b),this}function g(a,b){return this.eventEmitter.removeEventHandler(a,b),this}function h(){a.addEventListener("resize",this.resizeListener),this.optionsProvider=c.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter),this.eventEmitter.addEventHandler("optionsChanged",function(){this.update()}.bind(this)),this.options.plugins&&this.options.plugins.forEach(function(a){a instanceof Array?a[0](this,a[1]):a(this)}.bind(this)),this.eventEmitter.emit("data",{type:"initial",data:this.data}),this.createChart(this.optionsProvider.getCurrentOptions()),this.initializeTimeoutId=void 0}function i(a,b,d,e,f){this.container=c.querySelector(a),this.data=b,this.defaultOptions=d,this.options=e,this.responsiveOptions=f,this.eventEmitter=c.EventEmitter(),this.supportsForeignObject=c.Svg.isSupported("Extensibility"),this.supportsAnimations=c.Svg.isSupported("AnimationEventsAttribute"),this.resizeListener=function(){this.update()}.bind(this),this.container&&(this.container.__chartist__&&this.container.__chartist__.detach(),this.container.__chartist__=this),this.initializeTimeoutId=setTimeout(h.bind(this),0)}c.Base=c.Class.extend({constructor:i,optionsProvider:void 0,container:void 0,svg:void 0,eventEmitter:void 0,createChart:function(){throw new Error("Base chart type can't be instantiated!")},update:d,detach:e,on:f,off:g,version:c.version,supportsForeignObject:!1})}(window,document,a),function(a,b,c){"use strict";function d(a,d,e,f,g){a instanceof Element?this._node=a:(this._node=b.createElementNS(z,a),"svg"===a&&this._node.setAttributeNS(A,c.xmlNs.qualifiedName,c.xmlNs.uri)),d&&this.attr(d),e&&this.addClass(e),f&&(g&&f._node.firstChild?f._node.insertBefore(this._node,f._node.firstChild):f._node.appendChild(this._node))}function e(a,b){return"string"==typeof a?b?this._node.getAttributeNS(b,a):this._node.getAttribute(a):(Object.keys(a).forEach(function(d){void 0!==a[d]&&(b?this._node.setAttributeNS(b,[c.xmlNs.prefix,":",d].join(""),a[d]):this._node.setAttribute(d,a[d]))}.bind(this)),this)}function f(a,b,d,e){return new c.Svg(a,b,d,this,e)}function g(){return this._node.parentNode instanceof SVGElement?new c.Svg(this._node.parentNode):null}function h(){for(var a=this._node;"svg"!==a.nodeName;)a=a.parentNode;return new c.Svg(a)}function i(a){var b=this._node.querySelector(a);return b?new c.Svg(b):null}function j(a){var b=this._node.querySelectorAll(a);return b.length?new c.Svg.List(b):null}function k(a,c,d,e){if("string"==typeof a){var f=b.createElement("div");f.innerHTML=a,a=f.firstChild}a.setAttribute("xmlns",B);var g=this.elem("foreignObject",c,d,e);return g._node.appendChild(a),g}function l(a){return this._node.appendChild(b.createTextNode(a)),this}function m(){for(;this._node.firstChild;)this._node.removeChild(this._node.firstChild);return this}function n(){return this._node.parentNode.removeChild(this._node),this.parent()}function o(a){return this._node.parentNode.replaceChild(a._node,this._node),a}function p(a,b){return b&&this._node.firstChild?this._node.insertBefore(a._node,this._node.firstChild):this._node.appendChild(a._node),this}function q(){return this._node.getAttribute("class")?this._node.getAttribute("class").trim().split(/\s+/):[]}function r(a){return this._node.setAttribute("class",this.classes(this._node).concat(a.trim().split(/\s+/)).filter(function(a,b,c){return c.indexOf(a)===b}).join(" ")),this}function s(a){var b=a.trim().split(/\s+/);return this._node.setAttribute("class",this.classes(this._node).filter(function(a){return-1===b.indexOf(a)}).join(" ")),this}function t(){return this._node.setAttribute("class",""),this}function u(a,b){try{return a.getBBox()[b]}catch(c){}return 0}function v(){return this._node.clientHeight||Math.round(u(this._node,"height"))||this._node.parentNode.clientHeight}function w(){return this._node.clientWidth||Math.round(u(this._node,"width"))||this._node.parentNode.clientWidth}function x(a,b,d){return void 0===b&&(b=!0),Object.keys(a).forEach(function(e){function f(a,b){var f,g,h,i={};a.easing&&(h=a.easing instanceof Array?a.easing:c.Svg.Easing[a.easing],delete a.easing),a.begin=c.ensureUnit(a.begin,"ms"),a.dur=c.ensureUnit(a.dur,"ms"),h&&(a.calcMode="spline",a.keySplines=h.join(" "),a.keyTimes="0;1"),b&&(a.fill="freeze",i[e]=a.from,this.attr(i),g=c.stripUnit(a.begin||0),a.begin="indefinite"),f=this.elem("animate",c.extend({attributeName:e},a)),b&&setTimeout(function(){try{f._node.beginElement()}catch(b){i[e]=a.to,this.attr(i),f.remove()}}.bind(this),g),d&&f._node.addEventListener("beginEvent",function(){d.emit("animationBegin",{element:this,animate:f._node,params:a})}.bind(this)),f._node.addEventListener("endEvent",function(){d&&d.emit("animationEnd",{element:this,animate:f._node,params:a}),b&&(i[e]=a.to,this.attr(i),f.remove())}.bind(this))}a[e]instanceof Array?a[e].forEach(function(a){f.bind(this)(a,!1)}.bind(this)):f.bind(this)(a[e],b)}.bind(this)),this}function y(a){var b=this;this.svgElements=[];for(var d=0;d<a.length;d++)this.svgElements.push(new c.Svg(a[d]));Object.keys(c.Svg.prototype).filter(function(a){return-1===["constructor","parent","querySelector","querySelectorAll","replace","append","classes","height","width"].indexOf(a)}).forEach(function(a){b[a]=function(){var d=Array.prototype.slice.call(arguments,0);return b.svgElements.forEach(function(b){c.Svg.prototype[a].apply(b,d)}),b}})}var z="http://www.w3.org/2000/svg",A="http://www.w3.org/2000/xmlns/",B="http://www.w3.org/1999/xhtml";c.xmlNs={qualifiedName:"xmlns:ct",prefix:"ct",uri:"http://gionkunz.github.com/chartist-js/ct"},c.Svg=c.Class.extend({constructor:d,attr:e,elem:f,parent:g,root:h,querySelector:i,querySelectorAll:j,foreignObject:k,text:l,empty:m,remove:n,replace:o,append:p,classes:q,addClass:r,removeClass:s,removeAllClasses:t,height:v,width:w,animate:x}),c.Svg.isSupported=function(a){return b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#"+a,"1.1")};var C={easeInSine:[.47,0,.745,.715],easeOutSine:[.39,.575,.565,1],easeInOutSine:[.445,.05,.55,.95],easeInQuad:[.55,.085,.68,.53],easeOutQuad:[.25,.46,.45,.94],easeInOutQuad:[.455,.03,.515,.955],easeInCubic:[.55,.055,.675,.19],easeOutCubic:[.215,.61,.355,1],easeInOutCubic:[.645,.045,.355,1],easeInQuart:[.895,.03,.685,.22],easeOutQuart:[.165,.84,.44,1],easeInOutQuart:[.77,0,.175,1],easeInQuint:[.755,.05,.855,.06],easeOutQuint:[.23,1,.32,1],easeInOutQuint:[.86,0,.07,1],easeInExpo:[.95,.05,.795,.035],easeOutExpo:[.19,1,.22,1],easeInOutExpo:[1,0,0,1],easeInCirc:[.6,.04,.98,.335],easeOutCirc:[.075,.82,.165,1],easeInOutCirc:[.785,.135,.15,.86],easeInBack:[.6,-.28,.735,.045],easeOutBack:[.175,.885,.32,1.275],easeInOutBack:[.68,-.55,.265,1.55]};c.Svg.Easing=C,c.Svg.List=c.Class.extend({constructor:y})}(window,document,a),function(a,b,c){"use strict";function d(a,b,d,e,f,g){var h=c.extend({command:f?a.toLowerCase():a.toUpperCase()},b,g?{data:g}:{});d.splice(e,0,h)}function e(a,b){a.forEach(function(c,d){u[c.command.toLowerCase()].forEach(function(e,f){b(c,e,d,f,a)})})}function f(a,b){this.pathElements=[],this.pos=0,this.close=a,this.options=c.extend({},v,b)}function g(a){return void 0!==a?(this.pos=Math.max(0,Math.min(this.pathElements.length,a)),this):this.pos}function h(a){return this.pathElements.splice(this.pos,a),this}function i(a,b,c,e){return d("M",{x:+a,y:+b},this.pathElements,this.pos++,c,e),this}function j(a,b,c,e){return d("L",{x:+a,y:+b},this.pathElements,this.pos++,c,e),this}function k(a,b,c,e,f,g,h,i){return d("C",{x1:+a,y1:+b,x2:+c,y2:+e,x:+f,y:+g},this.pathElements,this.pos++,h,i),this}function l(a,b,c,e,f,g,h,i,j){return d("A",{rx:+a,ry:+b,xAr:+c,lAf:+e,sf:+f,x:+g,y:+h},this.pathElements,this.pos++,i,j),this}function m(a){var b=a.replace(/([A-Za-z])([0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").split(/[\s,]+/).reduce(function(a,b){return b.match(/[A-Za-z]/)&&a.push([]),a[a.length-1].push(b),a},[]);"Z"===b[b.length-1][0].toUpperCase()&&b.pop();var d=b.map(function(a){var b=a.shift(),d=u[b.toLowerCase()];return c.extend({command:b},d.reduce(function(b,c,d){return b[c]=+a[d],b},{}))}),e=[this.pos,0];return Array.prototype.push.apply(e,d),Array.prototype.splice.apply(this.pathElements,e),this.pos+=d.length,this}function n(){var a=Math.pow(10,this.options.accuracy);return this.pathElements.reduce(function(b,c){var d=u[c.command.toLowerCase()].map(function(b){return this.options.accuracy?Math.round(c[b]*a)/a:c[b]}.bind(this));return b+c.command+d.join(",")}.bind(this),"")+(this.close?"Z":"")}function o(a,b){return e(this.pathElements,function(c,d){c[d]*="x"===d[0]?a:b}),this}function p(a,b){return e(this.pathElements,function(c,d){c[d]+="x"===d[0]?a:b}),this}function q(a){return e(this.pathElements,function(b,c,d,e,f){var g=a(b,c,d,e,f);(g||0===g)&&(b[c]=g)}),this}function r(a){var b=new c.Svg.Path(a||this.close);return b.pos=this.pos,b.pathElements=this.pathElements.slice().map(function(a){return c.extend({},a)}),b.options=c.extend({},this.options),b}function s(a){var b=[new c.Svg.Path];return this.pathElements.forEach(function(d){d.command===a.toUpperCase()&&0!==b[b.length-1].pathElements.length&&b.push(new c.Svg.Path),b[b.length-1].pathElements.push(d)}),b}function t(a,b,d){for(var e=new c.Svg.Path(b,d),f=0;f<a.length;f++)for(var g=a[f],h=0;h<g.pathElements.length;h++)e.pathElements.push(g.pathElements[h]);return e}var u={m:["x","y"],l:["x","y"],c:["x1","y1","x2","y2","x","y"],a:["rx","ry","xAr","lAf","sf","x","y"]},v={accuracy:3};c.Svg.Path=c.Class.extend({constructor:f,position:g,remove:h,move:i,line:j,curve:k,arc:l,scale:o,translate:p,transform:q,parse:m,stringify:n,clone:r,splitByCommand:s}),c.Svg.Path.elementDescriptions=u,c.Svg.Path.join=t}(window,document,a),function(a,b,c){"use strict";function d(a,b,c,d){this.units=a,this.counterUnits=a===f.x?f.y:f.x,this.chartRect=b,this.axisLength=b[a.rectEnd]-b[a.rectStart],this.gridOffset=b[a.rectOffset],this.ticks=c,this.options=d}function e(a,b,d,e,f){var g=e["axis"+this.units.pos.toUpperCase()],h=this.ticks.map(this.projectValue.bind(this)),i=this.ticks.map(g.labelInterpolationFnc);h.forEach(function(j,k){var l,m={x:0,y:0};l=h[k+1]?h[k+1]-j:Math.max(this.axisLength-j,30),(i[k]||0===i[k])&&("x"===this.units.pos?(j=this.chartRect.x1+j,m.x=e.axisX.labelOffset.x,"start"===e.axisX.position?m.y=this.chartRect.padding.top+e.axisX.labelOffset.y+(d?5:20):m.y=this.chartRect.y1+e.axisX.labelOffset.y+(d?5:20)):(j=this.chartRect.y1-j,m.y=e.axisY.labelOffset.y-(d?l:0),"start"===e.axisY.position?m.x=d?this.chartRect.padding.left+e.axisY.labelOffset.x:this.chartRect.x1-10:m.x=this.chartRect.x2+e.axisY.labelOffset.x+10),g.showGrid&&c.createGrid(j,k,this,this.gridOffset,this.chartRect[this.counterUnits.len](),a,[e.classNames.grid,e.classNames[this.units.dir]],f),g.showLabel&&c.createLabel(j,l,k,i,this,g.offset,m,b,[e.classNames.label,e.classNames[this.units.dir],e.classNames[g.position]],d,f))}.bind(this))}var f={x:{pos:"x",len:"width",dir:"horizontal",rectStart:"x1",rectEnd:"x2",rectOffset:"y2"},y:{pos:"y",len:"height",dir:"vertical",rectStart:"y2",rectEnd:"y1",rectOffset:"x1"}};c.Axis=c.Class.extend({constructor:d,createGridAndLabels:e,projectValue:function(a,b,c){throw new Error("Base axis can't be instantiated!")}}),c.Axis.units=f}(window,document,a),function(a,b,c){"use strict";function d(a,b,d,e){var f=e.highLow||c.getHighLow(b.normalized,e,a.pos);this.bounds=c.getBounds(d[a.rectEnd]-d[a.rectStart],f,e.scaleMinSpace||20,e.onlyInteger),this.range={min:this.bounds.min,max:this.bounds.max},c.AutoScaleAxis["super"].constructor.call(this,a,d,this.bounds.values,e)}function e(a){return this.axisLength*(+c.getMultiValue(a,this.units.pos)-this.bounds.min)/this.bounds.range}c.AutoScaleAxis=c.Axis.extend({constructor:d,projectValue:e})}(window,document,a),function(a,b,c){"use strict";function d(a,b,d,e){var f=e.highLow||c.getHighLow(b.normalized,e,a.pos);this.divisor=e.divisor||1,this.ticks=e.ticks||c.times(this.divisor).map(function(a,b){return f.low+(f.high-f.low)/this.divisor*b}.bind(this)),this.range={min:f.low,max:f.high},c.FixedScaleAxis["super"].constructor.call(this,a,d,this.ticks,e),this.stepLength=this.axisLength/this.divisor}function e(a){return this.axisLength*(+c.getMultiValue(a,this.units.pos)-this.range.min)/(this.range.max-this.range.min)}c.FixedScaleAxis=c.Axis.extend({constructor:d,projectValue:e})}(window,document,a),function(a,b,c){"use strict";function d(a,b,d,e){c.StepAxis["super"].constructor.call(this,a,d,e.ticks,e),this.stepLength=this.axisLength/(e.ticks.length-(e.stretch?1:0))}function e(a,b){return this.stepLength*b}c.StepAxis=c.Axis.extend({constructor:d,projectValue:e})}(window,document,a),function(a,b,c){"use strict";function d(a){var b={raw:this.data,normalized:c.getDataArray(this.data,a.reverseData,!0)};this.svg=c.createSvg(this.container,a.width,a.height,a.classNames.chart);var d,e,g=this.svg.elem("g").addClass(a.classNames.gridGroup),h=this.svg.elem("g"),i=this.svg.elem("g").addClass(a.classNames.labelGroup),j=c.createChartRect(this.svg,a,f.padding);d=void 0===a.axisX.type?new c.StepAxis(c.Axis.units.x,b,j,c.extend({},a.axisX,{ticks:b.raw.labels,stretch:a.fullWidth})):a.axisX.type.call(c,c.Axis.units.x,b,j,a.axisX),e=void 0===a.axisY.type?new c.AutoScaleAxis(c.Axis.units.y,b,j,c.extend({},a.axisY,{high:c.isNum(a.high)?a.high:a.axisY.high,low:c.isNum(a.low)?a.low:a.axisY.low})):a.axisY.type.call(c,c.Axis.units.y,b,j,a.axisY),d.createGridAndLabels(g,i,this.supportsForeignObject,a,this.eventEmitter),e.createGridAndLabels(g,i,this.supportsForeignObject,a,this.eventEmitter),b.raw.series.forEach(function(f,g){var i=h.elem("g");i.attr({"series-name":f.name,meta:c.serialize(f.meta)},c.xmlNs.uri),i.addClass([a.classNames.series,f.className||a.classNames.series+"-"+c.alphaNumerate(g)].join(" "));var k=[],l=[];b.normalized[g].forEach(function(a,h){var i={x:j.x1+d.projectValue(a,h,b.normalized[g]),y:j.y1-e.projectValue(a,h,b.normalized[g])};k.push(i.x,i.y),l.push({value:a,valueIndex:h,meta:c.getMetaData(f,h)})}.bind(this));var m={lineSmooth:c.getSeriesOption(f,a,"lineSmooth"),showPoint:c.getSeriesOption(f,a,"showPoint"),showLine:c.getSeriesOption(f,a,"showLine"),showArea:c.getSeriesOption(f,a,"showArea"),areaBase:c.getSeriesOption(f,a,"areaBase")},n="function"==typeof m.lineSmooth?m.lineSmooth:m.lineSmooth?c.Interpolation.cardinal():c.Interpolation.none(),o=n(k,l);if(m.showPoint&&o.pathElements.forEach(function(b){var h=i.elem("line",{x1:b.x,y1:b.y,x2:b.x+.01,y2:b.y},a.classNames.point).attr({value:[b.data.value.x,b.data.value.y].filter(function(a){return a}).join(","),meta:b.data.meta},c.xmlNs.uri);this.eventEmitter.emit("draw",{type:"point",value:b.data.value,index:b.data.valueIndex,meta:b.data.meta,series:f,seriesIndex:g,axisX:d,axisY:e,group:i,element:h,x:b.x,y:b.y})}.bind(this)),m.showLine){var p=i.elem("path",{d:o.stringify()},a.classNames.line,!0);this.eventEmitter.emit("draw",{type:"line",values:b.normalized[g],path:o.clone(),chartRect:j,index:g,series:f,seriesIndex:g,axisX:d,axisY:e,group:i,element:p})}if(m.showArea&&e.range){var q=Math.max(Math.min(m.areaBase,e.range.max),e.range.min),r=j.y1-e.projectValue(q);o.splitByCommand("M").filter(function(a){return a.pathElements.length>1}).map(function(a){var b=a.pathElements[0],c=a.pathElements[a.pathElements.length-1];return a.clone(!0).position(0).remove(1).move(b.x,r).line(b.x,b.y).position(a.pathElements.length+1).line(c.x,r)}).forEach(function(h){var k=i.elem("path",{d:h.stringify()},a.classNames.area,!0).attr({values:b.normalized[g]},c.xmlNs.uri);this.eventEmitter.emit("draw",{type:"area",values:b.normalized[g],path:h.clone(),series:f,seriesIndex:g,axisX:d,axisY:e,chartRect:j,index:g,group:i,element:k})}.bind(this))}}.bind(this)),this.eventEmitter.emit("created",{bounds:e.bounds,chartRect:j,axisX:d,axisY:e,svg:this.svg,options:a})}function e(a,b,d,e){c.Line["super"].constructor.call(this,a,b,f,c.extend({},f,d),e)}var f={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",line:"ct-line",point:"ct-point",area:"ct-area",grid:"ct-grid",gridGroup:"ct-grids",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};c.Line=c.Base.extend({constructor:e,createChart:d})}(window,document,a),function(a,b,c){"use strict";function d(a){var b,d={raw:this.data,normalized:a.distributeSeries?c.getDataArray(this.data,a.reverseData,a.horizontalBars?"x":"y").map(function(a){return[a]}):c.getDataArray(this.data,a.reverseData,a.horizontalBars?"x":"y")};this.svg=c.createSvg(this.container,a.width,a.height,a.classNames.chart+(a.horizontalBars?" "+a.classNames.horizontalBars:""));var e=this.svg.elem("g").addClass(a.classNames.gridGroup),g=this.svg.elem("g"),h=this.svg.elem("g").addClass(a.classNames.labelGroup);if(a.stackBars){var i=c.serialMap(d.normalized,function(){return Array.prototype.slice.call(arguments).map(function(a){return a}).reduce(function(a,b){return{x:a.x+b.x||0,y:a.y+b.y||0}},{x:0,y:0})});b=c.getHighLow([i],c.extend({},a,{referenceValue:0}),a.horizontalBars?"x":"y")}else b=c.getHighLow(d.normalized,c.extend({},a,{referenceValue:0}),a.horizontalBars?"x":"y");b.high=+a.high||(0===a.high?0:b.high),b.low=+a.low||(0===a.low?0:b.low);var j,k,l,m,n,o=c.createChartRect(this.svg,a,f.padding);k=a.distributeSeries&&a.stackBars?d.raw.labels.slice(0,1):d.raw.labels,a.horizontalBars?(j=m=void 0===a.axisX.type?new c.AutoScaleAxis(c.Axis.units.x,d,o,c.extend({},a.axisX,{highLow:b,referenceValue:0})):a.axisX.type.call(c,c.Axis.units.x,d,o,c.extend({},a.axisX,{highLow:b,referenceValue:0})),l=n=void 0===a.axisY.type?new c.StepAxis(c.Axis.units.y,d,o,{ticks:k}):a.axisY.type.call(c,c.Axis.units.y,d,o,a.axisY)):(l=m=void 0===a.axisX.type?new c.StepAxis(c.Axis.units.x,d,o,{ticks:k}):a.axisX.type.call(c,c.Axis.units.x,d,o,a.axisX),j=n=void 0===a.axisY.type?new c.AutoScaleAxis(c.Axis.units.y,d,o,c.extend({},a.axisY,{highLow:b,referenceValue:0})):a.axisY.type.call(c,c.Axis.units.y,d,o,c.extend({},a.axisY,{highLow:b,referenceValue:0})));var p=a.horizontalBars?o.x1+j.projectValue(0):o.y1-j.projectValue(0),q=[];l.createGridAndLabels(e,h,this.supportsForeignObject,a,this.eventEmitter),j.createGridAndLabels(e,h,this.supportsForeignObject,a,this.eventEmitter),d.raw.series.forEach(function(b,e){var f,h,i=e-(d.raw.series.length-1)/2;f=a.distributeSeries&&!a.stackBars?l.axisLength/d.normalized.length/2:a.distributeSeries&&a.stackBars?l.axisLength/2:l.axisLength/d.normalized[e].length/2,h=g.elem("g"),h.attr({"series-name":b.name,meta:c.serialize(b.meta)},c.xmlNs.uri),h.addClass([a.classNames.series,b.className||a.classNames.series+"-"+c.alphaNumerate(e)].join(" ")),d.normalized[e].forEach(function(g,k){var r,s,t,u;if(u=a.distributeSeries&&!a.stackBars?e:a.distributeSeries&&a.stackBars?0:k,r=a.horizontalBars?{x:o.x1+j.projectValue(g&&g.x?g.x:0,k,d.normalized[e]),y:o.y1-l.projectValue(g&&g.y?g.y:0,u,d.normalized[e])}:{x:o.x1+l.projectValue(g&&g.x?g.x:0,u,d.normalized[e]),y:o.y1-j.projectValue(g&&g.y?g.y:0,k,d.normalized[e])},l instanceof c.StepAxis&&(l.options.stretch||(r[l.units.pos]+=f*(a.horizontalBars?-1:1)),r[l.units.pos]+=a.stackBars||a.distributeSeries?0:i*a.seriesBarDistance*(a.horizontalBars?-1:1)),t=q[k]||p,q[k]=t-(p-r[l.counterUnits.pos]),void 0!==g){var v={};v[l.units.pos+"1"]=r[l.units.pos],v[l.units.pos+"2"]=r[l.units.pos],v[l.counterUnits.pos+"1"]=a.stackBars?t:p,v[l.counterUnits.pos+"2"]=a.stackBars?q[k]:r[l.counterUnits.pos],v.x1=Math.min(Math.max(v.x1,o.x1),o.x2),v.x2=Math.min(Math.max(v.x2,o.x1),o.x2),v.y1=Math.min(Math.max(v.y1,o.y2),o.y1),v.y2=Math.min(Math.max(v.y2,o.y2),o.y1),s=h.elem("line",v,a.classNames.bar).attr({value:[g.x,g.y].filter(function(a){return a}).join(","),meta:c.getMetaData(b,k)},c.xmlNs.uri),
  this.eventEmitter.emit("draw",c.extend({type:"bar",value:g,index:k,meta:c.getMetaData(b,k),series:b,seriesIndex:e,axisX:m,axisY:n,chartRect:o,group:h,element:s},v))}}.bind(this))}.bind(this)),this.eventEmitter.emit("created",{bounds:j.bounds,chartRect:o,axisX:m,axisY:n,svg:this.svg,options:a})}function e(a,b,d,e){c.Bar["super"].constructor.call(this,a,b,f,c.extend({},f,d),e)}var f={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:c.noop,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,onlyInteger:!1,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,horizontalBars:!1,distributeSeries:!1,reverseData:!1,classNames:{chart:"ct-chart-bar",horizontalBars:"ct-horizontal-bars",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",bar:"ct-bar",grid:"ct-grid",gridGroup:"ct-grids",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};c.Bar=c.Base.extend({constructor:e,createChart:d})}(window,document,a),function(a,b,c){"use strict";function d(a,b,c){var d=b.x>a.x;return d&&"explode"===c||!d&&"implode"===c?"start":d&&"implode"===c||!d&&"explode"===c?"end":"middle"}function e(a){var b,e,f,h,i,j=[],k=a.startAngle,l=c.getDataArray(this.data,a.reverseData);this.svg=c.createSvg(this.container,a.width,a.height,a.donut?a.classNames.chartDonut:a.classNames.chartPie),e=c.createChartRect(this.svg,a,g.padding),f=Math.min(e.width()/2,e.height()/2),i=a.total||l.reduce(function(a,b){return a+b},0),f-=a.donut?a.donutWidth/2:0,h="outside"===a.labelPosition||a.donut?f:"center"===a.labelPosition?0:f/2,h+=a.labelOffset;var m={x:e.x1+e.width()/2,y:e.y2+e.height()/2},n=1===this.data.series.filter(function(a){return a.hasOwnProperty("value")?0!==a.value:0!==a}).length;a.showLabel&&(b=this.svg.elem("g",null,null,!0));for(var o=0;o<this.data.series.length;o++){var p=this.data.series[o];j[o]=this.svg.elem("g",null,null,!0),j[o].attr({"series-name":p.name},c.xmlNs.uri),j[o].addClass([a.classNames.series,p.className||a.classNames.series+"-"+c.alphaNumerate(o)].join(" "));var q=k+l[o]/i*360;q-k===360&&(q-=.01);var r=c.polarToCartesian(m.x,m.y,f,k-(0===o||n?0:.2)),s=c.polarToCartesian(m.x,m.y,f,q),t=new c.Svg.Path(!a.donut).move(s.x,s.y).arc(f,f,0,q-k>180,0,r.x,r.y);a.donut||t.line(m.x,m.y);var u=j[o].elem("path",{d:t.stringify()},a.donut?a.classNames.sliceDonut:a.classNames.slicePie);if(u.attr({value:l[o],meta:c.serialize(p.meta)},c.xmlNs.uri),a.donut&&u.attr({style:"stroke-width: "+ +a.donutWidth+"px"}),this.eventEmitter.emit("draw",{type:"slice",value:l[o],totalDataSum:i,index:o,meta:p.meta,series:p,group:j[o],element:u,path:t.clone(),center:m,radius:f,startAngle:k,endAngle:q}),a.showLabel){var v=c.polarToCartesian(m.x,m.y,h,k+(q-k)/2),w=a.labelInterpolationFnc(this.data.labels?this.data.labels[o]:l[o],o);if(w||0===w){var x=b.elem("text",{dx:v.x,dy:v.y,"text-anchor":d(m,v,a.labelDirection)},a.classNames.label).text(""+w);this.eventEmitter.emit("draw",{type:"label",index:o,group:b,element:x,text:""+w,x:v.x,y:v.y})}}k=q}this.eventEmitter.emit("created",{chartRect:e,svg:this.svg,options:a})}function f(a,b,d,e){c.Pie["super"].constructor.call(this,a,b,g,c.extend({},g,d),e)}var g={width:void 0,height:void 0,chartPadding:5,classNames:{chartPie:"ct-chart-pie",chartDonut:"ct-chart-donut",series:"ct-series",slicePie:"ct-slice-pie",sliceDonut:"ct-slice-donut",label:"ct-label"},startAngle:0,total:void 0,donut:!1,donutWidth:60,showLabel:!0,labelOffset:0,labelPosition:"inside",labelInterpolationFnc:c.noop,labelDirection:"neutral",reverseData:!1};c.Pie=c.Base.extend({constructor:f,createChart:e,determineAnchorPosition:d})}(window,document,a),a});
  //# sourceMappingURL=chartist.min.js.map
  var searchVisible = 0;
  var transparent = true;
  
  var transparentDemo = true;
  var fixedTop = false;
  
  var navbar_initialized = false;
  
  $(document).ready(function(){
      window_width = $(window).width();
      
      // check if there is an image set for the sidebar's background
      lbd.checkSidebarImage();
      
      // Init navigation toggle for small screens   
      if(window_width <= 991){
          lbd.initRightMenu();   
      }
       
      //  Activate the tooltips   
      $('[rel="tooltip"]').tooltip();
  
      //      Activate the switches with icons 
      if($('.switch').length != 0){
          $('.switch')['bootstrapSwitch']();
      }  
      //      Activate regular switches
      if($("[data-toggle='switch']").length != 0){
           $("[data-toggle='switch']").wrap('<div class="switch" />').parent().bootstrapSwitch();     
      }
       
      $('.form-control').on("focus", function(){
          $(this).parent('.input-group').addClass("input-group-focus");
      }).on("blur", function(){
          $(this).parent(".input-group").removeClass("input-group-focus");
      });
        
  });
  
  // activate collapse right menu when the windows is resized 
  $(window).resize(function(){
      if($(window).width() <= 991){
          lbd.initRightMenu();   
      }
  });
      
  lbd = {
      misc:{
          navbar_menu_visible: 0
      },
      
      checkSidebarImage: function(){
          $sidebar = $('.sidebar');
          image_src = $sidebar.data('image');
          
          if(image_src !== undefined){
              sidebar_container = '<div class="sidebar-background" style="background-image: url(' + image_src + ') "/>'
              $sidebar.append(sidebar_container);
          }  
      },
      initRightMenu: function(){  
           if(!navbar_initialized){
              $navbar = $('nav').find('.navbar-collapse').first().clone(true);
              
              $sidebar = $('.sidebar');
              sidebar_color = $sidebar.data('color');
              
              $logo = $sidebar.find('.logo').first();
              logo_content = $logo[0].outerHTML;
                      
              ul_content = '';
               
              $navbar.attr('data-color',sidebar_color);
               
              // add the content from the sidebar to the right menu
              content_buff = $sidebar.find('.nav').html();
              ul_content = ul_content + content_buff;
              
              //add the content from the regular header to the right menu
              $navbar.children('ul').each(function(){
                  content_buff = $(this).html();
                  ul_content = ul_content + content_buff;   
              });
               
              ul_content = '<ul class="nav navbar-nav">' + ul_content + '</ul>';
              
              navbar_content = logo_content + ul_content;
              
              $navbar.html(navbar_content);
               
              $('body').append($navbar);
               
              background_image = $sidebar.data('image');
              if(background_image != undefined){
                  $navbar.css('background',"url('" + background_image + "')")
                         .removeAttr('data-nav-image')
                         .addClass('has-image');                
              }
               
               
               $toggle = $('.navbar-toggle');
               
               $navbar.find('a').removeClass('btn btn-round btn-default');
               $navbar.find('button').removeClass('btn-round btn-fill btn-info btn-primary btn-success btn-danger btn-warning btn-neutral');
               $navbar.find('button').addClass('btn-simple btn-block');
              
               $toggle.click(function (){    
                  if(lbd.misc.navbar_menu_visible == 1) {
                      $('html').removeClass('nav-open'); 
                      lbd.misc.navbar_menu_visible = 0;
                      $('#bodyClick').remove();
                       setTimeout(function(){
                          $toggle.removeClass('toggled');
                       }, 400);
                  
                  } else {
                      setTimeout(function(){
                          $toggle.addClass('toggled');
                      }, 430);
                      
                      div = '<div id="bodyClick"></div>';
                      $(div).appendTo("body").click(function() {
                          $('html').removeClass('nav-open');
                          lbd.misc.navbar_menu_visible = 0;
                          $('#bodyClick').remove();
                           setTimeout(function(){
                              $toggle.removeClass('toggled');
                           }, 400);
                      });
                     
                      $('html').addClass('nav-open');
                      lbd.misc.navbar_menu_visible = 1;
                      
                  }
              });
              navbar_initialized = true;
          }
     
      }
  }
  
  
  // Returns a function, that, as long as it continues to be invoked, will not
  // be triggered. The function will be called after it stops being called for
  // N milliseconds. If `immediate` is passed, trigger the function on the
  // leading edge, instead of the trailing.
  
  function debounce(func, wait, immediate) {
  	var timeout;
  	return function() {
  		var context = this, args = arguments;
  		clearTimeout(timeout);
  		timeout = setTimeout(function() {
  			timeout = null;
  			if (!immediate) func.apply(context, args);
  		}, wait);
  		if (immediate && !timeout) func.apply(context, args);
  	};
  };
  
  //# sourceMappingURL=admin.js.map
  