!function(n){function y(e,t){return t*Math.floor(e/t)}function a(e,t,n,r){if("function"==typeof e.strftime)return e.strftime(t);var i=function(e,t){return t=""+(null==t?"0":t),1==(e=""+e).length?t+e:e},o=[],a=!1,s=e.getHours(),u=s<12;null==n&&(n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),null==r&&(r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);for(var c=12<s?s-12:0==s?12:s,m=0;m<t.length;++m){var h=t.charAt(m);if(a){switch(h){case"a":h=""+r[e.getDay()];break;case"b":h=""+n[e.getMonth()];break;case"d":h=i(e.getDate());break;case"e":h=i(e.getDate()," ");break;case"h":case"H":h=i(s);break;case"I":h=i(c);break;case"l":h=i(c," ");break;case"m":h=i(e.getMonth()+1);break;case"M":h=i(e.getMinutes());break;case"q":h=""+(Math.floor(e.getMonth()/3)+1);break;case"S":h=i(e.getSeconds());break;case"y":h=i(e.getFullYear()%100);break;case"Y":h=""+e.getFullYear();break;case"p":h=u?"am":"pm";break;case"P":h=u?"AM":"PM";break;case"w":h=""+e.getDay()}o.push(h),a=!1}else"%"==h?a=!0:o.push(h)}return o.join("")}function r(e){function t(e,t,n,r){e[t]=function(){return n[r].apply(n,arguments)}}for(var n={date:e},r=(e.strftime!=undefined&&t(n,"strftime",e,"strftime"),t(n,"getTime",e,"getTime"),t(n,"setTime",e,"setTime"),["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds"]),i=0;i<r.length;i++)t(n,"get"+r[i],e,"getUTC"+r[i]),t(n,"set"+r[i],e,"setUTC"+r[i]);return n}function S(e,t){var n;return"browser"==t.timezone?new Date(e):t.timezone&&"utc"!=t.timezone&&"undefined"!=typeof timezoneJS&&"undefined"!=typeof timezoneJS.Date?((n=new timezoneJS.Date).setTimezone(t.timezone),n.setTime(e),n):r(new Date(e))}var z={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},e=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"]],p=e.concat([[3,"month"],[6,"month"],[1,"year"]]),T=e.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);n.plot.plugins.push({init:function(e){e.hooks.processOptions.push(function(e,t){n.each(e.getAxes(),function(e,t){var g=t.options;"time"==g.mode&&(t.tickGenerator=function(e){var t=[],n=S(e.min,g),r=0,i=g.tickSize&&"quarter"===g.tickSize[1]||g.minTickSize&&"quarter"===g.minTickSize[1]?T:p;null!=g.minTickSize&&(r="number"==typeof g.tickSize?g.tickSize:g.minTickSize[0]*z[g.minTickSize[1]]);for(var o=0;o<i.length-1&&!(e.delta<(i[o][0]*z[i[o][1]]+i[o+1][0]*z[i[o+1][1]])/2&&i[o][0]*z[i[o][1]]>=r);++o);var a,s,u=i[o][0],c=("year"==(m=i[o][1])&&(null!=g.minTickSize&&"year"==g.minTickSize[1]?u=Math.floor(g.minTickSize[0]):(a=Math.pow(10,Math.floor(Math.log(e.delta/z.year)/Math.LN10)),u=(s=e.delta/z.year/a)<1.5?1:s<3?2:s<7.5?5:10,u*=a),u<1&&(u=1)),e.tickSize=g.tickSize||[u,m],e.tickSize[0]),m=e.tickSize[1],h=c*z[m],l=("second"==m?n.setSeconds(y(n.getSeconds(),c)):"minute"==m?n.setMinutes(y(n.getMinutes(),c)):"hour"==m?n.setHours(y(n.getHours(),c)):"month"==m?n.setMonth(y(n.getMonth(),c)):"quarter"==m?n.setMonth(3*y(n.getMonth()/3,c)):"year"==m&&n.setFullYear(y(n.getFullYear(),c)),n.setMilliseconds(0),z.minute<=h&&n.setSeconds(0),z.hour<=h&&n.setMinutes(0),z.day<=h&&n.setHours(0),4*z.day<=h&&n.setDate(1),2*z.month<=h&&n.setMonth(y(n.getMonth(),3)),2*z.quarter<=h&&n.setMonth(y(n.getMonth(),6)),z.year<=h&&n.setMonth(0),0),k=Number.NaN;do{var d,f,M=k,k=n.getTime()}while(t.push(k),"month"==m||"quarter"==m?c<1?(n.setDate(1),d=n.getTime(),n.setMonth(n.getMonth()+("quarter"==m?3:1)),f=n.getTime(),n.setTime(k+l*z.hour+(f-d)*c),l=n.getHours(),n.setHours(0)):n.setMonth(n.getMonth()+c*("quarter"==m?3:1)):"year"==m?n.setFullYear(n.getFullYear()+c):n.setTime(k+h),k<e.max&&k!=M);return t},t.tickFormatter=function(e,t){e=S(e,t.options);if(null!=g.timeformat)return a(e,g.timeformat,g.monthNames,g.dayNames);var n=t.options.tickSize&&"quarter"==t.options.tickSize[1]||t.options.minTickSize&&"quarter"==t.options.minTickSize[1],r=t.tickSize[0]*z[t.tickSize[1]],t=t.max-t.min,i=g.twelveHourClock?" %p":"",o=g.twelveHourClock?"%I":"%H",o=r<z.minute?o+":%M:%S"+i:r<z.day?t<2*z.day?o+":%M"+i:"%b %d "+o+":%M"+i:r<z.month?"%b %d":n&&r<z.quarter||!n&&r<z.year?t<z.year?"%b":"%b %Y":n&&r<z.year?t<z.year?"Q%q":"Q%q %Y":"%Y";return a(e,o,g.monthNames,g.dayNames)})})})},options:{xaxis:{timezone:null,timeformat:null,twelveHourClock:!1,monthNames:null}},name:"time",version:"1.0"}),n.plot.formatDate=a}(jQuery);