/*! jQuery Timepicker Addon - v1.4.4 - 2014-03-29 * http://trentrichardson.com/examples/timepicker * Copyright (c) 2014 Trent Richardson; Licensed MIT */ (function($){var Timepicker;if($.ui.timepicker=$.ui.timepicker||{},!$.ui.timepicker.version){$.extend($.ui,{timepicker:{version:"1.4.4"}});Timepicker=function(){this.regional=[];this.regional[""]={currentText:"Now",closeText:"Done",amNames:["AM","A"],pmNames:["PM","P"],timeFormat:"HH:mm",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",millisecText:"Millisecond",microsecText:"Microsecond",timezoneText:"Time Zone",isRTL:!1};this._defaults={showButtonPanel:!0,timeOnly:!1,timeOnlyShowDate:!1,showHour:null,showMinute:null,showSecond:null,showMillisec:null,showMicrosec:null,showTimezone:null,showTime:!0,stepHour:1,stepMinute:1,stepSecond:1,stepMillisec:1,stepMicrosec:1,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMin:0,minuteMin:0,secondMin:0,millisecMin:0,microsecMin:0,hourMax:23,minuteMax:59,secondMax:59,millisecMax:999,microsecMax:999,minDateTime:null,maxDateTime:null,maxTime:null,minTime:null,onSelect:null,hourGrid:0,minuteGrid:0,secondGrid:0,millisecGrid:0,microsecGrid:0,alwaysSetTime:!0,separator:" ",altFieldTimeOnly:!0,altTimeFormat:null,altSeparator:null,altTimeSuffix:null,pickerTimeFormat:null,pickerTimeSuffix:null,showTimepicker:!0,timezoneList:null,addSliderAccess:!1,sliderAccessArgs:null,controlType:"slider",defaultValue:null,parse:"strict"};$.extend(this._defaults,this.regional[""])};$.extend(Timepicker.prototype,{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,millisec_slider:null,microsec_slider:null,timezone_select:null,maxTime:null,minTime:null,hour:0,minute:0,second:0,millisec:0,microsec:0,timezone:null,hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,millisecMinOriginal:null,microsecMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,millisecMaxOriginal:null,microsecMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:null,units:["hour","minute","second","millisec","microsec"],support:{},control:null,setDefaults:function(n){return extendRemove(this._defaults,n||{}),this},_newInst:function($input,opts){var tp_inst=new Timepicker,inlineSettings={},fns={},overrides,i,attrName,attrValue,timezoneList;for(attrName in this._defaults)if(this._defaults.hasOwnProperty(attrName)&&(attrValue=$input.attr("time:"+attrName),attrValue))try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}overrides={beforeShow:function(n,t){if($.isFunction(tp_inst._defaults.evnts.beforeShow))return tp_inst._defaults.evnts.beforeShow.call($input[0],n,t,tp_inst)},onChangeMonthYear:function(n,t,i){tp_inst._updateDateTime(i);$.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)&&tp_inst._defaults.evnts.onChangeMonthYear.call($input[0],n,t,i,tp_inst)},onClose:function(n,t){tp_inst.timeDefined===!0&&$input.val()!==""&&tp_inst._updateDateTime(t);$.isFunction(tp_inst._defaults.evnts.onClose)&&tp_inst._defaults.evnts.onClose.call($input[0],n,t,tp_inst)}};for(i in overrides)overrides.hasOwnProperty(i)&&(fns[i]=opts[i]||null);tp_inst._defaults=$.extend({},this._defaults,inlineSettings,opts,overrides,{evnts:fns,timepicker:tp_inst});tp_inst.amNames=$.map(tp_inst._defaults.amNames,function(n){return n.toUpperCase()});tp_inst.pmNames=$.map(tp_inst._defaults.pmNames,function(n){return n.toUpperCase()});tp_inst.support=detectSupport(tp_inst._defaults.timeFormat+(tp_inst._defaults.pickerTimeFormat?tp_inst._defaults.pickerTimeFormat:"")+(tp_inst._defaults.altTimeFormat?tp_inst._defaults.altTimeFormat:""));typeof tp_inst._defaults.controlType=="string"?(tp_inst._defaults.controlType==="slider"&&typeof $.ui.slider=="undefined"&&(tp_inst._defaults.controlType="select"),tp_inst.control=tp_inst._controls[tp_inst._defaults.controlType]):tp_inst.control=tp_inst._defaults.controlType;timezoneList=[-720,-660,-600,-570,-540,-480,-420,-360,-300,-270,-240,-210,-180,-120,-60,0,60,120,180,210,240,270,300,330,345,360,390,420,480,525,540,570,600,630,660,690,720,765,780,840];tp_inst._defaults.timezoneList!==null&&(timezoneList=tp_inst._defaults.timezoneList);var tzl=timezoneList.length,tzi=0,tzv=null;if(tzl>0&&typeof timezoneList[0]!="object")for(;tzitp_inst._defaults.hourMax?tp_inst._defaults.hourMax:tp_inst._defaults.hour,tp_inst.minute=tp_inst._defaults.minutetp_inst._defaults.minuteMax?tp_inst._defaults.minuteMax:tp_inst._defaults.minute,tp_inst.second=tp_inst._defaults.secondtp_inst._defaults.secondMax?tp_inst._defaults.secondMax:tp_inst._defaults.second,tp_inst.millisec=tp_inst._defaults.millisectp_inst._defaults.millisecMax?tp_inst._defaults.millisecMax:tp_inst._defaults.millisec,tp_inst.microsec=tp_inst._defaults.microsectp_inst._defaults.microsecMax?tp_inst._defaults.microsecMax:tp_inst._defaults.microsec,tp_inst.ampm="",tp_inst.$input=$input,tp_inst._defaults.altField&&(tp_inst.$altInput=$(tp_inst._defaults.altField).css({cursor:"pointer"}).focus(function(){$input.trigger("focus")})),(tp_inst._defaults.minDate===0||tp_inst._defaults.minDateTime===0)&&(tp_inst._defaults.minDate=new Date),(tp_inst._defaults.maxDate===0||tp_inst._defaults.maxDateTime===0)&&(tp_inst._defaults.maxDate=new Date),tp_inst._defaults.minDate!==undefined&&tp_inst._defaults.minDate instanceof Date&&(tp_inst._defaults.minDateTime=new Date(tp_inst._defaults.minDate.getTime())),tp_inst._defaults.minDateTime!==undefined&&tp_inst._defaults.minDateTime instanceof Date&&(tp_inst._defaults.minDate=new Date(tp_inst._defaults.minDateTime.getTime())),tp_inst._defaults.maxDate!==undefined&&tp_inst._defaults.maxDate instanceof Date&&(tp_inst._defaults.maxDateTime=new Date(tp_inst._defaults.maxDate.getTime())),tp_inst._defaults.maxDateTime!==undefined&&tp_inst._defaults.maxDateTime instanceof Date&&(tp_inst._defaults.maxDate=new Date(tp_inst._defaults.maxDateTime.getTime())),tp_inst.$input.bind("focus",function(){tp_inst._onFocus()}),tp_inst},_addTimePicker:function(n){var t=this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val();this.timeDefined=this._parseTime(t);this._limitMinMaxDateTime(n,!1);this._injectTimePicker()},_parseTime:function(n,t){var i,r,u;if(this.inst||(this.inst=$.datepicker._getInst(this.$input[0])),t||!this._defaults.timeOnly){i=$.datepicker._get(this.inst,"dateFormat");try{if(r=parseDateTimeInternal(i,this._defaults.timeFormat,n,$.datepicker._getFormatConfig(this.inst),this._defaults),!r.timeObj)return!1;$.extend(this,r.timeObj)}catch(f){return $.timepicker.log("Error parsing the date/time string: "+f+"\ndate/time string = "+n+"\ntimeFormat = "+this._defaults.timeFormat+"\ndateFormat = "+i),!1}return!0}return(u=$.datepicker.parseTime(this._defaults.timeFormat,n,this._defaults),!u)?!1:($.extend(this,u),!0)},_injectTimePicker:function(){var a=this.inst.dpDiv,t=this.inst.settings,i=this,n="",f="",h=null,c={},o={},v=null,e=0,y=0,s,u,p,g,l,b,r,nt,k,tt,d,w;if(a.find("div.ui-timepicker-div").length===0&&t.showTimepicker){for(s=' style="display:none;"',u='
"+t.timeText+'<\/dt>
<\/dd>",e=0,y=this.units.length;e"+t[n+"Text"]+'<\/dt>
<\/div>",h&&t[n+"Grid"]>0){if(u+='
',n==="hour")for(p=t[n+"Min"];p<=c[n];p+=parseInt(t[n+"Grid"],10))o[n]++,g=$.datepicker.formatTime(this.support.ampm?"hht":"HH",{hour:p},t),u+='
'+g+"<\/td>";else for(l=t[n+"Min"];l<=c[n];l+=parseInt(t[n+"Grid"],10))o[n]++,u+=''+(l<10?"0":"")+l+"<\/td>";u+="<\/tr><\/table><\/div>"}u+="<\/dd>"}for(b=t.showTimezone!==null?t.showTimezone:this.support.timezone,u+='
"+t.timezoneText+"<\/dt>",u+='
<\/dd>",u+="<\/dl><\/div>",r=$(u),t.timeOnly===!0&&(r.prepend('
'+t.timeOnlyTitle+"<\/div><\/div>"),a.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()),e=0,y=i.units.length;e0&&(v=100*o[n]*t[n+"Grid"]/(c[n]-t[n+"Min"]),r.find(".ui_tpicker_"+n+" table").css({width:v+"%",marginLeft:t.isRTL?"0":v/(-2*o[n])+"%",marginRight:t.isRTL?v/(-2*o[n])+"%":"0",borderCollapse:"collapse"}).find("td").click(function(){var r=$(this),u=r.html(),t=parseInt(u.replace(/[^0-9]/g),10),f=u.replace(/[^apm]/ig),e=r.data("for");e==="hour"&&(f.indexOf("p")!==-1&&t<12?t+=12:f.indexOf("a")!==-1&&t===12&&(t=0));i.control.value(i,i[e+"_slider"],n,t);i._onTimeChange();i._onSelectHandler()}).css({cursor:"pointer",width:100/o[n]+"%",textAlign:"center",overflow:"hidden"}));this.timezone_select=r.find(".ui_tpicker_timezone").append("',h=n._defaults.pickerTimeFormat||n._defaults.timeFormat,o=u;o<=f;o+=e)s+='