/*! jQuery-ui-Slider-Pips - v1.7.2 - 2014-10-19
* Copyright (c) 2014 Simon Goellner <simey.me@gmail.com>; Licensed MIT */
!function(a){"use strict";var b={pips:function(b){function c(b){var c=a(b).data("value"),d=e.element;if(!0===e.options.range){var f,g=d.slider("values");f=g[0]===g[1]?c<g[0]?[c,g[1]]:[g[0],c]:Math.abs(g[0]-c)===Math.abs(g[1]-c)?[c,c]:Math.abs(g[0]-c)<Math.abs(g[1]-c)?[c,g[1]]:[g[0],c],d.slider("values",f),i.range(f)}else d.slider("value",c),i.single(c)}function d(b){var c,d,f=b,i="ui-slider-pip",j="";"first"===b?f=0:"last"===b&&(f=g);var k=e.options.min+e.options.step*f,l=k.toString().replace(".","-");return c="array"===a.type(h.labels)?h.labels[f]||"":"object"===a.type(h.labels)?"first"===b?h.labels.first||"":"last"===b?h.labels.last||"":"array"===a.type(h.labels.rest)?h.labels.rest[f-1]||"":k:k,"first"===b?(d="0%",i+=" ui-slider-pip-first",i+="label"===h.first?" ui-slider-pip-label":"",i+=!1===h.first?" ui-slider-pip-hide":""):"last"===b?(d="100%",i+=" ui-slider-pip-last",i+="label"===h.last?" ui-slider-pip-label":"",i+=!1===h.last?" ui-slider-pip-hide":""):(d=(100/g*b).toFixed(4)+"%",i+="label"===h.rest?" ui-slider-pip-label":"",i+=!1===h.rest?" ui-slider-pip-hide":""),i+=" ui-slider-pip-"+l,j="horizontal"===e.options.orientation?"left: "+d:"bottom: "+d,'<span class="'+i+'" style="'+j+'"><span class="ui-slider-line"></span><span class="ui-slider-label" data-value="'+k+'">'+h.formatLabel(c)+"</span></span>"}var e=this,f="",g=(e.options.max-e.options.min)/e.options.step,h={first:"label",last:"label",rest:"pip",labels:!1,prefix:"",suffix:"",step:g>100?Math.floor(.05*g):1,formatLabel:function(a){return this.prefix+a+this.suffix}};a.extend(h,b),e.options.pipStep=h.step,e.element.addClass("ui-slider-pips").find(".ui-slider-pip").remove();var i={single:function(a){var b=this.resetClasses();b.filter(".ui-slider-pip-"+a).addClass("ui-slider-pip-selected")},range:function(a){var b=this.resetClasses();b.filter(".ui-slider-pip-"+a[0]).addClass("ui-slider-pip-selected-first"),b.filter(".ui-slider-pip-"+a[1]).addClass("ui-slider-pip-selected-second")},resetClasses:function(){var a=e.element.find(".ui-slider-pip").removeClass("ui-slider-pip-selected ui-slider-pip-selected-first ui-slider-pip-selected-second");return a}};e.options.pipStep=Math.round(e.options.pipStep),f+=d("first");for(var j=1;g>j;j++)0===j%e.options.pipStep&&(f+=d(j));f+=d("last");var k,l;e.options.values?(k=["ui-slider-pip-"+e.options.values[0],"ui-slider-pip-"+e.options.values[1]],l=["ui-slider-pip-"+e.options.values[0]+" ui-slider-pip-selected-initial-first","ui-slider-pip-"+e.options.values[1]+" ui-slider-pip-selected-initial-second"],f=f.replace(k[0],l[0]).replace(k[1],l[1])):(k="ui-slider-pip-"+e.options.value,l="ui-slider-pip-"+e.options.value+" ui-slider-pip-selected-initial",f=f.replace(k,l)),e.element.append(f),e.element.on("mouseup",".ui-slider-label",function(){c(this)}),e.element.on("slide.selectPip slidechange.selectPip",function(a,b){b.values?i.range(b.values):i.single(b.value)})}};a.extend(!0,a.ui.slider.prototype,b)}(jQuery),function(a){"use strict";var b={"float":function(b){function c(b,c){var d=[],f=b/e.options.step,h=c/e.options.step;return"array"===a.type(g.labels)?(d[0]=g.labels[f-e.options.min]||b,c&&(d[1]=g.labels[h-e.options.min]||c)):"object"===a.type(g.labels)?(d[0]=e.options.min===b?g.labels.first||e.options.min:e.options.max===b?g.labels.last||e.options.max:"array"===a.type(g.labels.rest)?g.labels.rest[f-e.options.min-1]||b:b,c&&(d[1]=e.options.min===c?g.labels.first||e.options.min:e.options.max===c?g.labels.last||e.options.max:"array"===a.type(g.labels.rest)?g.labels.rest[h-e.options.min-1]||c:c)):(d[0]=b,c&&(d[1]=c)),d}var d,e=this,f=[],g={handle:!0,pips:!1,labels:!1,prefix:"",suffix:"",event:"slidechange slide",formatLabel:function(a){return this.prefix+a+this.suffix}};a.extend(g,b),e.options.value<e.options.min&&(e.options.value=e.options.min),e.options.value>e.options.max&&(e.options.value=e.options.max),e.options.values&&(e.options.values[0]<e.options.min&&(e.options.values[0]=e.options.min),e.options.values[1]<e.options.min&&(e.options.values[1]=e.options.min),e.options.values[0]>e.options.max&&(e.options.values[0]=e.options.max),e.options.values[1]>e.options.max&&(e.options.values[1]=e.options.max)),e.element.addClass("ui-slider-float").find(".ui-slider-tip, .ui-slider-tip-label").remove(),g.handle&&(e.options.values?(f=c(e.options.values[0],e.options.values[1]),d=[a('<span class="ui-slider-tip">'+g.formatLabel(f[0])+"</span>"),a('<span class="ui-slider-tip">'+g.formatLabel(f[1])+"</span>")]):(f=c(e.options.value),d=a('<span class="ui-slider-tip">'+g.formatLabel(f[0])+"</span>")),e.element.find(".ui-slider-handle").each(function(b,c){a(c).append(d[b])})),g.pips&&e.element.find(".ui-slider-label").each(function(b,d){var e,f=a(d),h=f.data("value"),i=f.data("value");i=c(h)[0],e=a('<span class="ui-slider-tip-label">'+g.formatLabel(i)+"</span>").insertAfter(f)}),"slide"!==g.event&&"slidechange"!==g.event&&"slide slidechange"!==g.event&&"slidechange slide"!==g.event&&(g.event="slidechange slide"),e.element.on(g.event,function(b,d){var e=c(d.value);a(d.handle).find(".ui-slider-tip").html(g.formatLabel(e[0]))})}};a.extend(!0,a.ui.slider.prototype,b)}(jQuery);