(function(a){varb=a.telerik;b.timeView=function(c){a.extend(this,c);vard=this.dropDown=newb.dropDown({attr:this.dropDownAttr,effects:this.effects,onClick:function(f){varg=f.item;c.onChange(g.innerText||g.textContent)}});d.$element.addClass("t-time-popup").css("direction",this.isRtl?"rtl":"")};b.timeView.prototype={_ensureItems:function(){if(!this.dropDown.$items){this.bind()}},open:function(c){this._ensureItems();this.dropDown.open(c)},close:function(){this.dropDown.close()},bind:function(){varj=b.timeView.getTimeMilliseconds;varg=[];varc=this.format;varn=this.interval;varp=newb.datetime(this.minValue);vard=j(p);varf=j(this.maxValue);varl=n*b.datetime.msPerMinute;vark=parseInt(b.datetime.msPerDay/(n*b.datetime.msPerMinute));if(d!=f){varo=d<f?f-d:f+b.datetime.msPerDay-d;k=parseInt(o/l)+1}varm=b.datetime.add;vare=b.datetime.format;for(varh=0;h<k;h++){g[h]=e(p.toDate(),c);p=m(p,l)}if(j(p)-l-f!=0&&d!=f){g[k]=e(this.maxValue,c)}this.dropDown.dataBind(g)},isOpened:function(){returnthis.dropDown.isOpened()},value:function(c){this._ensureItems();vare=this.dropDown;if(c===undefined){returne.$items.filter(".t-state-selected").text()}vard=e.$items;if(!d){return}d.removeClass("t-state-selected");if(c){e.highlight(a.grep(d,function(f){return(f.innerText||f.textContent)==c}))}},navigate:function(i){varg=i.keyCode||i.which;if(g==38||g==40){i.preventDefault()}this._ensureItems();vard=this.dropDown;varf=d.$items;varh=f.filter(".t-state-selected");varc=h.length==0||f.length==1?f.first():(g==38)?h.prev():(g==40)?h.next():[];if(c.length){varj=c.text();d.scrollTo(c[0]);d.highlight(c[0]);if(!d.isOpened()){this.onChange(j)}else{this.onNavigateWithOpenPopup(j)}}}};a.each(["min","max"],a.proxy(function(d,c){b.timeView.prototype[c]=function(f){vare=c+"Value";if(f===undefined){returnthis[e]}this[e]=newDate(f.value?f.value:f);this.bind()}},this));a.extend(b.timeView,{isInRange:function(c,j,g){if(c===null){returntrue}varf=b.timeView.getTimeMilliseconds;vard=b.datetime.msPerDay;vari=f(c);vare=f(j);varh=f(g);i=e>i?i+d:i;h=e>h?h+d:h;returne-h==0||i>=e&&i<=h},getTimeMilliseconds:function(c){c=c.value?c:newb.datetime(c);return((c.hours()*60)+c.minutes())*b.datetime.msPerMinute+c.seconds()*1000+c.milliseconds()}});b.timepicker=function(d,e){a.extend(this,e);if(d.nodeName.toLowerCase()!=="input"&&d.type.toLowerCase()!=="text"){throw"Target element is not a INPUT"}this.element=d;varf=this.$element=a(d).addClass("t-input").attr("autocomplete","off").bind({keydown:a.proxy(this._keydown,this),focus:a.proxy(function(j){if(this.openOnFocus){this._open()}this.$element.removeClass("t-state-error")},this)});if(!f.parent().hasClass("t-picker-wrap")){f.wrap('<div class="t-widget t-timepicker"><div class="t-picker-wrap"></div></div>');if(e.showButton){vari=newb.stringBuilder(),g=e.buttonTitle;a(i.cat('<span class="t-select">').cat('<span class="t-icon t-icon-clock" ').catIf('title="',g).catIf(g,g).cat('"></span></span>').string()).insertAfter(f)}}this.timeView=newb.timeView({effects:this.effects,dropDownAttr:this.dropDownAttr,format:this.format,interval:this.interval,isRtl:f.closest(".t-rtl").length,minValue:this.minValue,maxValue:this.maxValue,onNavigateWithOpenPopup:a.proxy(function(j){this.$element.val(j)},this),onChange:a.proxy(function(j){if(j!=this.inputValue){this._update(j)}this._close()},this)});this.inputValue=f.val();varc=this.selectedValue||this.inputValue;if(c){this._value(this.parse(c))}varh=this.enabled?a.proxy(this._togglePopup,this):b.preventDefault;this.$wrapper=f.closest(".t-timepicker").find(".t-icon").bind("click",h).end();a(document.documentElement).bind("mousedown",a.proxy(function(m){varl=this.$element.val();if(l!=this.inputValue){this._update(l)}varj=this.timeView.dropDown.$element;vark=j&&j.parent().length>0;if(!k||a.contains(this.$wrapper[0],m.target)||a.contains(j.parent()[0],m.target)){return}this._close()},this));b.bind(this,{open:this.onOpen,close:this.onClose,valueChange:this.onChange,load:this.onLoad})};b.timepicker.prototype={_close:function(){varc=this.timeView.dropDown;if(!c.$element