").text(text).html();
+ },
+
+ 'activeKeyboard' : function($list){
+ var that = this;
+
+ $list.on('focus', function(){
+ $(this).addClass('ms-focus');
+ })
+ .on('blur', function(){
+ $(this).removeClass('ms-focus');
+ })
+ .on('keydown', function(e){
+ switch (e.which) {
+ case 40:
+ case 38:
+ e.preventDefault();
+ e.stopPropagation();
+ that.moveHighlight($(this), (e.which === 38) ? -1 : 1);
+ return;
+ case 37:
+ case 39:
+ e.preventDefault();
+ e.stopPropagation();
+ that.switchList($list);
+ return;
+ case 9:
+ if(that.$element.is('[tabindex]')){
+ e.preventDefault();
+ var tabindex = parseInt(that.$element.attr('tabindex'), 10);
+ tabindex = (e.shiftKey) ? tabindex-1 : tabindex+1;
+ $('[tabindex="'+(tabindex)+'"]').focus();
+ return;
+ }else{
+ if(e.shiftKey){
+ that.$element.trigger('focus');
+ }
+ }
+ }
+ if($.inArray(e.which, that.options.keySelect) > -1){
+ e.preventDefault();
+ e.stopPropagation();
+ that.selectHighlighted($list);
+ return;
+ }
+ });
+ },
+
+ 'moveHighlight': function($list, direction){
+ var $elems = $list.find(this.elemsSelector),
+ $currElem = $elems.filter('.ms-hover'),
+ $nextElem = null,
+ elemHeight = $elems.first().outerHeight(),
+ containerHeight = $list.height(),
+ containerSelector = '#'+this.$container.prop('id');
+
+ $elems.removeClass('ms-hover');
+ if (direction === 1){ // DOWN
+
+ $nextElem = $currElem.nextAll(this.elemsSelector).first();
+ if ($nextElem.length === 0){
+ var $optgroupUl = $currElem.parent();
+
+ if ($optgroupUl.hasClass('ms-optgroup')){
+ var $optgroupLi = $optgroupUl.parent(),
+ $nextOptgroupLi = $optgroupLi.next(':visible');
+
+ if ($nextOptgroupLi.length > 0){
+ $nextElem = $nextOptgroupLi.find(this.elemsSelector).first();
+ } else {
+ $nextElem = $elems.first();
+ }
+ } else {
+ $nextElem = $elems.first();
+ }
+ }
+ } else if (direction === -1){ // UP
+
+ $nextElem = $currElem.prevAll(this.elemsSelector).first();
+ if ($nextElem.length === 0){
+ var $optgroupUl = $currElem.parent();
+
+ if ($optgroupUl.hasClass('ms-optgroup')){
+ var $optgroupLi = $optgroupUl.parent(),
+ $prevOptgroupLi = $optgroupLi.prev(':visible');
+
+ if ($prevOptgroupLi.length > 0){
+ $nextElem = $prevOptgroupLi.find(this.elemsSelector).last();
+ } else {
+ $nextElem = $elems.last();
+ }
+ } else {
+ $nextElem = $elems.last();
+ }
+ }
+ }
+ if ($nextElem.length > 0){
+ $nextElem.addClass('ms-hover');
+ var scrollTo = $list.scrollTop() + $nextElem.position().top -
+ containerHeight / 2 + elemHeight / 2;
+
+ $list.scrollTop(scrollTo);
+ }
+ },
+
+ 'selectHighlighted' : function($list){
+ var $elems = $list.find(this.elemsSelector),
+ $highlightedElem = $elems.filter('.ms-hover').first();
+
+ if ($highlightedElem.length > 0){
+ if ($list.parent().hasClass('ms-selectable')){
+ this.select($highlightedElem.data('ms-value'));
+ } else {
+ this.deselect($highlightedElem.data('ms-value'));
+ }
+ $elems.removeClass('ms-hover');
+ }
+ },
+
+ 'switchList' : function($list){
+ $list.blur();
+ this.$container.find(this.elemsSelector).removeClass('ms-hover');
+ if ($list.parent().hasClass('ms-selectable')){
+ this.$selectionUl.focus();
+ } else {
+ this.$selectableUl.focus();
+ }
+ },
+
+ 'activeMouse' : function($list){
+ var that = this;
+
+ $('body').on('mouseenter', that.elemsSelector, function(){
+ $(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');
+ $(this).addClass('ms-hover');
+ });
+
+ $('body').on('mouseleave', that.elemsSelector, function () {
+ $(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');;
+ });
+ },
+
+ 'refresh' : function() {
+ this.destroy();
+ this.$element.multiSelect(this.options);
+ },
+
+ 'destroy' : function(){
+ $("#ms-"+this.$element.attr("id")).remove();
+ this.$element.css('position', '').css('left', '')
+ this.$element.removeData('multiselect');
+ },
+
+ 'select' : function(value, method){
+ if (typeof value === 'string'){ value = [value]; }
+
+ var that = this,
+ ms = this.$element,
+ msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
+ selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable').filter(':not(.'+that.options.disabledClass+')'),
+ selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection').filter(':not(.'+that.options.disabledClass+')'),
+ options = ms.find('option:not(:disabled)').filter(function(){ return($.inArray(this.value, value) > -1); });
+
+ if (method === 'init'){
+ selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
+ selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection');
+ }
+
+ if (selectables.length > 0){
+ selectables.addClass('ms-selected').hide();
+ selections.addClass('ms-selected').show();
+
+ options.prop('selected', true);
+
+ that.$container.find(that.elemsSelector).removeClass('ms-hover');
+
+ var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
+ if (selectableOptgroups.length > 0){
+ selectableOptgroups.each(function(){
+ var selectablesLi = $(this).find('.ms-elem-selectable');
+ if (selectablesLi.length === selectablesLi.filter('.ms-selected').length){
+ $(this).find('.ms-optgroup-label').hide();
+ }
+ });
+
+ var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
+ selectionOptgroups.each(function(){
+ var selectionsLi = $(this).find('.ms-elem-selection');
+ if (selectionsLi.filter('.ms-selected').length > 0){
+ $(this).find('.ms-optgroup-label').show();
+ }
+ });
+ } else {
+ if (that.options.keepOrder && method !== 'init'){
+ var selectionLiLast = that.$selectionUl.find('.ms-selected');
+ if((selectionLiLast.length > 1) && (selectionLiLast.last().get(0) != selections.get(0))) {
+ selections.insertAfter(selectionLiLast.last());
+ }
+ }
+ }
+ if (method !== 'init'){
+ ms.trigger('change');
+ if (typeof that.options.afterSelect === 'function') {
+ that.options.afterSelect.call(this, value);
+ }
+ }
+ }
+ },
+
+ 'deselect' : function(value){
+ if (typeof value === 'string'){ value = [value]; }
+
+ var that = this,
+ ms = this.$element,
+ msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
+ selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
+ selections = this.$selectionUl.find('#' + msIds.join('-selection, #')+'-selection').filter('.ms-selected').filter(':not(.'+that.options.disabledClass+')'),
+ options = ms.find('option').filter(function(){ return($.inArray(this.value, value) > -1); });
+
+ if (selections.length > 0){
+ selectables.removeClass('ms-selected').show();
+ selections.removeClass('ms-selected').hide();
+ options.prop('selected', false);
+
+ that.$container.find(that.elemsSelector).removeClass('ms-hover');
+
+ var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
+ if (selectableOptgroups.length > 0){
+ selectableOptgroups.each(function(){
+ var selectablesLi = $(this).find('.ms-elem-selectable');
+ if (selectablesLi.filter(':not(.ms-selected)').length > 0){
+ $(this).find('.ms-optgroup-label').show();
+ }
+ });
+
+ var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
+ selectionOptgroups.each(function(){
+ var selectionsLi = $(this).find('.ms-elem-selection');
+ if (selectionsLi.filter('.ms-selected').length === 0){
+ $(this).find('.ms-optgroup-label').hide();
+ }
+ });
+ }
+ ms.trigger('change');
+ if (typeof that.options.afterDeselect === 'function') {
+ that.options.afterDeselect.call(this, value);
+ }
+ }
+ },
+
+ 'select_all' : function(){
+ var ms = this.$element,
+ values = ms.val();
+
+ ms.find('option:not(":disabled")').prop('selected', true);
+ this.$selectableUl.find('.ms-elem-selectable').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').hide();
+ this.$selectionUl.find('.ms-optgroup-label').show();
+ this.$selectableUl.find('.ms-optgroup-label').hide();
+ this.$selectionUl.find('.ms-elem-selection').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').show();
+ this.$selectionUl.focus();
+ ms.trigger('change');
+ if (typeof this.options.afterSelect === 'function') {
+ var selectedValues = $.grep(ms.val(), function(item){
+ return $.inArray(item, values) < 0;
+ });
+ this.options.afterSelect.call(this, selectedValues);
+ }
+ },
+
+ 'deselect_all' : function(){
+ var ms = this.$element,
+ values = ms.val();
+
+ ms.find('option').prop('selected', false);
+ this.$selectableUl.find('.ms-elem-selectable').removeClass('ms-selected').show();
+ this.$selectionUl.find('.ms-optgroup-label').hide();
+ this.$selectableUl.find('.ms-optgroup-label').show();
+ this.$selectionUl.find('.ms-elem-selection').removeClass('ms-selected').hide();
+ this.$selectableUl.focus();
+ ms.trigger('change');
+ if (typeof this.options.afterDeselect === 'function') {
+ this.options.afterDeselect.call(this, values);
+ }
+ },
+
+ sanitize: function(value){
+ var hash = 0, i, character;
+ if (value.length == 0) return hash;
+ var ls = 0;
+ for (i = 0, ls = value.length; i < ls; i++) {
+ character = value.charCodeAt(i);
+ hash = ((hash<<5)-hash)+character;
+ hash |= 0; // Convert to 32bit integer
+ }
+ return hash;
+ }
+ };
+
+ /* MULTISELECT PLUGIN DEFINITION
+ * ======================= */
+
+ $.fn.multiSelect = function () {
+ var option = arguments[0],
+ args = arguments;
+
+ return this.each(function () {
+ var $this = $(this),
+ data = $this.data('multiselect'),
+ options = $.extend({}, $.fn.multiSelect.defaults, $this.data(), typeof option === 'object' && option);
+
+ if (!data){ $this.data('multiselect', (data = new MultiSelect(this, options))); }
+
+ if (typeof option === 'string'){
+ data[option](args[1]);
+ } else {
+ data.init();
+ }
+ });
+ };
+
+ $.fn.multiSelect.defaults = {
+ keySelect: [32],
+ selectableOptgroup: false,
+ disabledClass : 'disabled',
+ dblClick : false,
+ keepOrder: false,
+ cssClass: ''
+ };
+
+ $.fn.multiSelect.Constructor = MultiSelect;
+
+ $.fn.insertAt = function(index, $parent) {
+ return this.each(function() {
+ if (index === 0) {
+ $parent.prepend(this);
+ } else {
+ $parent.children().eq(index - 1).after(this);
+ }
+ });
+}
+
+}(window.jQuery);
diff --git a/public/assets/js/jquery.pnotify.js b/public/assets/js/jquery.pnotify.js
new file mode 100755
index 000000000..885bb53c4
--- /dev/null
+++ b/public/assets/js/jquery.pnotify.js
@@ -0,0 +1,829 @@
+/*
+ * jQuery Pines Notify (pnotify) Plugin 1.2.0
+ *
+ * http://pinesframework.org/pnotify/
+ * Copyright (c) 2009-2012 Hunter Perrin
+ *
+ * Triple license under the GPL, LGPL, and MPL:
+ * http://www.gnu.org/licenses/gpl.html
+ * http://www.gnu.org/licenses/lgpl.html
+ * http://www.mozilla.org/MPL/MPL-1.1.html
+ */
+
+(function($) {
+ var history_handle_top,
+ timer,
+ body,
+ jwindow = $(window),
+ styling = {
+ jqueryui: {
+ container: "ui-widget ui-widget-content ui-corner-all",
+ notice: "ui-state-highlight",
+ // (The actual jQUI notice icon looks terrible.)
+ notice_icon: "ui-icon ui-icon-info",
+ info: "",
+ info_icon: "ui-icon ui-icon-info",
+ success: "ui-state-default",
+ success_icon: "ui-icon ui-icon-circle-check",
+ error: "ui-state-error",
+ error_icon: "ui-icon ui-icon-alert",
+ closer: "ui-icon ui-icon-close",
+ pin_up: "ui-icon ui-icon-pin-w",
+ pin_down: "ui-icon ui-icon-pin-s",
+ hi_menu: "ui-state-default ui-corner-bottom",
+ hi_btn: "ui-state-default ui-corner-all",
+ hi_btnhov: "ui-state-hover",
+ hi_hnd: "ui-icon ui-icon-grip-dotted-horizontal"
+ },
+ bootstrap: {
+ container: "alert",
+ notice: "",
+ notice_icon: "icon-exclamation-sign",
+ info: "alert-info",
+ info_icon: "icon-info-sign",
+ success: "alert-success",
+ success_icon: "icon-ok-sign",
+ error: "alert-error",
+ error_icon: "icon-warning-sign",
+ closer: "icon-remove",
+ pin_up: "icon-pause",
+ pin_down: "icon-play",
+ hi_menu: "well",
+ hi_btn: "btn",
+ hi_btnhov: "",
+ hi_hnd: "icon-chevron-down"
+ }
+ };
+ // Set global variables.
+ var do_when_ready = function(){
+ body = $("body");
+ jwindow = $(window);
+ // Reposition the notices when the window resizes.
+ jwindow.bind('resize', function(){
+ if (timer)
+ clearTimeout(timer);
+ timer = setTimeout($.pnotify_position_all, 10);
+ });
+ };
+ if (document.body)
+ do_when_ready();
+ else
+ $(do_when_ready);
+ $.extend({
+ pnotify_remove_all: function () {
+ var notices_data = jwindow.data("pnotify");
+ /* POA: Added null-check */
+ if (notices_data && notices_data.length) {
+ $.each(notices_data, function(){
+ if (this.pnotify_remove)
+ this.pnotify_remove();
+ });
+ }
+ },
+ pnotify_position_all: function () {
+ // This timer is used for queueing this function so it doesn't run
+ // repeatedly.
+ if (timer)
+ clearTimeout(timer);
+ timer = null;
+ // Get all the notices.
+ var notices_data = jwindow.data("pnotify");
+ if (!notices_data || !notices_data.length)
+ return;
+ // Reset the next position data.
+ $.each(notices_data, function(){
+ var s = this.opts.stack;
+ if (!s) return;
+ s.nextpos1 = s.firstpos1;
+ s.nextpos2 = s.firstpos2;
+ s.addpos2 = 0;
+ s.animation = true;
+ });
+ $.each(notices_data, function(){
+ this.pnotify_position();
+ });
+ },
+ pnotify: function(options) {
+ // Stores what is currently being animated (in or out).
+ var animating;
+
+ // Build main options.
+ var opts;
+ if (typeof options != "object") {
+ opts = $.extend({}, $.pnotify.defaults);
+ opts.text = options;
+ } else {
+ opts = $.extend({}, $.pnotify.defaults, options);
+ }
+ // Translate old pnotify_ style options.
+ for (var i in opts) {
+ if (typeof i == "string" && i.match(/^pnotify_/))
+ opts[i.replace(/^pnotify_/, "")] = opts[i];
+ }
+
+ if (opts.before_init) {
+ if (opts.before_init(opts) === false)
+ return null;
+ }
+
+ // This keeps track of the last element the mouse was over, so
+ // mouseleave, mouseenter, etc can be called.
+ var nonblock_last_elem;
+ // This is used to pass events through the notice if it is non-blocking.
+ var nonblock_pass = function(e, e_name){
+ pnotify.css("display", "none");
+ var element_below = document.elementFromPoint(e.clientX, e.clientY);
+ pnotify.css("display", "block");
+ var jelement_below = $(element_below);
+ var cursor_style = jelement_below.css("cursor");
+ pnotify.css("cursor", cursor_style != "auto" ? cursor_style : "default");
+ // If the element changed, call mouseenter, mouseleave, etc.
+ if (!nonblock_last_elem || nonblock_last_elem.get(0) != element_below) {
+ if (nonblock_last_elem) {
+ dom_event.call(nonblock_last_elem.get(0), "mouseleave", e.originalEvent);
+ dom_event.call(nonblock_last_elem.get(0), "mouseout", e.originalEvent);
+ }
+ dom_event.call(element_below, "mouseenter", e.originalEvent);
+ dom_event.call(element_below, "mouseover", e.originalEvent);
+ }
+ dom_event.call(element_below, e_name, e.originalEvent);
+ // Remember the latest element the mouse was over.
+ nonblock_last_elem = jelement_below;
+ };
+
+ // Get our styling object.
+ var styles = styling[opts.styling];
+
+ // Create our widget.
+ // Stop animation, reset the removal timer, and show the close
+ // button when the user mouses over.
+ var pnotify = $("
", {
+ "class": "ui-pnotify "+opts.addclass,
+ "css": {"display": "none"},
+ "mouseenter": function(e){
+ if (opts.nonblock) e.stopPropagation();
+ if (opts.mouse_reset && animating == "out") {
+ // If it's animating out, animate back in really quickly.
+ pnotify.stop(true);
+ animating = "in";
+ pnotify.css("height", "auto").animate({"width": opts.width, "opacity": opts.nonblock ? opts.nonblock_opacity : opts.opacity}, "fast");
+ }
+ if (opts.nonblock) {
+ // If it's non-blocking, animate to the other opacity.
+ pnotify.animate({"opacity": opts.nonblock_opacity}, "fast");
+ }
+ // Stop the close timer.
+ if (opts.hide && opts.mouse_reset) pnotify.pnotify_cancel_remove();
+ // Show the buttons.
+ if (opts.sticker && !opts.nonblock) pnotify.sticker.trigger("pnotify_icon").css("visibility", "visible");
+ if (opts.closer && !opts.nonblock) pnotify.closer.css("visibility", "visible");
+ },
+ "mouseleave": function(e){
+ if (opts.nonblock) e.stopPropagation();
+ nonblock_last_elem = null;
+ pnotify.css("cursor", "auto");
+ // Animate back to the normal opacity.
+ if (opts.nonblock && animating != "out")
+ pnotify.animate({"opacity": opts.opacity}, "fast");
+ // Start the close timer.
+ if (opts.hide && opts.mouse_reset) pnotify.pnotify_queue_remove();
+ // Hide the buttons.
+ if (opts.sticker_hover)
+ pnotify.sticker.css("visibility", "hidden");
+ if (opts.closer_hover)
+ pnotify.closer.css("visibility", "hidden");
+ $.pnotify_position_all();
+ },
+ "mouseover": function(e){
+ if (opts.nonblock) e.stopPropagation();
+ },
+ "mouseout": function(e){
+ if (opts.nonblock) e.stopPropagation();
+ },
+ "mousemove": function(e){
+ if (opts.nonblock) {
+ e.stopPropagation();
+ nonblock_pass(e, "onmousemove");
+ }
+ },
+ "mousedown": function(e){
+ if (opts.nonblock) {
+ e.stopPropagation();
+ e.preventDefault();
+ nonblock_pass(e, "onmousedown");
+ }
+ },
+ "mouseup": function(e){
+ if (opts.nonblock) {
+ e.stopPropagation();
+ e.preventDefault();
+ nonblock_pass(e, "onmouseup");
+ }
+ },
+ "click": function(e){
+ if (opts.nonblock) {
+ e.stopPropagation();
+ nonblock_pass(e, "onclick");
+ }
+ },
+ "dblclick": function(e){
+ if (opts.nonblock) {
+ e.stopPropagation();
+ nonblock_pass(e, "ondblclick");
+ }
+ }
+ });
+ pnotify.opts = opts;
+ // Create a container for the notice contents.
+ pnotify.container = $("
", {"class": styles.container+" ui-pnotify-container "+(opts.type == "error" ? styles.error : (opts.type == "info" ? styles.info : (opts.type == "success" ? styles.success : styles.notice)))})
+ .appendTo(pnotify);
+ if (opts.cornerclass != "")
+ pnotify.container.removeClass("ui-corner-all").addClass(opts.cornerclass);
+ // Create a drop shadow.
+ if (opts.shadow)
+ pnotify.container.addClass("ui-pnotify-shadow");
+
+ // The current version of Pines Notify.
+ pnotify.pnotify_version = "1.2.0";
+
+ // This function is for updating the notice.
+ pnotify.pnotify = function(options) {
+ // Update the notice.
+ var old_opts = opts;
+ if (typeof options == "string")
+ opts.text = options;
+ else
+ opts = $.extend({}, opts, options);
+ // Translate old pnotify_ style options.
+ for (var i in opts) {
+ if (typeof i == "string" && i.match(/^pnotify_/))
+ opts[i.replace(/^pnotify_/, "")] = opts[i];
+ }
+ pnotify.opts = opts;
+ // Update the corner class.
+ if (opts.cornerclass != old_opts.cornerclass)
+ pnotify.container.removeClass("ui-corner-all").addClass(opts.cornerclass);
+ // Update the shadow.
+ if (opts.shadow != old_opts.shadow) {
+ if (opts.shadow)
+ pnotify.container.addClass("ui-pnotify-shadow");
+ else
+ pnotify.container.removeClass("ui-pnotify-shadow");
+ }
+ // Update the additional classes.
+ if (opts.addclass === false)
+ pnotify.removeClass(old_opts.addclass);
+ else if (opts.addclass !== old_opts.addclass)
+ pnotify.removeClass(old_opts.addclass).addClass(opts.addclass);
+ // Update the title.
+ if (opts.title === false)
+ pnotify.title_container.slideUp("fast");
+ else if (opts.title !== old_opts.title) {
+ if (opts.title_escape)
+ pnotify.title_container.text(opts.title).slideDown(200);
+ else
+ pnotify.title_container.html(opts.title).slideDown(200);
+ }
+ // Update the text.
+ if (opts.text === false) {
+ pnotify.text_container.slideUp("fast");
+ } else if (opts.text !== old_opts.text) {
+ if (opts.text_escape)
+ pnotify.text_container.text(opts.text).slideDown(200);
+ else
+ pnotify.text_container.html(opts.insert_brs ? String(opts.text).replace(/\n/g, "
") : opts.text).slideDown(200);
+ }
+ // Update values for history menu access.
+ pnotify.pnotify_history = opts.history;
+ pnotify.pnotify_hide = opts.hide;
+ // Change the notice type.
+ if (opts.type != old_opts.type)
+ pnotify.container.removeClass(styles.error+" "+styles.notice+" "+styles.success+" "+styles.info).addClass(opts.type == "error" ? styles.error : (opts.type == "info" ? styles.info : (opts.type == "success" ? styles.success : styles.notice)));
+ if (opts.icon !== old_opts.icon || (opts.icon === true && opts.type != old_opts.type)) {
+ // Remove any old icon.
+ pnotify.container.find("div.ui-pnotify-icon").remove();
+ if (opts.icon !== false) {
+ // Build the new icon.
+ $("
", {"class": "ui-pnotify-icon"})
+ .append($("
", {"class": opts.icon === true ? (opts.type == "error" ? styles.error_icon : (opts.type == "info" ? styles.info_icon : (opts.type == "success" ? styles.success_icon : styles.notice_icon))) : opts.icon}))
+ .prependTo(pnotify.container);
+ }
+ }
+ // Update the width.
+ if (opts.width !== old_opts.width)
+ pnotify.animate({width: opts.width});
+ // Update the minimum height.
+ if (opts.min_height !== old_opts.min_height)
+ pnotify.container.animate({minHeight: opts.min_height});
+ // Update the opacity.
+ if (opts.opacity !== old_opts.opacity)
+ pnotify.fadeTo(opts.animate_speed, opts.opacity);
+ // Update the sticker and closer buttons.
+ if (!opts.closer || opts.nonblock)
+ pnotify.closer.css("display", "none");
+ else
+ pnotify.closer.css("display", "block");
+ if (!opts.sticker || opts.nonblock)
+ pnotify.sticker.css("display", "none");
+ else
+ pnotify.sticker.css("display", "block");
+ // Update the sticker icon.
+ pnotify.sticker.trigger("pnotify_icon");
+ // Update the hover status of the buttons.
+ if (opts.sticker_hover)
+ pnotify.sticker.css("visibility", "hidden");
+ else if (!opts.nonblock)
+ pnotify.sticker.css("visibility", "visible");
+ if (opts.closer_hover)
+ pnotify.closer.css("visibility", "hidden");
+ else if (!opts.nonblock)
+ pnotify.closer.css("visibility", "visible");
+ // Update the timed hiding.
+ if (!opts.hide)
+ pnotify.pnotify_cancel_remove();
+ else if (!old_opts.hide)
+ pnotify.pnotify_queue_remove();
+ pnotify.pnotify_queue_position();
+ return pnotify;
+ };
+
+ // Position the notice. dont_skip_hidden causes the notice to
+ // position even if it's not visible.
+ pnotify.pnotify_position = function(dont_skip_hidden){
+ // Get the notice's stack.
+ var s = pnotify.opts.stack;
+ if (!s) return;
+ if (!s.nextpos1)
+ s.nextpos1 = s.firstpos1;
+ if (!s.nextpos2)
+ s.nextpos2 = s.firstpos2;
+ if (!s.addpos2)
+ s.addpos2 = 0;
+ var hidden = pnotify.css("display") == "none";
+ // Skip this notice if it's not shown.
+ if (!hidden || dont_skip_hidden) {
+ var curpos1, curpos2;
+ // Store what will need to be animated.
+ var animate = {};
+ // Calculate the current pos1 value.
+ var csspos1;
+ switch (s.dir1) {
+ case "down":
+ csspos1 = "top";
+ break;
+ case "up":
+ csspos1 = "bottom";
+ break;
+ case "left":
+ csspos1 = "right";
+ break;
+ case "right":
+ csspos1 = "left";
+ break;
+ }
+ curpos1 = parseInt(pnotify.css(csspos1));
+ if (isNaN(curpos1))
+ curpos1 = 0;
+ // Remember the first pos1, so the first visible notice goes there.
+ if (typeof s.firstpos1 == "undefined" && !hidden) {
+ s.firstpos1 = curpos1;
+ s.nextpos1 = s.firstpos1;
+ }
+ // Calculate the current pos2 value.
+ var csspos2;
+ switch (s.dir2) {
+ case "down":
+ csspos2 = "top";
+ break;
+ case "up":
+ csspos2 = "bottom";
+ break;
+ case "left":
+ csspos2 = "right";
+ break;
+ case "right":
+ csspos2 = "left";
+ break;
+ }
+ curpos2 = parseInt(pnotify.css(csspos2));
+ if (isNaN(curpos2))
+ curpos2 = 0;
+ // Remember the first pos2, so the first visible notice goes there.
+ if (typeof s.firstpos2 == "undefined" && !hidden) {
+ s.firstpos2 = curpos2;
+ s.nextpos2 = s.firstpos2;
+ }
+ // Check that it's not beyond the viewport edge.
+ if ((s.dir1 == "down" && s.nextpos1 + pnotify.height() > jwindow.height()) ||
+ (s.dir1 == "up" && s.nextpos1 + pnotify.height() > jwindow.height()) ||
+ (s.dir1 == "left" && s.nextpos1 + pnotify.width() > jwindow.width()) ||
+ (s.dir1 == "right" && s.nextpos1 + pnotify.width() > jwindow.width()) ) {
+ // If it is, it needs to go back to the first pos1, and over on pos2.
+ s.nextpos1 = s.firstpos1;
+ s.nextpos2 += s.addpos2 + (typeof s.spacing2 == "undefined" ? 25 : s.spacing2);
+ s.addpos2 = 0;
+ }
+ // Animate if we're moving on dir2.
+ if (s.animation && s.nextpos2 < curpos2) {
+ switch (s.dir2) {
+ case "down":
+ animate.top = s.nextpos2+"px";
+ break;
+ case "up":
+ animate.bottom = s.nextpos2+"px";
+ break;
+ case "left":
+ animate.right = s.nextpos2+"px";
+ break;
+ case "right":
+ animate.left = s.nextpos2+"px";
+ break;
+ }
+ } else
+ pnotify.css(csspos2, s.nextpos2+"px");
+ // Keep track of the widest/tallest notice in the column/row, so we can push the next column/row.
+ switch (s.dir2) {
+ case "down":
+ case "up":
+ if (pnotify.outerHeight(true) > s.addpos2)
+ s.addpos2 = pnotify.height();
+ break;
+ case "left":
+ case "right":
+ if (pnotify.outerWidth(true) > s.addpos2)
+ s.addpos2 = pnotify.width();
+ break;
+ }
+ // Move the notice on dir1.
+ if (s.nextpos1) {
+ // Animate if we're moving toward the first pos.
+ if (s.animation && (curpos1 > s.nextpos1 || animate.top || animate.bottom || animate.right || animate.left)) {
+ switch (s.dir1) {
+ case "down":
+ animate.top = s.nextpos1+"px";
+ break;
+ case "up":
+ animate.bottom = s.nextpos1+"px";
+ break;
+ case "left":
+ animate.right = s.nextpos1+"px";
+ break;
+ case "right":
+ animate.left = s.nextpos1+"px";
+ break;
+ }
+ } else
+ pnotify.css(csspos1, s.nextpos1+"px");
+ }
+ // Run the animation.
+ if (animate.top || animate.bottom || animate.right || animate.left)
+ pnotify.animate(animate, {duration: 500, queue: false});
+ // Calculate the next dir1 position.
+ switch (s.dir1) {
+ case "down":
+ case "up":
+ s.nextpos1 += pnotify.height() + (typeof s.spacing1 == "undefined" ? 25 : s.spacing1);
+ break;
+ case "left":
+ case "right":
+ s.nextpos1 += pnotify.width() + (typeof s.spacing1 == "undefined" ? 25 : s.spacing1);
+ break;
+ }
+ }
+ };
+
+ // Queue the positiona all function so it doesn't run repeatedly and
+ // use up resources.
+ pnotify.pnotify_queue_position = function(milliseconds){
+ if (timer)
+ clearTimeout(timer);
+ if (!milliseconds)
+ milliseconds = 10;
+ timer = setTimeout($.pnotify_position_all, milliseconds);
+ };
+
+ // Display the notice.
+ pnotify.pnotify_display = function() {
+ // If the notice is not in the DOM, append it.
+ if (!pnotify.parent().length)
+ pnotify.appendTo(body);
+ // Run callback.
+ if (opts.before_open) {
+ if (opts.before_open(pnotify) === false)
+ return;
+ }
+ // Try to put it in the right position.
+ if (opts.stack.push != "top")
+ pnotify.pnotify_position(true);
+ // First show it, then set its opacity, then hide it.
+ if (opts.animation == "fade" || opts.animation.effect_in == "fade") {
+ // If it's fading in, it should start at 0.
+ pnotify.show().fadeTo(0, 0).hide();
+ } else {
+ // Or else it should be set to the opacity.
+ if (opts.opacity != 1)
+ pnotify.show().fadeTo(0, opts.opacity).hide();
+ }
+ pnotify.animate_in(function(){
+ if (opts.after_open)
+ opts.after_open(pnotify);
+
+ pnotify.pnotify_queue_position();
+
+ // Now set it to hide.
+ if (opts.hide)
+ pnotify.pnotify_queue_remove();
+ });
+ };
+
+ // Remove the notice.
+ pnotify.pnotify_remove = function() {
+ if (pnotify.timer) {
+ window.clearTimeout(pnotify.timer);
+ pnotify.timer = null;
+ }
+ // Run callback.
+ if (opts.before_close) {
+ if (opts.before_close(pnotify) === false)
+ return;
+ }
+ pnotify.animate_out(function(){
+ if (opts.after_close) {
+ if (opts.after_close(pnotify) === false)
+ return;
+ }
+ pnotify.pnotify_queue_position();
+ // If we're supposed to remove the notice from the DOM, do it.
+ if (opts.remove)
+ pnotify.detach();
+ });
+ };
+
+ // Animate the notice in.
+ pnotify.animate_in = function(callback){
+ // Declare that the notice is animating in. (Or has completed animating in.)
+ animating = "in";
+ var animation;
+ if (typeof opts.animation.effect_in != "undefined")
+ animation = opts.animation.effect_in;
+ else
+ animation = opts.animation;
+ if (animation == "none") {
+ pnotify.show();
+ callback();
+ } else if (animation == "show")
+ pnotify.show(opts.animate_speed, callback);
+ else if (animation == "fade")
+ pnotify.show().fadeTo(opts.animate_speed, opts.opacity, callback);
+ else if (animation == "slide")
+ pnotify.slideDown(opts.animate_speed, callback);
+ else if (typeof animation == "function")
+ animation("in", callback, pnotify);
+ else
+ pnotify.show(animation, (typeof opts.animation.options_in == "object" ? opts.animation.options_in : {}), opts.animate_speed, callback);
+ };
+
+ // Animate the notice out.
+ pnotify.animate_out = function(callback){
+ // Declare that the notice is animating out. (Or has completed animating out.)
+ animating = "out";
+ var animation;
+ if (typeof opts.animation.effect_out != "undefined")
+ animation = opts.animation.effect_out;
+ else
+ animation = opts.animation;
+ if (animation == "none") {
+ pnotify.hide();
+ callback();
+ } else if (animation == "show")
+ pnotify.hide(opts.animate_speed, callback);
+ else if (animation == "fade")
+ pnotify.fadeOut(opts.animate_speed, callback);
+ else if (animation == "slide")
+ pnotify.slideUp(opts.animate_speed, callback);
+ else if (typeof animation == "function")
+ animation("out", callback, pnotify);
+ else
+ pnotify.hide(animation, (typeof opts.animation.options_out == "object" ? opts.animation.options_out : {}), opts.animate_speed, callback);
+ };
+
+ // Cancel any pending removal timer.
+ pnotify.pnotify_cancel_remove = function() {
+ if (pnotify.timer)
+ window.clearTimeout(pnotify.timer);
+ };
+
+ // Queue a removal timer.
+ pnotify.pnotify_queue_remove = function() {
+ // Cancel any current removal timer.
+ pnotify.pnotify_cancel_remove();
+ pnotify.timer = window.setTimeout(function(){
+ pnotify.pnotify_remove();
+ }, (isNaN(opts.delay) ? 0 : opts.delay));
+ };
+
+ // Provide a button to close the notice.
+ pnotify.closer = $("
", {
+ "class": "ui-pnotify-closer",
+ "css": {"cursor": "pointer", "visibility": opts.closer_hover ? "hidden" : "visible"},
+ "click": function(){
+ pnotify.pnotify_remove();
+ pnotify.sticker.css("visibility", "hidden");
+ pnotify.closer.css("visibility", "hidden");
+ }
+ })
+ .append($("
", {"class": styles.closer}))
+ .appendTo(pnotify.container);
+ if (!opts.closer || opts.nonblock)
+ pnotify.closer.css("display", "none");
+
+ // Provide a button to stick the notice.
+ pnotify.sticker = $("
", {
+ "class": "ui-pnotify-sticker",
+ "css": {"cursor": "pointer", "visibility": opts.sticker_hover ? "hidden" : "visible"},
+ "click": function(){
+ opts.hide = !opts.hide;
+ if (opts.hide)
+ pnotify.pnotify_queue_remove();
+ else
+ pnotify.pnotify_cancel_remove();
+ $(this).trigger("pnotify_icon");
+ }
+ })
+ .bind("pnotify_icon", function(){
+ $(this).children().removeClass(styles.pin_up+" "+styles.pin_down).addClass(opts.hide ? styles.pin_up : styles.pin_down);
+ })
+ .append($("
", {"class": styles.pin_up}))
+ .appendTo(pnotify.container);
+ if (!opts.sticker || opts.nonblock)
+ pnotify.sticker.css("display", "none");
+
+ // Add the appropriate icon.
+ if (opts.icon !== false) {
+ $("
", {"class": "ui-pnotify-icon"})
+ .append($("
", {"class": opts.icon === true ? (opts.type == "error" ? styles.error_icon : (opts.type == "info" ? styles.info_icon : (opts.type == "success" ? styles.success_icon : styles.notice_icon))) : opts.icon}))
+ .prependTo(pnotify.container);
+ }
+
+ // Add a title.
+ pnotify.title_container = $("
", {
+ "class": "ui-pnotify-title"
+ })
+ .appendTo(pnotify.container);
+ if (opts.title === false)
+ pnotify.title_container.hide();
+ else if (opts.title_escape)
+ pnotify.title_container.text(opts.title);
+ else
+ pnotify.title_container.html(opts.title);
+
+ // Add text.
+ pnotify.text_container = $("
", {
+ "class": "ui-pnotify-text"
+ })
+ .appendTo(pnotify.container);
+ if (opts.text === false)
+ pnotify.text_container.hide();
+ else if (opts.text_escape)
+ pnotify.text_container.text(opts.text);
+ else
+ pnotify.text_container.html(opts.insert_brs ? String(opts.text).replace(/\n/g, "
") : opts.text);
+
+ // Set width and min height.
+ if (typeof opts.width == "string")
+ pnotify.css("width", opts.width);
+ if (typeof opts.min_height == "string")
+ pnotify.container.css("min-height", opts.min_height);
+
+ // The history variable controls whether the notice gets redisplayed
+ // by the history pull down.
+ pnotify.pnotify_history = opts.history;
+ // The hide variable controls whether the history pull down should
+ // queue a removal timer.
+ pnotify.pnotify_hide = opts.hide;
+
+ // Add the notice to the notice array.
+ var notices_data = jwindow.data("pnotify");
+ if (notices_data == null || typeof notices_data != "object")
+ notices_data = [];
+ if (opts.stack.push == "top")
+ notices_data = $.merge([pnotify], notices_data);
+ else
+ notices_data = $.merge(notices_data, [pnotify]);
+ jwindow.data("pnotify", notices_data);
+ // Now position all the notices if they are to push to the top.
+ if (opts.stack.push == "top")
+ pnotify.pnotify_queue_position(1);
+
+ // Run callback.
+ if (opts.after_init)
+ opts.after_init(pnotify);
+
+ // Mark the stack so it won't animate the new notice.
+ opts.stack.animation = false;
+
+ // Display the notice.
+ pnotify.pnotify_display();
+
+ return pnotify;
+ }
+ });
+
+ // Some useful regexes.
+ var re_on = /^on/,
+ re_mouse_events = /^(dbl)?click$|^mouse(move|down|up|over|out|enter|leave)$|^contextmenu$/,
+ re_ui_events = /^(focus|blur|select|change|reset)$|^key(press|down|up)$/,
+ re_html_events = /^(scroll|resize|(un)?load|abort|error)$/;
+ // Fire a DOM event.
+ var dom_event = function(e, orig_e){
+ var event_object;
+ e = e.toLowerCase();
+ if (document.createEvent && this.dispatchEvent) {
+ // FireFox, Opera, Safari, Chrome
+ e = e.replace(re_on, '');
+ if (e.match(re_mouse_events)) {
+ // This allows the click event to fire on the notice. There is
+ // probably a much better way to do it.
+ $(this).offset();
+ event_object = document.createEvent("MouseEvents");
+ event_object.initMouseEvent(
+ e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail,
+ orig_e.screenX, orig_e.screenY, orig_e.clientX, orig_e.clientY,
+ orig_e.ctrlKey, orig_e.altKey, orig_e.shiftKey, orig_e.metaKey, orig_e.button, orig_e.relatedTarget
+ );
+ } else if (e.match(re_ui_events)) {
+ event_object = document.createEvent("UIEvents");
+ event_object.initUIEvent(e, orig_e.bubbles, orig_e.cancelable, orig_e.view, orig_e.detail);
+ } else if (e.match(re_html_events)) {
+ event_object = document.createEvent("HTMLEvents");
+ event_object.initEvent(e, orig_e.bubbles, orig_e.cancelable);
+ }
+ if (!event_object) return;
+ this.dispatchEvent(event_object);
+ } else {
+ // Internet Explorer
+ if (!e.match(re_on)) e = "on"+e;
+ event_object = document.createEventObject(orig_e);
+ this.fireEvent(e, event_object);
+ }
+ };
+
+ $.pnotify.defaults = {
+ // The notice's title.
+ title: false,
+ // Whether to escape the content of the title. (Not allow HTML.)
+ title_escape: false,
+ // The notice's text.
+ text: false,
+ // Whether to escape the content of the text. (Not allow HTML.)
+ text_escape: false,
+ // What styling classes to use. (Can be either jqueryui or bootstrap.)
+ styling: "bootstrap",
+ // Additional classes to be added to the notice. (For custom styling.)
+ addclass: "",
+ // Class to be added to the notice for corner styling.
+ cornerclass: "",
+ // Create a non-blocking notice. It lets the user click elements underneath it.
+ nonblock: false,
+ // The opacity of the notice (if it's non-blocking) when the mouse is over it.
+ nonblock_opacity: .2,
+ // Display a pull down menu to redisplay previous notices, and place the notice in the history.
+ history: true,
+ // Width of the notice.
+ width: "300px",
+ // Minimum height of the notice. It will expand to fit content.
+ min_height: "16px",
+ // Type of the notice. "notice", "info", "success", or "error".
+ type: "notice",
+ // Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own icon class.
+ icon: true,
+ // The animation to use when displaying and hiding the notice. "none", "show", "fade", and "slide" are built in to jQuery. Others require jQuery UI. Use an object with effect_in and effect_out to use different effects.
+ animation: "fade",
+ // Speed at which the notice animates in and out. "slow", "def" or "normal", "fast" or number of milliseconds.
+ animate_speed: "slow",
+ // Opacity of the notice.
+ opacity: 1,
+ // Display a drop shadow.
+ shadow: true,
+ // Provide a button for the user to manually close the notice.
+ closer: true,
+ // Only show the closer button on hover.
+ closer_hover: true,
+ // Provide a button for the user to manually stick the notice.
+ sticker: true,
+ // Only show the sticker button on hover.
+ sticker_hover: true,
+ // After a delay, remove the notice.
+ hide: true,
+ // Delay in milliseconds before the notice is removed.
+ delay: 2000,
+ // Reset the hide timer if the mouse moves over the notice.
+ mouse_reset: true,
+ // Remove the notice's elements from the DOM after it is removed.
+ remove: true,
+ // Change new lines to br tags.
+ insert_brs: true,
+ // The stack on which the notices will be placed. Also controls the direction the notices stack.
+ stack: {"dir1": "down", "dir2": "left", "push": "bottom", "spacing1": 25, "spacing2": 25}
+ };
+})(jQuery);
\ No newline at end of file
diff --git a/public/assets/js/jquery.qtip.min.js b/public/assets/js/jquery.qtip.min.js
new file mode 100644
index 000000000..28a2fd31e
--- /dev/null
+++ b/public/assets/js/jquery.qtip.min.js
@@ -0,0 +1,5 @@
+/* qTip2 v2.2.0 tips viewport imagemap svg modal ie6 | qtip2.com | Licensed MIT, GPL | Sun Dec 15 2013 12:33:31 */
+
+!function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=G,this.elements={target:a},this._id=T+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:F,attr:e,onTooltip:F,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=F}function f(a){return a===G||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?F:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?b=a.content={text:c=g(b)?F:b}:c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==F,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,G,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(f(b.title)||(b.button=b.title.button,b.title=b.title.text),g(b.title||F)&&(b.title=F))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===E?{ready:E}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(S,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d
0?setTimeout(d.proxy(a,this),b):(a.call(this),void 0)}function n(a){return this.tooltip.hasClass(bb)?F:(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=m.call(this,function(){this.toggle(E,a)},this.options.show.delay),void 0)}function o(a){if(this.tooltip.hasClass(bb))return F;var b=d(a.relatedTarget),c=b.closest(X)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=m.call(this,function(){this.toggle(F,a)},this.options.hide.delay,this)}function p(a){return this.tooltip.hasClass(bb)||!this.options.hide.inactive?F:(clearTimeout(this.timers.inactive),this.timers.inactive=m.call(this,function(){this.hide(a)},this.options.hide.inactive),void 0)}function q(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function r(a,c,e){d(b.body).delegate(a,(c.split?c:c.join(ib+" "))+ib,function(){var a=z.api[d.attr(this,V)];a&&!a.disabled&&e.apply(a,arguments)})}function s(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):G,p="html5"===f.metadata.type&&o?o[f.metadata.name]:G,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(E,{},z.defaults,f,"object"==typeof q?h(q):G,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===F||!j)return F;k.content.text=j}if(i.container.length||(i.container=m),i.target===F&&(i.target=n),k.show.target===F&&(k.show.target=n),k.show.solo===E&&(k.show.solo=i.container.closest("body")),k.hide.target===F&&(k.hide.target=n),k.position.viewport===E&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new B(i.at,E),i.my=new B(i.my),a.data(T))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===F)return F;return a.attr(U,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(db,l).attr("title",""),g=new e(a,k,c,!!j),a.data(T,g),a.one("remove.qtip-"+c+" removeqtip.qtip-"+c,function(){var a;(a=d(this).data(T))&&a.destroy(!0)}),g}function t(a){return a.charAt(0).toUpperCase()+a.slice(1)}function u(a,b){var d,e,f=b.charAt(0).toUpperCase()+b.slice(1),g=(b+" "+tb.join(f+" ")+f).split(" "),h=0;if(sb[b])return a.css(sb[b]);for(;d=g[h++];)if((e=a.css(d))!==c)return sb[b]=d,e}function v(a,b){return Math.ceil(parseFloat(u(a,b)))}function w(a,b){this._ns="tip",this.options=b,this.offset=b.offset,this.size=[b.width,b.height],this.init(this.qtip=a)}function x(a,b){this.options=b,this._ns="-modal",this.init(this.qtip=a)}function y(a){this._ns="ie6",this.init(this.qtip=a)}var z,A,B,C,D,E=!0,F=!1,G=null,H="x",I="y",J="width",K="height",L="top",M="left",N="bottom",O="right",P="center",Q="flipinvert",R="shift",S={},T="qtip",U="data-hasqtip",V="data-qtip-id",W=["ui-widget","ui-tooltip"],X="."+T,Y="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),Z=T+"-fixed",$=T+"-default",_=T+"-focus",ab=T+"-hover",bb=T+"-disabled",cb="_replacedByqTip",db="oldtitle",eb={ie:function(){for(var a=3,c=b.createElement("div");(c.innerHTML="")&&c.getElementsByTagName("i")[0];);return a>4?a:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||F};A=e.prototype,A._when=function(a){return d.when.apply(d,a)},A.render=function(a){if(this.rendered||this.destroyed)return this;var b,c=this,e=this.options,f=this.cache,g=this.elements,h=e.content.text,i=e.content.title,j=e.content.button,k=e.position,l=("."+this._id+" ",[]);return d.attr(this.target[0],"aria-describedby",this._id),this.tooltip=g.tooltip=b=d("",{id:this._id,"class":[T,$,e.style.classes,T+"-pos-"+e.position.my.abbrev()].join(" "),width:e.style.width||"",height:e.style.height||"",tracking:"mouse"===k.target&&k.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":F,"aria-describedby":this._id+"-content","aria-hidden":E}).toggleClass(bb,this.disabled).attr(V,this.id).data(T,this).appendTo(k.container).append(g.content=d("",{"class":T+"-content",id:this._id+"-content","aria-atomic":E})),this.rendered=-1,this.positioning=E,i&&(this._createTitle(),d.isFunction(i)||l.push(this._updateTitle(i,F))),j&&this._createButton(),d.isFunction(h)||l.push(this._updateContent(h,F)),this.rendered=E,this._setWidget(),d.each(S,function(a){var b;"render"===this.initialize&&(b=this(c))&&(c.plugins[a]=b)}),this._unassignEvents(),this._assignEvents(),this._when(l).then(function(){c._trigger("render"),c.positioning=F,c.hiddenDuringWait||!e.show.ready&&!a||c.toggle(E,f.event,F),c.hiddenDuringWait=F}),z.api[this.id]=this,this},A.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=E;var a=this.target,b=a.attr(db);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()}),clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this._unassignEvents(),a.removeData(T).removeAttr(V).removeAttr(U).removeAttr("aria-describedby"),this.options.suppress&&b&&a.attr("title",b).removeAttr(db),this._unbind(a),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=G,delete z.api[this.id]}}return this.destroyed?this.target:(a===E&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},C=A.checks={builtin:{"^id$":function(a,b,c,e){var f=c===E?z.nextid:c,g=T+"-"+f;f!==F&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),this._updateTitle(c),void 0):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(a[b]=new B(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(E)||this.toggle(E))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass($,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},A.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var fb=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,gb=/^prerender|show\.ready/i;A.set=function(a,b){if(this.destroyed)return this;{var c,e=this.rendered,f=F,g=this.options;this.checks}return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&gb.test(b))return delete a[b],void 0;var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=fb.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=E,d.each(a,d.proxy(j,this)),this.positioning=F,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?G:this.cache.event),this},A._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=E,a.then(function(a){return e.waiting=F,c._update(a,b)},G,function(a){return c._update(a,b)})):a===F||!a&&""!==a?F:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){a.images&&a.images.length&&c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):F},A._waitForContent=function(a){var b=this.cache;return b.waiting=E,(d.fn.imagesLoaded?a.imagesLoaded():d.Deferred().resolve([])).done(function(){b.waiting=F}).promise()},A._updateContent=function(a,b){this._update(a,this.elements.content,b)},A._updateTitle=function(a,b){this._update(a,this.elements.title,b)===F&&this._removeTitle(F)},A._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("",{"class":T+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("",{id:b,"class":T+"-title","aria-atomic":E})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},A._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=G,a!==F&&this.reposition())},A.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=E;var f,g,h=this.cache,i=this.tooltip,j=this.options.position,k=j.target,l=j.my,m=j.at,n=j.viewport,o=j.container,p=j.adjust,q=p.method.split(" "),r=i.outerWidth(F),s=i.outerHeight(F),t=0,u=0,v=i.css("position"),w={left:0,top:0},x=i[0].offsetWidth>0,y=c&&"scroll"===c.type,z=d(a),A=o[0].ownerDocument,B=this.mouse;if(d.isArray(k)&&2===k.length)m={x:M,y:L},w={left:k[0],top:k[1]};else if("mouse"===k)m={x:M,y:L},!B||!B.pageX||!p.mouse&&c&&c.pageX?c&&c.pageX||((!p.mouse||this.options.show.distance)&&h.origin&&h.origin.pageX?c=h.origin:(!c||c&&("resize"===c.type||"scroll"===c.type))&&(c=h.event)):c=B,"static"!==v&&(w=o.offset()),A.body.offsetWidth!==(a.innerWidth||A.documentElement.clientWidth)&&(g=d(b.body).offset()),w={left:c.pageX-w.left+(g&&g.left||0),top:c.pageY-w.top+(g&&g.top||0)},p.mouse&&y&&B&&(w.left-=(B.scrollX||0)-z.scrollLeft(),w.top-=(B.scrollY||0)-z.scrollTop());else{if("event"===k?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?h.target=d(c.target):c.target||(h.target=this.elements.target):"event"!==k&&(h.target=d(k.jquery?k:this.elements.target)),k=h.target,k=d(k).eq(0),0===k.length)return this;k[0]===b||k[0]===a?(t=eb.iOS?a.innerWidth:k.width(),u=eb.iOS?a.innerHeight:k.height(),k[0]===a&&(w={top:(n||k).scrollTop(),left:(n||k).scrollLeft()})):S.imagemap&&k.is("area")?f=S.imagemap(this,k,m,S.viewport?q:F):S.svg&&k&&k[0].ownerSVGElement?f=S.svg(this,k,m,S.viewport?q:F):(t=k.outerWidth(F),u=k.outerHeight(F),w=k.offset()),f&&(t=f.width,u=f.height,g=f.offset,w=f.position),w=this.reposition.offset(k,w,o),(eb.iOS>3.1&&eb.iOS<4.1||eb.iOS>=4.3&&eb.iOS<4.33||!eb.iOS&&"fixed"===v)&&(w.left-=z.scrollLeft(),w.top-=z.scrollTop()),(!f||f&&f.adjustable!==F)&&(w.left+=m.x===O?t:m.x===P?t/2:0,w.top+=m.y===N?u:m.y===P?u/2:0)}return w.left+=p.x+(l.x===O?-r:l.x===P?-r/2:0),w.top+=p.y+(l.y===N?-s:l.y===P?-s/2:0),S.viewport?(w.adjusted=S.viewport(this,w,j,t,u,r,s),g&&w.adjusted.left&&(w.left+=g.left),g&&w.adjusted.top&&(w.top+=g.top)):w.adjusted={left:0,top:0},this._trigger("move",[w,n.elem||n],c)?(delete w.adjusted,e===F||!x||isNaN(w.left)||isNaN(w.top)||"mouse"===k||!d.isFunction(j.effect)?i.css(w):d.isFunction(j.effect)&&(j.effect.call(i,this,d.extend({},w)),i.queue(function(a){d(this).css({opacity:"",height:""}),eb.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=F,this):this},A.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!eb.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var hb=(B=A.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,P).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?I:H}).prototype;hb.invert=function(a,b){this[a]=this[a]===M?O:this[a]===O?M:b||this[a]},hb.string=function(){var a=this.x,b=this.y;return a===b?a:this.precedance===I||this.forceY&&"center"!==b?b+" "+a:a+" "+b},hb.abbrev=function(){var a=this.string().split(" ");return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},hb.clone=function(){return new B(this.string(),this.forceY)},A.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=l(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=E),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",m=this.options[k],n=(this.options[a?"hide":"show"],this.options.position),o=this.options.content,p=this.tooltip.css("width"),q=this.tooltip.is(":visible"),r=a||1===m.target.length,s=!c||m.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!q),h=!g.is(":animated")&&q===a&&s,i=h?G:!!this._trigger(k,[90]),this.destroyed?this:(i!==F&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(e.origin=l(this.mouse),d.isFunction(o.text)&&this._updateContent(o.text,F),d.isFunction(o.title)&&this._updateTitle(o.title,F),!D&&"mouse"===n.target&&n.adjust.mouse&&(d(b).bind("mousemove."+T,this._storeMouse),D=E),p||g.css("width",g.outerWidth(F)),this.reposition(c,arguments[2]),p||g.css("width",""),m.solo&&("string"==typeof m.solo?d(m.solo):d(X,m.solo)).not(g).not(m.target).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,D&&!d(X+'[tracking="true"]:visible',m.solo).not(g).length&&(d(b).unbind("mousemove."+T),D=F),this.blur(c)),j=d.proxy(function(){a?(eb.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof m.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),m.effect===F||r===F?(g[k](),j()):d.isFunction(m.effect)?(g.stop(1,1),m.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&m.target.trigger("qtip-"+this.id+"-inactive"),this))},A.show=function(a){return this.toggle(E,a)},A.hide=function(a){return this.toggle(F,a)},A.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(X),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=z.zindex+b.length;return c.hasClass(_)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+_).qtip("blur",a)),c.addClass(_)[0].style.zIndex=f),this},A.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(_),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},A.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(bb):this.disabled):"boolean"!=typeof a&&(a=E),this.rendered&&this.tooltip.toggleClass(bb,a).attr("aria-disabled",a),this.disabled=!!a,this)},A.enable=function(){return this.disable(F)},A._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),b.button=e.jquery?e:d("",{"class":"qtip-close "+(this.options.style.widget?"":T+"-icon"),title:g,"aria-label":g}).prepend(d("",{"class":"ui-icon ui-icon-close",html:"×"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(bb)||a.hide(b),F})},A._updateButton=function(a){if(!this.rendered)return F;var b=this.elements.button;a?this._createButton():b.remove()},A._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(bb);c.removeClass(bb),bb=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(bb,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass($,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(T+"-icon",!a)},A._storeMouse=function(a){(this.mouse=l(a)).type="mousemove"},A._bind=function(a,b,c,e,f){var g="."+this._id+(e?"-"+e:"");b.length&&d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this))},A._unbind=function(a,b){d(a).unbind("."+this._id+(b?"-"+b:""))};var ib="."+T;d(function(){r(X,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(Z)&&!c.hasClass(bb)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(ab,b)}),r("["+V+"]",Y,p)}),A._trigger=function(a,b,c){var e=d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||G,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=F,!e.isDefaultPrevented()},A._bindEvents=function(a,b,c,e,f,g){if(e.add(c).length===e.length){var h=[];b=d.map(b,function(b){var c=d.inArray(b,a);return c>-1?(h.push(a.splice(c,1)[0]),void 0):b}),h.length&&this._bind(c,h,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)})}this._bind(c,a,f),this._bind(e,b,g)},A._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?F:(this.cache.event=l(a),this.cache.target=a?d(a.target):[c],clearTimeout(this.timers.show),this.timers.show=m.call(this,function(){this.render("object"==typeof a||e.show.ready)},e.show.delay),void 0)}var e=this.options,f=e.show.target,g=e.hide.target,h=e.show.event?d.trim(""+e.show.event).split(" "):[],i=e.hide.event?d.trim(""+e.hide.event).split(" "):[];/mouse(over|enter)/i.test(e.show.event)&&!/mouse(out|leave)/i.test(e.hide.event)&&i.push("mouseleave"),this._bind(f,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=E}),this._bindEvents(h,i,f,g,b,function(){clearTimeout(this.timers.show)}),(e.show.ready||e.prerender)&&b.call(this,a)},A._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),m=(d(b.body),d(a)),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(Z)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(bb)&&this.tooltip[0].offsetWidth>0,e=b.parents(X).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",p),this._bind(i.add(g),z.inactiveEvents,p,"-inactive")),this._bindEvents(r,s,h,i,n,o),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){this.cache.onTarget="mouseenter"===a.type}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(bb)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:m,"resize",q),f.adjust.scroll&&this._bind(m.add(f.container),"scroll",q)},A._unassignEvents=function(){var c=[this.options.show.target[0],this.options.hide.target[0],this.rendered&&this.tooltip[0],this.options.position.container[0],this.options.position.viewport[0],this.options.position.container.closest("html")[0],a,b];this._unbind(d([]).pushStack(d.grep(c,function(a){return"object"==typeof a})))},z=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=G,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],T):G;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,T);if(!a)return E;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),F;a.set(b,e)}}),g!==G?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(E,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===F||c.length<1||z.api[c]?z.nextid++:c,b=s(d(this),c,k),b===F?E:(z.api[c]=b,d.each(S,function(){"initialize"===this.initialize&&this(b)}),b._assignInitialEvents(j),void 0)}))},d.qtip=e,z.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&"object"==typeof f&&f.options.suppress)return arguments.length<2?d.attr(c,db):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(db,b))}return d.fn["attr"+cb].apply(this,arguments)},clone:function(a){var b=(d([]),d.fn["clone"+cb].apply(this,arguments));return a||b.filter("["+db+"]").attr("title",function(){return d.attr(this,db)}).removeAttr(db),b}},function(a,b){if(!b||d.fn[a+cb])return E;var c=d.fn[a+cb]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+cb]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(U))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+cb].apply(this,arguments)}),z.version="2.2.0",z.nextid=0,z.inactiveEvents=Y,z.zindex=15e3,z.defaults={prerender:F,id:F,overwrite:E,suppress:E,content:{text:E,attr:"title",title:F,button:F},position:{my:"top left",at:"bottom right",target:F,container:F,viewport:F,adjust:{x:0,y:0,mouse:E,scroll:E,resize:E,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:F})}},show:{target:F,event:"mouseenter",effect:E,delay:90,solo:F,ready:F,autofocus:F},hide:{target:F,event:"mouseleave",effect:E,delay:0,fixed:F,inactive:F,leave:"window",distance:F},style:{classes:"",widget:F,width:F,height:F,def:E},events:{render:G,move:G,show:G,hide:G,toggle:G,visible:G,hidden:G,focus:G,blur:G}};var jb,kb="margin",lb="border",mb="color",nb="background-color",ob="transparent",pb=" !important",qb=!!b.createElement("canvas").getContext,rb=/rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i,sb={},tb=["Webkit","O","Moz","ms"];if(qb)var ub=a.devicePixelRatio||1,vb=function(){var a=b.createElement("canvas").getContext("2d");return a.backingStorePixelRatio||a.webkitBackingStorePixelRatio||a.mozBackingStorePixelRatio||a.msBackingStorePixelRatio||a.oBackingStorePixelRatio||1}(),wb=ub/vb;else var xb=function(a,b,c){return"'};d.extend(w.prototype,{init:function(a){var b,c;c=this.element=a.elements.tip=d("",{"class":T+"-tip"}).prependTo(a.tooltip),qb?(b=d("").appendTo(this.element)[0].getContext("2d"),b.lineJoin="miter",b.miterLimit=1e5,b.save()):(b=xb("shape",'coordorigin="0,0"',"position:absolute;"),this.element.html(b+b),a._bind(d("*",c).add(c),["click","mousedown"],function(a){a.stopPropagation()},this._ns)),a._bind(a.tooltip,"tooltipmove",this.reposition,this._ns,this),this.create()},_swapDimensions:function(){this.size[0]=this.options.height,this.size[1]=this.options.width},_resetDimensions:function(){this.size[0]=this.options.width,this.size[1]=this.options.height},_useTitle:function(a){var b=this.qtip.elements.titlebar;return b&&(a.y===L||a.y===P&&this.element.position().top+this.size[1]/2+this.options.offsetl&&!rb.test(e[1])&&(e[0]=e[1]),this.border=l=p.border!==E?p.border:l):this.border=l=0,k=this.size=this._calculateSize(b),n.css({width:k[0],height:k[1],lineHeight:k[1]+"px"}),j=b.precedance===I?[s(r.x===M?l:r.x===O?k[0]-q[0]-l:(k[0]-q[0])/2),s(r.y===L?k[1]-q[1]:0)]:[s(r.x===M?k[0]-q[0]:0),s(r.y===L?l:r.y===N?k[1]-q[1]-l:(k[1]-q[1])/2)],qb?(g=o[0].getContext("2d"),g.restore(),g.save(),g.clearRect(0,0,6e3,6e3),h=this._calculateTip(r,q,wb),i=this._calculateTip(r,this.size,wb),o.attr(J,k[0]*wb).attr(K,k[1]*wb),o.css(J,k[0]).css(K,k[1]),this._drawCoords(g,i),g.fillStyle=e[1],g.fill(),g.translate(j[0]*wb,j[1]*wb),this._drawCoords(g,h),g.fillStyle=e[0],g.fill()):(h=this._calculateTip(r),h="m"+h[0]+","+h[1]+" l"+h[2]+","+h[3]+" "+h[4]+","+h[5]+" xe",j[2]=l&&/^(r|b)/i.test(b.string())?8===eb.ie?2:1:0,o.css({coordsize:k[0]+l+" "+(k[1]+l),antialias:""+(r.string().indexOf(P)>-1),left:j[0]-j[2]*Number(f===H),top:j[1]-j[2]*Number(f===I),width:k[0]+l,height:k[1]+l}).each(function(a){var b=d(this);b[b.prop?"prop":"attr"]({coordsize:k[0]+l+" "+(k[1]+l),path:h,fillcolor:e[0],filled:!!a,stroked:!a}).toggle(!(!l&&!a)),!a&&b.html(xb("stroke",'weight="'+2*l+'px" color="'+e[1]+'" miterlimit="1000" joinstyle="miter"'))})),a.opera&&setTimeout(function(){m.tip.css({display:"inline-block",visibility:"visible"})},1),c!==F&&this.calculate(b,k)},calculate:function(a,b){if(!this.enabled)return F;var c,e,f=this,g=this.qtip.elements,h=this.element,i=this.options.offset,j=(g.tooltip.hasClass("ui-widget"),{});return a=a||this.corner,c=a.precedance,b=b||this._calculateSize(a),e=[a.x,a.y],c===H&&e.reverse(),d.each(e,function(d,e){var h,k,l;e===P?(h=c===I?M:L,j[h]="50%",j[kb+"-"+h]=-Math.round(b[c===I?0:1]/2)+i):(h=f._parseWidth(a,e,g.tooltip),k=f._parseWidth(a,e,g.content),l=f._parseRadius(a),j[e]=Math.max(-f.border,d?k:i+(l>h?l:-h)))
+}),j[a[c]]-=b[c===H?0:1],h.css({margin:"",top:"",bottom:"",left:"",right:""}).css(j),j},reposition:function(a,b,d){function e(a,b,c,d,e){a===R&&j.precedance===b&&k[d]&&j[c]!==P?j.precedance=j.precedance===H?I:H:a!==R&&k[d]&&(j[b]=j[b]===P?k[d]>0?d:e:j[b]===d?e:d)}function f(a,b,e){j[a]===P?p[kb+"-"+b]=o[a]=g[kb+"-"+b]-k[b]:(h=g[e]!==c?[k[b],-g[b]]:[-k[b],g[b]],(o[a]=Math.max(h[0],h[1]))>h[0]&&(d[b]-=k[b],o[b]=F),p[g[e]!==c?e:b]=o[a])}if(this.enabled){var g,h,i=b.cache,j=this.corner.clone(),k=d.adjusted,l=b.options.position.adjust.method.split(" "),m=l[0],n=l[1]||l[0],o={left:F,top:F,x:0,y:0},p={};this.corner.fixed!==E&&(e(m,H,I,M,O),e(n,I,H,L,N),j.string()===i.corner.string()||i.cornerTop===k.top&&i.cornerLeft===k.left||this.update(j,F)),g=this.calculate(j),g.right!==c&&(g.left=-g.right),g.bottom!==c&&(g.top=-g.bottom),g.user=this.offset,(o.left=m===R&&!!k.left)&&f(H,M,O),(o.top=n===R&&!!k.top)&&f(I,L,N),this.element.css(p).toggle(!(o.x&&o.y||j.x===P&&o.y||j.y===P&&o.x)),d.left-=g.left.charAt?g.user:m!==R||o.top||!o.left&&!o.top?g.left+this.border:0,d.top-=g.top.charAt?g.user:n!==R||o.left||!o.left&&!o.top?g.top+this.border:0,i.cornerLeft=k.left,i.cornerTop=k.top,i.corner=j.clone()}},destroy:function(){this.qtip._unbind(this.qtip.tooltip,this._ns),this.qtip.elements.tip&&this.qtip.elements.tip.find("*").remove().end().remove()}}),jb=S.tip=function(a){return new w(a,a.options.style.tip)},jb.initialize="render",jb.sanitize=function(a){if(a.style&&"tip"in a.style){var b=a.style.tip;"object"!=typeof b&&(b=a.style.tip={corner:b}),/string|boolean/i.test(typeof b.corner)||(b.corner=E)}},C.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){this.create(),this.qtip.reposition()},"^style.tip.(height|width)$":function(a){this.size=[a.width,a.height],this.update(),this.qtip.reposition()},"^content.title|style.(classes|widget)$":function(){this.update()}},d.extend(E,z.defaults,{style:{tip:{corner:E,mimic:F,width:6,height:6,border:E,offset:0}}}),S.viewport=function(c,d,e,f,g,h,i){function j(a,b,c,e,f,g,h,i,j){var k=d[f],m=v[a],t=w[a],u=c===R,x=m===f?j:m===g?-j:-j/2,y=t===f?i:t===g?-i:-i/2,z=r[f]+s[f]-(o?0:n[f]),A=z-k,B=k+j-(h===J?p:q)-z,C=x-(v.precedance===a||m===v[b]?y:0)-(t===P?i/2:0);return u?(C=(m===f?1:-1)*x,d[f]+=A>0?A:B>0?-B:0,d[f]=Math.max(-n[f]+s[f],k-C,Math.min(Math.max(-n[f]+s[f]+(h===J?p:q),k+C),d[f],"center"===m?k-x:1e9))):(e*=c===Q?2:0,A>0&&(m!==f||B>0)?(d[f]-=C+e,l.invert(a,f)):B>0&&(m!==g||A>0)&&(d[f]-=(m===P?-C:C)+e,l.invert(a,g)),d[f]B&&(d[f]=k,l=v.clone())),d[f]-k}var k,l,m,n,o,p,q,r,s,t=e.target,u=c.elements.tooltip,v=e.my,w=e.at,x=e.adjust,y=x.method.split(" "),z=y[0],A=y[1]||y[0],B=e.viewport,C=e.container,D=c.cache,E={left:0,top:0};return B.jquery&&t[0]!==a&&t[0]!==b.body&&"none"!==x.method?(n=C.offset()||E,o="static"===C.css("position"),k="fixed"===u.css("position"),p=B[0]===a?B.width():B.outerWidth(F),q=B[0]===a?B.height():B.outerHeight(F),r={left:k?0:B.scrollLeft(),top:k?0:B.scrollTop()},s=B.offset()||E,("shift"!==z||"shift"!==A)&&(l=v.clone()),E={left:"none"!==z?j(H,I,z,x.x,M,O,J,f,h):0,top:"none"!==A?j(I,H,A,x.y,L,N,K,g,i):0},l&&D.lastClass!==(m=T+"-pos-"+l.abbrev())&&u.removeClass(c.cache.lastClass).addClass(c.cache.lastClass=m),E):E},S.polys={polygon:function(a,b){var c,d,e,f={width:0,height:0,position:{top:1e10,right:0,bottom:0,left:1e10},adjustable:F},g=0,h=[],i=1,j=1,k=0,l=0;for(g=a.length;g--;)c=[parseInt(a[--g],10),parseInt(a[g+1],10)],c[0]>f.position.right&&(f.position.right=c[0]),c[0]f.position.bottom&&(f.position.bottom=c[1]),c[1]0&&e>0&&i>0&&j>0;)for(d=Math.floor(d/2),e=Math.floor(e/2),b.x===M?i=d:b.x===O?i=f.width-d:i+=Math.floor(d/2),b.y===L?j=e:b.y===N?j=f.height-e:j+=Math.floor(e/2),g=h.length;g--&&!(h.length<2);)k=h[g][0]-f.position.left,l=h[g][1]-f.position.top,(b.x===M&&k>=i||b.x===O&&i>=k||b.x===P&&(i>k||k>f.width-i)||b.y===L&&l>=j||b.y===N&&j>=l||b.y===P&&(j>l||l>f.height-j))&&h.splice(g,1);f.position={left:h[0][0],top:h[0][1]}}return f},rect:function(a,b,c,d){return{width:Math.abs(c-a),height:Math.abs(d-b),position:{left:Math.min(a,c),top:Math.min(b,d)}}},_angles:{tc:1.5,tr:7/4,tl:5/4,bc:.5,br:.25,bl:.75,rc:2,lc:1,c:0},ellipse:function(a,b,c,d,e){var f=S.polys._angles[e.abbrev()],g=0===f?0:c*Math.cos(f*Math.PI),h=d*Math.sin(f*Math.PI);return{width:2*c-Math.abs(g),height:2*d-Math.abs(h),position:{left:a+g,top:b+h},adjustable:F}},circle:function(a,b,c,d){return S.polys.ellipse(a,b,c,c,d)}},S.imagemap=function(a,b,c){b.jquery||(b=d(b));var e,f,g,h,i,j=b.attr("shape").toLowerCase().replace("poly","polygon"),k=d('img[usemap="#'+b.parent("map").attr("name")+'"]'),l=d.trim(b.attr("coords")),m=l.replace(/,$/,"").split(",");if(!k.length)return F;if("polygon"===j)h=S.polys.polygon(m,c);else{if(!S.polys[j])return F;for(g=-1,i=m.length,f=[];++gparseInt(h[0].style.zIndex,10),b||e.closest(X)[0]===h[0]||c(e),g=a.target===k[k.length-1]}}var f,g,h,i,j=this,k={};d.extend(j,{init:function(){return i=j.elem=d("",{id:"qtip-overlay",html:"",mousedown:function(){return F}}).hide(),d(b.body).bind("focusin"+Bb,e),d(b).bind("keydown"+Bb,function(a){f&&f.options.show.modal.escape&&27===a.keyCode&&f.hide(a)}),i.bind("click"+Bb,function(a){f&&f.options.show.modal.blur&&f.hide(a)}),j},update:function(b){f=b,k=b.options.show.modal.stealfocus!==F?b.tooltip.find("*").filter(function(){return a(this)}):[]},toggle:function(a,e,g){var k=(d(b.body),a.tooltip),l=a.options.show.modal,m=l.effect,n=e?"show":"hide",o=i.is(":visible"),p=d(Bb).filter(":visible:not(:animated)").not(k);return j.update(a),e&&l.stealfocus!==F&&c(d(":focus")),i.toggleClass("blurs",l.blur),e&&i.appendTo(b.body),i.is(":animated")&&o===e&&h!==F||!e&&p.length?j:(i.stop(E,F),d.isFunction(m)?m.call(i,e):m===F?i[n]():i.fadeTo(parseInt(g,10)||90,e?1:0,function(){e||i.hide()}),e||i.queue(function(a){i.css({left:"",top:""}),d(Bb).length||i.detach(),a()}),h=e,f.destroyed&&(f=G),j)}}),j.init()},zb=new zb,d.extend(x.prototype,{init:function(a){var b=a.tooltip;return this.options.on?(a.elements.overlay=zb.elem,b.addClass(Ab).css("z-index",z.modal_zindex+d(Bb).length),a._bind(b,["tooltipshow","tooltiphide"],function(a,c,e){var f=a.originalEvent;if(a.target===b[0])if(f&&"tooltiphide"===a.type&&/mouse(leave|enter)/.test(f.type)&&d(f.relatedTarget).closest(zb.elem[0]).length)try{a.preventDefault()}catch(g){}else(!f||f&&"tooltipsolo"!==f.type)&&this.toggle(a,"tooltipshow"===a.type,e)},this._ns,this),a._bind(b,"tooltipfocus",function(a,c){if(!a.isDefaultPrevented()&&a.target===b[0]){var e=d(Bb),f=z.modal_zindex+e.length,g=parseInt(b[0].style.zIndex,10);zb.elem[0].style.zIndex=f-1,e.each(function(){this.style.zIndex>g&&(this.style.zIndex-=1)}),e.filter("."+_).qtip("blur",a.originalEvent),b.addClass(_)[0].style.zIndex=f,zb.update(c);try{a.preventDefault()}catch(h){}}},this._ns,this),a._bind(b,"tooltiphide",function(a){a.target===b[0]&&d(Bb).filter(":visible").not(b).last().qtip("focus",a)},this._ns,this),void 0):this},toggle:function(a,b,c){return a&&a.isDefaultPrevented()?this:(zb.toggle(this.qtip,!!b,c),void 0)},destroy:function(){this.qtip.tooltip.removeClass(Ab),this.qtip._unbind(this.qtip.tooltip,this._ns),zb.toggle(this.qtip,F),delete this.qtip.elements.overlay}}),yb=S.modal=function(a){return new x(a,a.options.show.modal)},yb.sanitize=function(a){a.show&&("object"!=typeof a.show.modal?a.show.modal={on:!!a.show.modal}:"undefined"==typeof a.show.modal.on&&(a.show.modal.on=E))},z.modal_zindex=z.zindex-200,yb.initialize="render",C.modal={"^show.modal.(on|blur)$":function(){this.destroy(),this.init(),this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth>0)}},d.extend(E,z.defaults,{show:{modal:{on:F,effect:E,blur:E,stealfocus:E,escape:E}}});var Cb,Db='';d.extend(y.prototype,{_scroll:function(){var b=this.qtip.elements.overlay;b&&(b[0].style.top=d(a).scrollTop()+"px")},init:function(c){var e=c.tooltip;d("select, object").length<1&&(this.bgiframe=c.elements.bgiframe=d(Db).appendTo(e),c._bind(e,"tooltipmove",this.adjustBGIFrame,this._ns,this)),this.redrawContainer=d("",{id:T+"-rcontainer"}).appendTo(b.body),c.elements.overlay&&c.elements.overlay.addClass("qtipmodal-ie6fix")&&(c._bind(a,["scroll","resize"],this._scroll,this._ns,this),c._bind(e,["tooltipshow"],this._scroll,this._ns,this)),this.redraw()},adjustBGIFrame:function(){var a,b,c=this.qtip.tooltip,d={height:c.outerHeight(F),width:c.outerWidth(F)},e=this.qtip.plugins.tip,f=this.qtip.elements.tip;b=parseInt(c.css("borderLeftWidth"),10)||0,b={left:-b,top:-b},e&&f&&(a="x"===e.corner.precedance?[J,M]:[K,L],b[a[1]]-=f[a[0]]()),this.bgiframe.css(b).css(d)},redraw:function(){if(this.qtip.rendered<1||this.drawing)return this;var a,b,c,d,e=this.qtip.tooltip,f=this.qtip.options.style,g=this.qtip.options.position.container;return this.qtip.drawing=1,f.height&&e.css(K,f.height),f.width?e.css(J,f.width):(e.css(J,"").appendTo(this.redrawContainer),b=e.width(),1>b%2&&(b+=1),c=e.css("maxWidth")||"",d=e.css("minWidth")||"",a=(c+d).indexOf("%")>-1?g.width()/100:0,c=(c.indexOf("%")>-1?a:1)*parseInt(c,10)||b,d=(d.indexOf("%")>-1?a:1)*parseInt(d,10)||0,b=c+d?Math.min(Math.max(b,d),c):b,e.css(J,Math.round(b)).appendTo(g)),this.drawing=0,this},destroy:function(){this.bgiframe&&this.bgiframe.remove(),this.qtip._unbind([a,this.qtip.tooltip],this._ns)}}),Cb=S.ie6=function(a){return 6===eb.ie?new y(a):F},Cb.initialize="render",C.ie6={"^content|style$":function(){this.redraw()}}})}(window,document);
+//# sourceMappingURL=http://cdn.jsdelivr.net/qtip2/2.2.0/jquery.qtip.min.js
\ No newline at end of file
diff --git a/public/assets/js/jquery.qtip2.js b/public/assets/js/jquery.qtip2.js
new file mode 100644
index 000000000..7f3bad9c0
--- /dev/null
+++ b/public/assets/js/jquery.qtip2.js
@@ -0,0 +1,14 @@
+/*
+* qTip2 - Pretty powerful tooltips
+* http://craigsworks.com/projects/qtip2/
+*
+* Version: nightly
+* Copyright 2009-2010 Craig Michael Thompson - http://craigsworks.com
+*
+* Dual licensed under MIT or GPLv2 licenses
+* http://en.wikipedia.org/wiki/MIT_License
+* http://en.wikipedia.org/wiki/GNU_General_Public_License
+*
+* Date: Wed Mar 9 02:39:53 PST 2011
+*/"use strict",function(a,b,c){function z(b){var c=this,d=b.elements,e=d.tooltip,f=".bgiframe-"+b.id,g="tooltipmove"+f+" tooltipshow"+f;a.extend(c,{init:function(){d.bgiframe=a(''),d.bgiframe.appendTo(e),e.bind(g,c.adjust)},adjust:function(){var a=b.get("dimensions"),c=b.plugins.tip,f=b.elements.tip,g,h;h=parseInt(e.css("border-left-width"),10)||0,h={left:-h,top:-h},c&&f&&(g=c.corner.precedance==="x"?["width","left"]:["height","top"],h[g[1]]-=f[g[0]]()),d.bgiframe.css(h).css(a)},destroy:function(){c.iframe.remove(),e.unbind(g)}}),c.init()}function y(c){var f=this,h=c.options.show.modal,i=c.elements,j=i.tooltip,k="#qtip-overlay",l=".qtipmodal",m="tooltipshow"+l+" tooltiphide"+l;c.checks.modal={"^show.modal.(on|blur)$":function(){f.init(),i.overlay.toggle(j.is(":visible"))}},a.extend(f,{init:function(){h.on&&(j.unbind(l).bind(m,function(b,c,d){var e=b.type.replace("tooltip","");a.isFunction(h[e])?h[e].call(i.overlay,d,c):f[e](d)}),f.create(),h.blur===d&&i.overlay.unbind(l+c.id).bind("click"+l+c.id,function(){c.hide.call(c)}),i.overlay.css("cursor",h.blur?"pointer":""))},create:function(){var c=a(k),d;if(c.length){i.overlay=c;return c}d=i.overlay=a("",{id:k.substr(1),css:{position:"absolute",top:0,left:0,display:"none"},mousedown:function(){return e}}).appendTo(document.body),a(b).bind("resize"+l,function(){d.css({height:Math.max(a(b).height(),a(document).height()),width:Math.max(a(b).width(),a(document).width())})}).trigger("resize");return d},toggle:function(b){var h=i.overlay,k=c.options.show.modal.effect,l=b?"show":"hide",m;h||(h=f.create());if(!h.is(":animated")||b)h.stop(d,e),b&&(m=parseInt(a.css(j[0],"z-index"),10),h.css("z-index",(m||g.zindex)-1)),a.isFunction(k)?k.call(h,b):k===e?h[l]():h.fadeTo(90,b?.7:0,function(){b||a(this).hide()})},show:function(){f.toggle(d)},hide:function(){f.toggle(e)},destroy:function(){var d=i.overlay;d&&(a(k).each(function(){var b=a(this).data("qtip");if(b&&b.id!==b.id&&b.options.show.modal)return d=e}),d?(i.overlay.remove(),a(b).unbind(l)):i.overlay.unbind(l+c.id)),j.unbind(m)}}),f.init()}function x(b,g){function v(a){var b=a.precedance==="y",c=n[b?"width":"height"],d=n[b?"height":"width"],e=a.string().indexOf("center")>-1,f=c*(e?.5:1),g=Math.pow,h=Math.round,i,j,k,l=Math.sqrt(g(f,2)+g(d,2)),m=[p/f*l,p/d*l];m[2]=Math.sqrt(g(m[0],2)-g(p,2)),m[3]=Math.sqrt(g(m[1],2)-g(p,2)),i=l+m[2]+m[3]+(e?0:m[0]),j=i/l,k=[h(j*d),h(j*c)];return{height:k[b?0:1],width:k[b?1:0]}}function u(b){var c=k.titlebar&&b.y==="top",d=c?k.titlebar:k.content,e=a.browser.mozilla,f=e?"-moz-":a.browser.webkit?"-webkit-":"",g=b.y+(e?"":"-")+b.x,h=f+(e?"border-radius-"+g:"border-"+g+"-radius");return parseInt(d.css(h),10)||parseInt(l.css(h),10)||0}function t(a,b,c){b=b?b:a[a.precedance];var d=k.titlebar&&a.y==="top",e=d?k.titlebar:k.content,f="border-"+b+"-width",g=parseInt(e.css(f),10);return(c?g||parseInt(l.css(f),10):g)||0}function s(b,e,f,g){if(k.tip){var h=a.extend({},i.corner),l=f.adjusted,n;i.corner.fixed!==d&&(l.left&&(h.x=h.x==="center"?l.left>0?"left":"right":h.x==="left"?"right":"left"),l.top&&(h.y=h.y==="center"?l.top>0?"top":"bottom":h.y==="top"?"bottom":"top"),h.string()!==m.corner&&(m.top!==l.top||m.left!==l.left)&&(n=i.update(h))),n||(n=i.position(h,0)),n.right!==c&&(n.left=n.right),n.bottom!==c&&(n.top=n.bottom),n.option=Math.max(0,j.offset),f.left-=n.left.charAt?n.option:(n.right?-1:1)*n.left,f.top-=n.top.charAt?n.option:(n.bottom?-1:1)*n.top,m.left=l.left,m.top=l.top,m.corner=h.string()}}var i=this,j=b.options.style.tip,k=b.elements,l=k.tooltip,m={top:0,left:0,corner:""},n={width:j.width,height:j.height},o={},p=j.border||0,q=".qtip-tip",r=a("")[0].getContext;i.corner=f,i.mimic=f,b.checks.tip={"^position.my|style.tip.(corner|mimic|border)$":function(){i.init()||i.destroy(),b.reposition()},"^style.tip.(height|width)$":function(){n={width:j.width,height:j.height},i.create(),i.update(),b.reposition()},"^content.title.text|style.(classes|widget)$":function(){k.tip&&i.update()}},a.extend(i,{init:function(){var b=i.detectCorner()&&(r||a.browser.msie);b&&(i.create(),i.update(),l.unbind(q).bind("tooltipmove"+q,s));return b},detectCorner:function(){var a=j.corner,c=b.options.position,f=c.at,g=c.my.string?c.my.string():c.my;if(a===e||g===e&&f===e)return e;a===d?i.corner=new h.Corner(g):a.string||(i.corner=new h.Corner(a),i.corner.fixed=d);return i.corner.string()!=="centercenter"},detectColours:function(){var c,d=k.tip.css({backgroundColor:"",border:""}),e=i.corner,f=e[e.precedance],g="border-"+f+"-color",h="border"+f.charAt(0)+f.substr(1)+"Color",m=/rgba?\(0, 0, 0(, 0)?\)|transparent/i,p="background-color",q="transparent",r=a(document.body).css("color"),s=b.elements.content.css("color"),t=k.titlebar&&(e.y==="top"||e.y==="center"&&d.position().top+n.height/2+j.offset",{"class":"ui-tooltip-tip"}).css({width:b,height:c}).prependTo(l),r?a("").appendTo(k.tip)[0].getContext("2d").save():(d='',k.tip.html(p?d+=d:d))},update:function(b){var c=k.tip,g=c.children(),l=n.width,m=n.height,q="px solid ",s="px dashed transparent",u=j.mimic,x=Math.round,y,z,A,B,C;b||(b=i.corner),u===e?u=b:(u=new h.Corner(u),u.precedance=b.precedance,u.x==="inherit"?u.x=b.x:u.y==="inherit"?u.y=b.y:u.x===u.y&&(u[b.precedance]=b[b.precedance])),y=u.precedance,i.detectColours(),p=o.border==="transparent"||o.border==="#123456"?0:j.border===d?t(b,f,d):j.border,A=w(u,l,m),C=v(b),c.css(C),b.precedance==="y"?B=[x(u.x==="left"?p:u.x==="right"?C.width-l-p:(C.width-l)/2),x(u.y==="top"?C.height-m:0)]:B=[x(u.x==="left"?C.width-l:0),x(u.y==="top"?p:u.y==="bottom"?C.height-m-p:(C.height-m)/2)],r?(g.attr(C),z=g[0].getContext("2d"),z.restore(),z.save(),z.clearRect(0,0,3e3,3e3),z.translate(B[0],B[1]),z.beginPath(),z.moveTo(A[0][0],A[0][1]),z.lineTo(A[1][0],A[1][1]),z.lineTo(A[2][0],A[2][1]),z.closePath(),z.fillStyle=o.fill,z.strokeStyle=o.border,z.lineWidth=p*2,z.lineJoin="miter",z.miterLimit=100,z.stroke(),z.fill()):(A="m"+A[0][0]+","+A[0][1]+" l"+A[1][0]+","+A[1][1]+" "+A[2][0]+","+A[2][1]+" xe",B[2]=p&&/^(r|b)/i.test(b.string())?1:0,g.css({antialias:""+(u.string().indexOf("center")>-1),left:B[0]-B[2]*Number(y==="x"),top:B[1]-B[2]*Number(y==="y"),width:l+p,height:m+p}).each(function(b){var c=a(this);c.attr({coordsize:l+p+" "+(m+p),path:A,fillcolor:o.fill,filled:!!b,stroked:!b}).css({display:p||b?"block":"none"}),!b&&p>0&&c.html()===""&&c.html('')}));return i.position(b,1)},position:function(b,c){var f=k.tip,g={},h=Math.max(0,j.offset),l,m,n;if(j.corner===e||!f)return e;b=b||i.corner,l=b.precedance,m=v(b),n=a.browser.msie&&p&&/^(b|r)/i.test(b.string())?1:0,a.each(l==="y"?[b.x,b.y]:[b.y,b.x],function(a,c){var e,f;c==="center"?(e=l==="y"?"left":"top",g[e]="50%",g["margin-"+e]=-Math.round(m[l==="y"?"width":"height"]/2)+h):(e=t(b,c,d),f=u(b),g[c]=a||!p?t(b,c)+(a?0:f):h+(f>e?f:0))}),g[b[l]]-=m[l==="x"?"width":"height"]+n,c&&f.css({top:"",bottom:"",left:"",right:"",margin:""}).css(g);return g},destroy:function(){k.tip&&k.tip.remove(),l.unbind(q)}}),i.init()}function w(a,b,c){var d=Math.ceil(b/2),e=Math.ceil(c/2),f={bottomright:[[0,0],[b,c],[b,0]],bottomleft:[[0,0],[b,0],[0,c]],topright:[[0,c],[b,0],[b,c]],topleft:[[0,0],[0,c],[b,c]],topcenter:[[0,c],[d,0],[b,c]],bottomcenter:[[0,0],[b,0],[d,c]],rightcenter:[[0,0],[b,e],[0,c]],leftcenter:[[b,0],[b,c],[0,e]]};f.lefttop=f.bottomright,f.righttop=f.bottomleft,f.leftbottom=f.topright,f.rightbottom=f.topleft;return f[a.string()]}function v(b){var c=this,d=b.elements.tooltip,e=b.options.content.ajax,f=".qtip-ajax",g=/
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -62,7 +62,7 @@