(function(e){function q(){this.regional=[];this.regional[""]={currentText:"Now",closeText:"Done",ampm:false,timeFormat:"hh:mm tt",timeSuffix:"",timeOnlyTitle:"Choose Time",timeText:"Time",hourText:"Hour",minuteText:"Minute",secondText:"Second",timezoneText:"Time Zone"};this._defaults={showButtonPanel:true,timeOnly:false,showHour:true,showMinute:true,showSecond:false,showTimezone:false,showTime:true,stepHour:0.05,stepMinute:0.05,stepSecond:0.05,hour:0,minute:0,second:0,timezone:"+0000",hourMin:0,minuteMin:0,
secondMin:0,hourMax:23,minuteMax:59,secondMax:59,minDateTime:null,maxDateTime:null,hourGrid:0,minuteGrid:0,secondGrid:0,alwaysSetTime:true,separator:" ",altFieldTimeOnly:true,showTimepicker:true,timezoneList:["-1100","-1000","-0900","-0800","-0700","-0600","-0500","-0400","-0300","-0200","-0100","+0000","+0100","+0200","+0300","+0400","+0500","+0600","+0700","+0800","+0900","+1000","+1100","+1200"]};e.extend(this._defaults,this.regional[""])}e.extend(e.ui,{timepicker:{version:"0.9.6"}});e.extend(q.prototype,
{$input:null,$altInput:null,$timeObj:null,inst:null,hour_slider:null,minute_slider:null,second_slider:null,timezone_select:null,hour:0,minute:0,second:0,timezone:"+0000",hourMinOriginal:null,minuteMinOriginal:null,secondMinOriginal:null,hourMaxOriginal:null,minuteMaxOriginal:null,secondMaxOriginal:null,ampm:"",formattedDate:"",formattedTime:"",formattedDateTime:"",timezoneList:["-1100","-1000","-0900","-0800","-0700","-0600","-0500","-0400","-0300","-0200","-0100","+0000","+0100","+0200","+0300",
"+0400","+0500","+0600","+0700","+0800","+0900","+1000","+1100","+1200"],setDefaults:function(c){var a=this._defaults;c=c||{};e.extend(a,c);for(var b in c)if(c[b]===null||c[b]===undefined)a[b]=c[b];return this},_newInst:function(c,a){var b=new q,d={},f;for(f in this._defaults){var i=c.attr("time:"+f);if(i)try{d[f]=eval(i)}catch(g){d[f]=i}}b._defaults=e.extend({},this._defaults,d,a,{beforeShow:function(h,l){e.isFunction(a.beforeShow)&&a.beforeShow(h,l,b)},onChangeMonthYear:function(h,l,n){b._updateDateTime(n);
e.isFunction(a.onChangeMonthYear)&&a.onChangeMonthYear.call(c[0],h,l,n,b)},onClose:function(h,l){b.timeDefined===true&&c.val()!=""&&b._updateDateTime(l);e.isFunction(a.onClose)&&a.onClose.call(c[0],h,l,b)},timepicker:b});b.hour=b._defaults.hour;b.minute=b._defaults.minute;b.second=b._defaults.second;b.ampm="";b.$input=c;if(a.altField)b.$altInput=e(a.altField).css({cursor:"pointer"}).focus(function(){c.trigger("focus")});if(b._defaults.minDate!==undefined&&b._defaults.minDate instanceof Date)b._defaults.minDateTime=
new Date(b._defaults.minDate.getTime());if(b._defaults.minDateTime!==undefined&&b._defaults.minDateTime instanceof Date)b._defaults.minDate=new Date(b._defaults.minDateTime.getTime());if(b._defaults.maxDate!==undefined&&b._defaults.maxDate instanceof Date)b._defaults.maxDateTime=new Date(b._defaults.maxDate.getTime());if(b._defaults.maxDateTime!==undefined&&b._defaults.maxDateTime instanceof Date)b._defaults.maxDate=new Date(b._defaults.maxDateTime.getTime());return b},_addTimePicker:function(c){this.timeDefined=
this._parseTime(this.$altInput&&this._defaults.altFieldTimeOnly?this.$input.val()+" "+this.$altInput.val():this.$input.val());this._limitMinMaxDateTime(c,false);this._injectTimePicker()},_parseTime:function(c,a){var b=this._defaults.timeFormat.toString().replace(/h{1,2}/ig,"(\\d?\\d)").replace(/m{1,2}/ig,"(\\d?\\d)").replace(/s{1,2}/ig,"(\\d?\\d)").replace(/t{1,2}/ig,"(am|pm|a|p)?").replace(/z{1}/ig,"((\\+|-)\\d\\d\\d\\d)?").replace(/\s/g,"\\s?")+this._defaults.timeSuffix+"$",d=this._getFormatPositions();
if(!this.inst)this.inst=e.datepicker._getInst(this.$input[0]);if(a||!this._defaults.timeOnly)b=".{"+e.datepicker._get(this.inst,"dateFormat").length+",}"+this._defaults.separator.replace(RegExp("[.*+?|()\\[\\]{}\\\\]","g"),"\\$&")+b;if(b=c.match(RegExp(b,"i"))){if(d.t!==-1)this.ampm=(b[d.t]===undefined||b[d.t].length===0?"":b[d.t].charAt(0).toUpperCase()=="A"?"AM":"PM").toUpperCase();if(d.h!==-1)this.hour=this.ampm=="AM"&&b[d.h]=="12"?0:this.ampm=="PM"&&b[d.h]!="12"?(parseFloat(b[d.h])+12).toFixed(0):
Number(b[d.h]);if(d.m!==-1)this.minute=Number(b[d.m]);if(d.s!==-1)this.second=Number(b[d.s]);if(d.z!==-1)this.timezone=b[d.z];return true}return false},_getFormatPositions:function(){var c=this._defaults.timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|t{1,2}|z)/g),a={h:-1,m:-1,s:-1,t:-1,z:-1};if(c)for(var b=0;b<c.length;b++)if(a[c[b].toString().charAt(0)]==-1)a[c[b].toString().charAt(0)]=b+1;return a},_injectTimePicker:function(){var c=this.inst.dpDiv,a=this._defaults,b=this,d=(a.hourMax-a.hourMax%
a.stepHour).toFixed(0),f=(a.minuteMax-a.minuteMax%a.stepMinute).toFixed(0),i=(a.secondMax-a.secondMax%a.stepSecond).toFixed(0),g=this.inst.id.toString().replace(/([^A-Za-z0-9_])/g,"");if(c.find("div#ui-timepicker-div-"+g).length===0&&a.showTimepicker){var h='<div class="ui-timepicker-div" id="ui-timepicker-div-'+g+'"><dl><dt class="ui_tpicker_time_label" id="ui_tpicker_time_label_'+g+'"'+(a.showTime?"":' style="display:none;"')+">"+a.timeText+'</dt><dd class="ui_tpicker_time" id="ui_tpicker_time_'+
g+'"'+(a.showTime?"":' style="display:none;"')+'></dd><dt class="ui_tpicker_hour_label" id="ui_tpicker_hour_label_'+g+'"'+(a.showHour?"":' style="display:none;"')+">"+a.hourText+"</dt>",l=0,n=0,r=0,m;if(a.showHour&&a.hourGrid>0){h+='<dd class="ui_tpicker_hour"><div id="ui_tpicker_hour_'+g+'"'+(a.showHour?"":' style="display:none;"')+'></div><div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';for(var k=a.hourMin;k<=d;k+=a.hourGrid){l++;var p=a.ampm&&k>12?k-12:k;if(p<10)p="0"+
p;if(a.ampm)if(k==0)p="12a";else p+=k<12?"a":"p";h+="<td>"+p+"</td>"}h+="</tr></table></div></dd>"}else h+='<dd class="ui_tpicker_hour" id="ui_tpicker_hour_'+g+'"'+(a.showHour?"":' style="display:none;"')+"></dd>";h+='<dt class="ui_tpicker_minute_label" id="ui_tpicker_minute_label_'+g+'"'+(a.showMinute?"":' style="display:none;"')+">"+a.minuteText+"</dt>";if(a.showMinute&&a.minuteGrid>0){h+='<dd class="ui_tpicker_minute ui_tpicker_minute_'+a.minuteGrid+'"><div id="ui_tpicker_minute_'+g+'"'+(a.showMinute?
"":' style="display:none;"')+'></div><div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';for(k=a.minuteMin;k<=f;k+=a.minuteGrid){n++;h+="<td>"+(k<10?"0":"")+k+"</td>"}h+="</tr></table></div></dd>"}else h+='<dd class="ui_tpicker_minute" id="ui_tpicker_minute_'+g+'"'+(a.showMinute?"":' style="display:none;"')+"></dd>";h+='<dt class="ui_tpicker_second_label" id="ui_tpicker_second_label_'+g+'"'+(a.showSecond?"":' style="display:none;"')+">"+a.secondText+"</dt>";if(a.showSecond&&
a.secondGrid>0){h+='<dd class="ui_tpicker_second ui_tpicker_second_'+a.secondGrid+'"><div id="ui_tpicker_second_'+g+'"'+(a.showSecond?"":' style="display:none;"')+'></div><div style="padding-left: 1px"><table><tr>';for(k=a.secondMin;k<=i;k+=a.secondGrid){r++;h+="<td>"+(k<10?"0":"")+k+"</td>"}h+="</tr></table></div></dd>"}else h+='<dd class="ui_tpicker_second" id="ui_tpicker_second_'+g+'"'+(a.showSecond?"":' style="display:none;"')+"></dd>";h+='<dt class="ui_tpicker_timezone_label" id="ui_tpicker_timezone_label_'+
g+'"'+(a.showTimezone?"":' style="display:none;"')+">"+a.timezoneText+"</dt>";h+='<dd class="ui_tpicker_timezone" id="ui_tpicker_timezone_'+g+'"'+(a.showTimezone?"":' style="display:none;"')+"></dd>";h+="</dl></div>";$tp=e(h);if(a.timeOnly===true){$tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all"><div class="ui-datepicker-title">'+a.timeOnlyTitle+"</div></div>");c.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()}this.hour_slider=$tp.find("#ui_tpicker_hour_"+
g).slider({orientation:"horizontal",value:this.hour,min:a.hourMin,max:d,step:a.stepHour,slide:function(j,o){b.hour_slider.slider("option","value",o.value);b._onTimeChange()}});this.minute_slider=$tp.find("#ui_tpicker_minute_"+g).slider({orientation:"horizontal",value:this.minute,min:a.minuteMin,max:f,step:a.stepMinute,slide:function(j,o){b.minute_slider.slider("option","value",o.value);b._onTimeChange()}});this.second_slider=$tp.find("#ui_tpicker_second_"+g).slider({orientation:"horizontal",value:this.second,
min:a.secondMin,max:i,step:a.stepSecond,slide:function(j,o){b.second_slider.slider("option","value",o.value);b._onTimeChange()}});this.timezone_select=$tp.find("#ui_tpicker_timezone_"+g).append("<select></select>").find("select");e.fn.append.apply(this.timezone_select,e.map(a.timezoneList,function(j){return e("<option />").val(typeof j=="object"?j.value:j).text(typeof j=="object"?j.label:j)}));this.timezone_select.val(typeof this.timezone!="undefined"&&this.timezone!=null&&this.timezone!=""?this.timezone:
a.timezone);this.timezone_select.change(function(){b._onTimeChange()});if(a.showHour&&a.hourGrid>0){m=100*l*a.hourGrid/(d-a.hourMin);$tp.find(".ui_tpicker_hour table").css({width:m+"%",marginLeft:m/(-2*l)+"%",borderCollapse:"collapse"}).find("td").each(function(){e(this).click(function(){var j=e(this).html();if(a.ampm){var o=j.substring(2).toLowerCase();j=parseInt(j.substring(0,2),10);j=o=="a"?j==12?0:j:j==12?12:j+12}b.hour_slider.slider("option","value",j);b._onTimeChange();b._onSelectHandler()}).css({cursor:"pointer",
width:100/l+"%",textAlign:"center",overflow:"hidden"})})}if(a.showMinute&&a.minuteGrid>0){m=100*n*a.minuteGrid/(f-a.minuteMin);$tp.find(".ui_tpicker_minute table").css({width:m+"%",marginLeft:m/(-2*n)+"%",borderCollapse:"collapse"}).find("td").each(function(){e(this).click(function(){b.minute_slider.slider("option","value",e(this).html());b._onTimeChange();b._onSelectHandler()}).css({cursor:"pointer",width:100/n+"%",textAlign:"center",overflow:"hidden"})})}a.showSecond&&a.secondGrid>0&&$tp.find(".ui_tpicker_second table").css({width:m+
"%",marginLeft:m/(-2*r)+"%",borderCollapse:"collapse"}).find("td").each(function(){e(this).click(function(){b.second_slider.slider("option","value",e(this).html());b._onTimeChange();b._onSelectHandler()}).css({cursor:"pointer",width:100/r+"%",textAlign:"center",overflow:"hidden"})});d=c.find(".ui-datepicker-buttonpane");d.length?d.before($tp):c.append($tp);this.$timeObj=$tp.find("#ui_tpicker_time_"+g);if(this.inst!==null){c=this.timeDefined;this._onTimeChange();this.timeDefined=c}c=function(){b._onSelectHandler()};
this.hour_slider.bind("slidestop",c);this.minute_slider.bind("slidestop",c);this.second_slider.bind("slidestop",c)}},_limitMinMaxDateTime:function(c,a){var b=this._defaults,d=new Date(c.selectedYear,c.selectedMonth,c.selectedDay);if(this._defaults.showTimepicker){if(e.datepicker._get(c,"minDateTime")!==null&&d){var f=e.datepicker._get(c,"minDateTime"),i=new Date(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0,0);if(this.hourMinOriginal===null||this.minuteMinOriginal===null||this.secondMinOriginal===
null){this.hourMinOriginal=b.hourMin;this.minuteMinOriginal=b.minuteMin;this.secondMinOriginal=b.secondMin}if(c.settings.timeOnly||i.getTime()==d.getTime()){this._defaults.hourMin=f.getHours();if(this.hour<=this._defaults.hourMin){this.hour=this._defaults.hourMin;this._defaults.minuteMin=f.getMinutes();if(this.minute<=this._defaults.minuteMin){this.minute=this._defaults.minuteMin;this._defaults.secondMin=f.getSeconds()}else{if(this.second<this._defaults.secondMin)this.second=this._defaults.secondMin;
this._defaults.secondMin=this.secondMinOriginal}}else{this._defaults.minuteMin=this.minuteMinOriginal;this._defaults.secondMin=this.secondMinOriginal}}else{this._defaults.hourMin=this.hourMinOriginal;this._defaults.minuteMin=this.minuteMinOriginal;this._defaults.secondMin=this.secondMinOriginal}}if(e.datepicker._get(c,"maxDateTime")!==null&&d){f=e.datepicker._get(c,"maxDateTime");i=new Date(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0,0);if(this.hourMaxOriginal===null||this.minuteMaxOriginal===
null||this.secondMaxOriginal===null){this.hourMaxOriginal=b.hourMax;this.minuteMaxOriginal=b.minuteMax;this.secondMaxOriginal=b.secondMax}if(c.settings.timeOnly||i.getTime()==d.getTime()){this._defaults.hourMax=f.getHours();if(this.hour>=this._defaults.hourMax){this.hour=this._defaults.hourMax;this._defaults.minuteMax=f.getMinutes();if(this.minute>=this._defaults.minuteMax){this.minute=this._defaults.minuteMax;this._defaults.secondMax=f.getSeconds()}else{if(this.second>this._defaults.secondMax)this.second=
this._defaults.secondMax;this._defaults.secondMax=this.secondMaxOriginal}}else{this._defaults.minuteMax=this.minuteMaxOriginal;this._defaults.secondMax=this.secondMaxOriginal}}else{this._defaults.hourMax=this.hourMaxOriginal;this._defaults.minuteMax=this.minuteMaxOriginal;this._defaults.secondMax=this.secondMaxOriginal}}if(a!==undefined&&a===true){b=(this._defaults.hourMax-this._defaults.hourMax%this._defaults.stepHour).toFixed(0);d=(this._defaults.minuteMax-this._defaults.minuteMax%this._defaults.stepMinute).toFixed(0);
f=(this._defaults.secondMax-this._defaults.secondMax%this._defaults.stepSecond).toFixed(0);this.hour_slider&&this.hour_slider.slider("option",{min:this._defaults.hourMin,max:b}).slider("value",this.hour);this.minute_slider&&this.minute_slider.slider("option",{min:this._defaults.minuteMin,max:d}).slider("value",this.minute);this.second_slider&&this.second_slider.slider("option",{min:this._defaults.secondMin,max:f}).slider("value",this.second)}}},_onTimeChange:function(){var c=this.hour_slider?this.hour_slider.slider("value"):
false,a=this.minute_slider?this.minute_slider.slider("value"):false,b=this.second_slider?this.second_slider.slider("value"):false,d=this.timezone_select?this.timezone_select.val():false;if(typeof c=="object")c=false;if(typeof a=="object")a=false;if(typeof b=="object")b=false;if(typeof d=="object")d=false;if(c!==false)c=parseInt(c,10);if(a!==false)a=parseInt(a,10);if(b!==false)b=parseInt(b,10);var f=c<12?"AM":"PM",i=c!=this.hour||a!=this.minute||b!=this.second||this.ampm.length>0&&this.ampm!=f||d!=
this.timezone;if(i){if(c!==false)this.hour=c;if(a!==false)this.minute=a;if(b!==false)this.second=b;if(d!==false)this.timezone=d;if(!this.inst)this.inst=e.datepicker._getInst(this.$input[0]);this._limitMinMaxDateTime(this.inst,true)}if(this._defaults.ampm)this.ampm=f;this._formatTime();this.$timeObj&&this.$timeObj.text(this.formattedTime+this._defaults.timeSuffix);this.timeDefined=true;i&&this._updateDateTime()},_onSelectHandler:function(){var c=this._defaults.onSelect,a=this.$input?this.$input[0]:
null;c&&a&&c.apply(a,[this.formattedDateTime,this])},_formatTime:function(c,a,b){if(b==undefined)b=this._defaults.ampm;c=c||{hour:this.hour,minute:this.minute,second:this.second,ampm:this.ampm,timezone:this.timezone};var d=a||this._defaults.timeFormat.toString();if(b){var f=c.ampm=="AM"?c.hour:c.hour%12;f=Number(f)===0?12:f;d=d.toString().replace(/hh/g,(f<10?"0":"")+f).replace(/h/g,f).replace(/mm/g,(c.minute<10?"0":"")+c.minute).replace(/m/g,c.minute).replace(/ss/g,(c.second<10?"0":"")+c.second).replace(/s/g,
c.second).replace(/TT/g,c.ampm.toUpperCase()).replace(/Tt/g,c.ampm.toUpperCase()).replace(/tT/g,c.ampm.toLowerCase()).replace(/tt/g,c.ampm.toLowerCase()).replace(/T/g,c.ampm.charAt(0).toUpperCase()).replace(/t/g,c.ampm.charAt(0).toLowerCase()).replace(/z/g,c.timezone)}else{d=d.toString().replace(/hh/g,(c.hour<10?"0":"")+c.hour).replace(/h/g,c.hour).replace(/mm/g,(c.minute<10?"0":"")+c.minute).replace(/m/g,c.minute).replace(/ss/g,(c.second<10?"0":"")+c.second).replace(/s/g,c.second).replace(/z/g,c.timezone);
d=e.trim(d.replace(/t/gi,""))}if(arguments.length)return d;else this.formattedTime=d},_updateDateTime:function(c){c=this.inst||c;dt=new Date(c.selectedYear,c.selectedMonth,c.selectedDay);dateFmt=e.datepicker._get(c,"dateFormat");formatCfg=e.datepicker._getFormatConfig(c);timeAvailable=dt!==null&&this.timeDefined;var a=this.formattedDate=e.datepicker.formatDate(dateFmt,dt===null?new Date:dt,formatCfg);if(!(c.lastVal!==undefined&&c.lastVal.length>0&&this.$input.val().length===0)){if(this._defaults.timeOnly===
true)a=this.formattedTime;else if(this._defaults.timeOnly!==true&&(this._defaults.alwaysSetTime||timeAvailable))a+=this._defaults.separator+this.formattedTime+this._defaults.timeSuffix;this.formattedDateTime=a;if(this._defaults.showTimepicker)if(this.$altInput&&this._defaults.altFieldTimeOnly===true){this.$altInput.val(this.formattedTime);this.$input.val(this.formattedDate)}else{this.$altInput&&this.$altInput.val(a);this.$input.val(a)}else this.$input.val(this.formattedDate);this.$input.trigger("change")}}});
e.fn.extend({timepicker:function(c){c=c||{};var a=arguments;if(typeof c=="object")a[0]=e.extend(c,{timeOnly:true});return e(this).each(function(){e.fn.datetimepicker.apply(e(this),a)})},datetimepicker:function(c){c=c||{};var a=arguments;return typeof c=="string"?c=="getDate"?e.fn.datepicker.apply(e(this[0]),a):this.each(function(){var b=e(this);b.datepicker.apply(b,a)}):this.each(function(){var b=e(this);b.datepicker(e.timepicker._newInst(b,c)._defaults)})}});e.datepicker._base_selectDate=e.datepicker._selectDate;
e.datepicker._selectDate=function(c,a){var b=this._getInst(e(c)[0]),d=this._get(b,"timepicker");if(d){d._limitMinMaxDateTime(b,true);b.inline=b.stay_open=true;this._base_selectDate(c,a+d._defaults.separator+d.formattedTime+d._defaults.timeSuffix);b.inline=b.stay_open=false;this._notifyChange(b);this._updateDatepicker(b)}else this._base_selectDate(c,a)};e.datepicker._base_updateDatepicker=e.datepicker._updateDatepicker;e.datepicker._updateDatepicker=function(c){var a=c.input[0];if(!(e.datepicker._curInst&&
e.datepicker._curInst!=c&&e.datepicker._datepickerShowing&&e.datepicker._lastInput!=a))if(typeof c.stay_open!=="boolean"||c.stay_open===false){this._base_updateDatepicker(c);(a=this._get(c,"timepicker"))&&a._addTimePicker(c)}};e.datepicker._base_doKeyPress=e.datepicker._doKeyPress;e.datepicker._doKeyPress=function(c){var a=e.datepicker._getInst(c.target),b=e.datepicker._get(a,"timepicker");if(b)if(e.datepicker._get(a,"constrainInput")){var d=b._defaults.ampm;a=e.datepicker._possibleChars(e.datepicker._get(a,
"dateFormat"));b=b._defaults.timeFormat.toString().replace(/[hms]/g,"").replace(/TT/g,d?"APM":"").replace(/Tt/g,d?"AaPpMm":"").replace(/tT/g,d?"AaPpMm":"").replace(/T/g,d?"AP":"").replace(/tt/g,d?"apm":"").replace(/t/g,d?"ap":"")+" "+b._defaults.separator+b._defaults.timeSuffix+(b._defaults.showTimezone?b._defaults.timezoneList.join(""):"")+a;d=String.fromCharCode(c.charCode===undefined?c.keyCode:c.charCode);return c.ctrlKey||d<" "||!a||b.indexOf(d)>-1}return e.datepicker._base_doKeyPress(c)};e.datepicker._base_doKeyUp=
e.datepicker._doKeyUp;e.datepicker._doKeyUp=function(c){var a=e.datepicker._getInst(c.target),b=e.datepicker._get(a,"timepicker");if(b)if(b._defaults.timeOnly&&a.input.val()!=a.lastVal)try{e.datepicker._updateDatepicker(a)}catch(d){e.datepicker.log(d)}return e.datepicker._base_doKeyUp(c)};e.datepicker._base_gotoToday=e.datepicker._gotoToday;e.datepicker._gotoToday=function(c){this._base_gotoToday(c);this._setTime(this._getInst(e(c)[0]),new Date)};e.datepicker._disableTimepickerDatepicker=function(c){var a=
this._getInst(c),b=this._get(a,"timepicker");e(c).datepicker("getDate");if(b){b._defaults.showTimepicker=false;b._updateDateTime(a)}};e.datepicker._enableTimepickerDatepicker=function(c){var a=this._getInst(c),b=this._get(a,"timepicker");e(c).datepicker("getDate");if(b){b._defaults.showTimepicker=true;b._addTimePicker(a);b._updateDateTime(a)}};e.datepicker._setTime=function(c,a){var b=this._get(c,"timepicker");if(b){var d=b._defaults,f=a?a.getHours():d.hour,i=a?a.getMinutes():d.minute,g=a?a.getSeconds():
d.second;if(f<d.hourMin||f>d.hourMax||i<d.minuteMin||i>d.minuteMax||g<d.secondMin||g>d.secondMax){f=d.hourMin;i=d.minuteMin;g=d.secondMin}b.hour=f;b.minute=i;b.second=g;b.hour_slider&&b.hour_slider.slider("value",f);b.minute_slider&&b.minute_slider.slider("value",i);b.second_slider&&b.second_slider.slider("value",g);b._onTimeChange();b._updateDateTime(c)}};e.datepicker._setTimeDatepicker=function(c,a,b){c=this._getInst(c);var d=this._get(c,"timepicker");if(d){this._setDateFromField(c);if(a){if(typeof a==
"string"){d._parseTime(a,b);a=new Date;a.setHours(d.hour,d.minute,d.second)}else a=new Date(a.getTime());if(a.toString()=="Invalid Date")a=undefined;this._setTime(c,a)}}};e.datepicker._base_setDateDatepicker=e.datepicker._setDateDatepicker;e.datepicker._setDateDatepicker=function(c,a){var b=this._getInst(c),d=a instanceof Date?new Date(a.getTime()):a;this._updateDatepicker(b);this._base_setDateDatepicker.apply(this,arguments);this._setTimeDatepicker(c,d,true)};e.datepicker._base_getDateDatepicker=
e.datepicker._getDateDatepicker;e.datepicker._getDateDatepicker=function(c,a){var b=this._getInst(c),d=this._get(b,"timepicker");if(d){this._setDateFromField(b,a);(b=this._getDate(b))&&d._parseTime(e(c).val(),d.timeOnly)&&b.setHours(d.hour,d.minute,d.second);return b}return this._base_getDateDatepicker(c,a)};e.datepicker._base_parseDate=e.datepicker.parseDate;e.datepicker.parseDate=function(c,a,b){var d;try{d=this._base_parseDate(c,a,b)}catch(f){d=this._base_parseDate(c,a.substring(0,a.length-(f.length-
f.indexOf(":")-2)),b)}return d};e.datepicker._base_optionDatepicker=e.datepicker._optionDatepicker;e.datepicker._optionDatepicker=function(c,a,b){this._base_optionDatepicker(c,a,b);c=this._getInst(c);var d=this._get(c,"timepicker");if(d){if(a==="minDate"){if(d._defaults.minDate!==undefined&&d._defaults.minDate instanceof Date)d._defaults.minDateTime=new Date(b);if(d._defaults.minDateTime!==undefined&&d._defaults.minDateTime instanceof Date)d._defaults.minDate=new Date(d._defaults.minDateTime.getTime());
d._limitMinMaxDateTime(c,true)}if(a==="maxDate"){if(d._defaults.maxDate!==undefined&&d._defaults.maxDate instanceof Date)d._defaults.maxDateTime=new Date(b);if(d._defaults.maxDateTime!==undefined&&d._defaults.maxDateTime instanceof Date)d._defaults.maxDate=new Date(d._defaults.maxDateTime.getTime());d._limitMinMaxDateTime(c,true)}}};e.timepicker=new q;e.timepicker.version="0.9.6"})(jQuery);
