-
Notifications
You must be signed in to change notification settings - Fork 0
/
anytime.compressed.js
8 lines (7 loc) · 51.5 KB
/
anytime.compressed.js
1
2
3
4
5
6
7
8
/* anytime.compressed.js 4.2013.07.25.a
Copyright 2008-2013 Andrew M. Andrews III
License: creativecommons.org/licenses/by-nc-sa/3.0/
Any+Time is a trademark of Andrew M. Andrews III */
var AnyTime={pad:function(e,t){var n=String(Math.abs(e));while(n.length<t)n="0"+n;if(e<0)n="-"+n;return n}};(function(e){var t=[31,28,31,30,31,30,31,31,30,31,30,31];var n=null;var r=false;var s=navigator.userAgent.indexOf("MSIE 6")>0;var o=navigator.userAgent.indexOf("MSIE 7")>0;var u=[];jQuery.prototype.AnyTime_picker=function(e){return this.each(function(t){AnyTime.picker(this.id,e)})};jQuery.prototype.AnyTime_noPicker=function(){return this.each(function(e){AnyTime.noPicker(this.id)})};jQuery.prototype.AnyTime_setEarliest=function(e){return this.each(function(t){AnyTime.setEarliest(this.id,e)})};jQuery.prototype.AnyTime_setLatest=function(e){return this.each(function(t){AnyTime.setLatest(this.id,e)})};jQuery.prototype.AnyTime_height=function(e){return s?Number(this.css("height").replace(/[^0-9]/g,"")):this.outerHeight(e)};jQuery.prototype.AnyTime_width=function(e){return s?1+Number(this.css("width").replace(/[^0-9]/g,"")):this.outerWidth(e)};jQuery.prototype.AnyTime_current=function(e,t){if(e){this.removeClass("AnyTime-out-btn ui-state-default ui-state-disabled ui-state-highlight");this.addClass("AnyTime-cur-btn ui-state-default ui-state-highlight")}else{this.removeClass("AnyTime-cur-btn ui-state-highlight");if(!t)this.addClass("AnyTime-out-btn ui-state-disabled");else this.removeClass("AnyTime-out-btn ui-state-disabled")}};jQuery.prototype.AnyTime_clickCurrent=function(){this.find(".AnyTime-cur-btn").triggerHandler("click")};e(document).ready(function(){if(s){n=e('<iframe frameborder="0" scrolling="no"></iframe>');n.src="javascript:'<html></html>';";e(n).css({display:"block",height:"1px",left:"0",top:"0",width:"1px",zIndex:0});e(document.body).append(n)}for(var t in u)if(!Array.prototype[t])u[t].onReady();r=true});AnyTime.Converter=function(t){var n=0;var r=9;var i=9;var s=6;var o=3;var u=Number.MIN_VALUE;var a=Number.MIN_VALUE;var f=Number.MIN_VALUE;var l=-1;var c=Number.MIN_VALUE;var h=-1;var p=false;this.fmt="%Y-%m-%d %T";this.dAbbr=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];this.dNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];this.eAbbr=["BCE","CE"];this.mAbbr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.mNames=["January","February","March","April","May","June","July","August","September","October","November","December"];this.baseYear=null;this.dAt=function(e,t){return e.charCodeAt(t)>="0".charCodeAt(0)&&e.charCodeAt(t)<="9".charCodeAt(0)};this.format=function(e){var t=new Date(e.getTime());if(u==Number.MIN_VALUE&&f!=Number.MIN_VALUE)t.setTime(t.getTime()+t.getTimezoneOffset()*6e4+f*6e4);var r;var i="";for(var s=0;s<n;s++){if(this.fmt.charAt(s)!="%")i+=this.fmt.charAt(s);else{var o=this.fmt.charAt(s+1);switch(o){case"a":i+=this.dAbbr[t.getDay()];break;case"B":if(t.getFullYear()<0)i+=this.eAbbr[0];break;case"b":i+=this.mAbbr[t.getMonth()];break;case"C":if(t.getFullYear()>0)i+=this.eAbbr[1];break;case"c":i+=t.getMonth()+1;break;case"d":r=t.getDate();if(r<10)i+="0";i+=String(r);break;case"D":r=String(t.getDate());i+=r;if(r.length==2&&r.charAt(0)=="1")i+="th";else{switch(r.charAt(r.length-1)){case"1":i+="st";break;case"2":i+="nd";break;case"3":i+="rd";break;default:i+="th";break}}break;case"E":i+=this.eAbbr[t.getFullYear()<0?0:1];break;case"e":i+=t.getDate();break;case"H":r=t.getHours();if(r<10)i+="0";i+=String(r);break;case"h":case"I":r=t.getHours()%12;if(r==0)i+="12";else{if(r<10)i+="0";i+=String(r)}break;case"i":r=t.getMinutes();if(r<10)i+="0";i+=String(r);break;case"k":i+=t.getHours();break;case"l":r=t.getHours()%12;if(r==0)i+="12";else i+=String(r);break;case"M":i+=this.mNames[t.getMonth()];break;case"m":r=t.getMonth()+1;if(r<10)i+="0";i+=String(r);break;case"p":i+=t.getHours()<12?"AM":"PM";break;case"r":r=t.getHours()%12;if(r==0)i+="12:";else{if(r<10)i+="0";i+=String(r)+":"}r=t.getMinutes();if(r<10)i+="0";i+=String(r)+":";r=t.getSeconds();if(r<10)i+="0";i+=String(r);i+=t.getHours()<12?"AM":"PM";break;case"S":case"s":r=t.getSeconds();if(r<10)i+="0";i+=String(r);break;case"T":r=t.getHours();if(r<10)i+="0";i+=String(r)+":";r=t.getMinutes();if(r<10)i+="0";i+=String(r)+":";r=t.getSeconds();if(r<10)i+="0";i+=String(r);break;case"W":i+=this.dNames[t.getDay()];break;case"w":i+=t.getDay();break;case"Y":i+=AnyTime.pad(t.getFullYear(),4);break;case"y":r=t.getFullYear()%100;i+=AnyTime.pad(r,2);break;case"Z":i+=AnyTime.pad(Math.abs(t.getFullYear()),4);break;case"z":i+=Math.abs(t.getFullYear());break;case"%":i+="%";break;case"#":r=u!=Number.MIN_VALUE?u:f==Number.MIN_VALUE?0-t.getTimezoneOffset():f;if(r>=0)i+="+";i+=r;break;case"@":r=u!=Number.MIN_VALUE?u:f==Number.MIN_VALUE?0-t.getTimezoneOffset():f;if(AnyTime.utcLabel&&AnyTime.utcLabel[r]){if(l>0&&l<AnyTime.utcLabel[r].length)i+=AnyTime.utcLabel[r][l];else i+=AnyTime.utcLabel[r][0];break}i+="UTC";o=":";case"+":case"-":case":":case";":r=u!=Number.MIN_VALUE?u:f==Number.MIN_VALUE?0-t.getTimezoneOffset():f;if(r<0)i+="-";else i+="+";r=Math.abs(r);i+=o=="+"||o==":"?AnyTime.pad(Math.floor(r/60),2):Math.floor(r/60);if(o==":"||o==";")i+=":";i+=AnyTime.pad(r%60,2);break;case"f":case"j":case"U":case"u":case"V":case"v":case"X":case"x":throw"%"+o+" not implemented by AnyTime.Converter";default:i+=this.fmt.substr(s,2)}s++}}return i};this.getUtcParseOffsetCaptured=function(){return a};this.getUtcParseOffsetSubIndex=function(){return h};this.parse=function(e){a=c;h=-1;var t=1;var u=new Date(4,0,1,0,0,0,0);var f=e.length;var l=0;var d=1,v=c;var m,g,y,b,w;for(var E=0;E<n;E++){if(this.fmt.charAt(E)=="%"){var S=this.fmt.charAt(E+1);switch(S){case"a":g=false;for(b=0;l+b<f;b++){y=e.substr(l,b);for(m=0;m<12;m++)if(this.dAbbr[m]==y){g=true;l+=b;break}if(g)break}if(!g)throw"unknown weekday: "+e.substr(l);break;case"B":b=this.eAbbr[0].length;if(l+b<=f&&e.substr(l,b)==this.eAbbr[0]){t=-1;l+=b}break;case"b":g=false;for(b=0;l+b<f;b++){y=e.substr(l,b);for(m=0;m<12;m++)if(this.mAbbr[m]==y){u.setMonth(m);g=true;l+=b;break}if(g)break}if(!g)throw"unknown month: "+e.substr(l);break;case"C":b=this.eAbbr[1].length;if(l+b<=f&&e.substr(l,b)==this.eAbbr[1])l+=b;break;case"c":if(l+1<f&&this.dAt(e,l+1)){u.setMonth((Number(e.substr(l,2))-1)%12);l+=2}else{u.setMonth((Number(e.substr(l,1))-1)%12);l++}break;case"D":if(l+1<f&&this.dAt(e,l+1)){u.setDate(Number(e.substr(l,2)));l+=4}else{u.setDate(Number(e.substr(l,1)));l+=3}break;case"d":u.setDate(Number(e.substr(l,2)));l+=2;break;case"E":b=this.eAbbr[0].length;if(l+b<=f&&e.substr(l,b)==this.eAbbr[0]){t=-1;l+=b}else if(l+(b=this.eAbbr[1].length)<=f&&e.substr(l,b)==this.eAbbr[1])l+=b;else throw"unknown era: "+e.substr(l);break;case"e":if(l+1<f&&this.dAt(e,l+1)){u.setDate(Number(e.substr(l,2)));l+=2}else{u.setDate(Number(e.substr(l,1)));l++}break;case"f":l+=6;break;case"H":u.setHours(Number(e.substr(l,2)));l+=2;break;case"h":case"I":u.setHours(Number(e.substr(l,2)));l+=2;break;case"i":u.setMinutes(Number(e.substr(l,2)));l+=2;break;case"k":if(l+1<f&&this.dAt(e,l+1)){u.setHours(Number(e.substr(l,2)));l+=2}else{u.setHours(Number(e.substr(l,1)));l++}break;case"l":if(l+1<f&&this.dAt(e,l+1)){u.setHours(Number(e.substr(l,2)));l+=2}else{u.setHours(Number(e.substr(l,1)));l++}break;case"M":g=false;for(b=o;l+b<=f;b++){if(b>i)break;y=e.substr(l,b);for(m=0;m<12;m++){if(this.mNames[m]==y){u.setMonth(m);g=true;l+=b;break}}if(g)break}break;case"m":u.setMonth((Number(e.substr(l,2))-1)%12);l+=2;break;case"p":if(u.getHours()==12){if(e.charAt(l)=="A")u.setHours(0)}else if(e.charAt(l)=="P")u.setHours(u.getHours()+12);l+=2;break;case"r":u.setHours(Number(e.substr(l,2)));u.setMinutes(Number(e.substr(l+3,2)));u.setSeconds(Number(e.substr(l+6,2)));if(u.getHours()==12){if(e.charAt(l+8)=="A")u.setHours(0)}else if(e.charAt(l+8)=="P")u.setHours(u.getHours()+12);l+=10;break;case"S":case"s":u.setSeconds(Number(e.substr(l,2)));l+=2;break;case"T":u.setHours(Number(e.substr(l,2)));u.setMinutes(Number(e.substr(l+3,2)));u.setSeconds(Number(e.substr(l+6,2)));l+=8;break;case"W":g=false;for(b=s;l+b<=f;b++){if(b>r)break;y=e.substr(l,b);for(m=0;m<7;m++){if(this.dNames[m]==y){g=true;l+=b;break}}if(g)break}break;case"w":l+=1;break;case"Y":m=4;if(e.substr(l,1)=="-")m++;u.setFullYear(Number(e.substr(l,m)));l+=m;break;case"y":m=2;if(e.substr(l,1)=="-")m++;w=Number(e.substr(l,m));if(typeof this.baseYear=="number")w+=this.baseYear;else if(w<70)w+=2e3;else w+=1900;u.setFullYear(w);l+=m;break;case"Z":u.setFullYear(Number(e.substr(l,4)));l+=4;break;case"z":m=0;while(l<f&&this.dAt(e,l))m=m*10+Number(e.charAt(l++));u.setFullYear(m);break;case"#":if(e.charAt(l++)=="-")d=-1;for(v=0;l<f&&String(m=Number(e.charAt(l)))==e.charAt(l);l++)v=v*10+m;v*=d;break;case"@":h=-1;if(AnyTime.utcLabel){g=false;for(v in AnyTime.utcLabel)if(!Array.prototype[v]){for(m=0;m<AnyTime.utcLabel[v].length;m++){y=AnyTime.utcLabel[v][m];b=y.length;if(l+b<=f&&e.substr(l,b)==y){l+=b;g=true;break}}if(g)break}if(g){h=m;v=Number(v);break}}if(l+9<f||e.substr(l,3)!="UTC")throw"unknown time zone: "+e.substr(l);l+=3;S=":";case"-":case"+":case":":case";":if(e.charAt(l++)=="-")d=-1;v=Number(e.charAt(l));if(S=="+"||S==":"||l+3<f&&String(Number(e.charAt(l+3)))!==e.charAt(l+3))v=v*10+Number(e.charAt(++l));v*=60;if(S==":"||S==";")l++;v=(v+Number(e.substr(++l,2)))*d;l+=2;break;case"j":case"U":case"u":case"V":case"v":case"X":case"x":throw"%"+this.fmt.charAt(E+1)+" not implemented by AnyTime.Converter";case"%":default:throw"%"+this.fmt.charAt(E+1)+" reserved for future use";break}E++}else if(this.fmt.charAt(E)!=e.charAt(l))throw e+' is not in "'+this.fmt+'" format';else l++}if(t<0)u.setFullYear(0-u.getFullYear());if(v!=Number.MIN_VALUE){if(p)a=v;else u.setTime(u.getTime()-v*6e4-u.getTimezoneOffset()*6e4)}return u};this.setUtcFormatOffsetAlleged=function(e){var t=u;u=e;return t};this.setUtcFormatOffsetSubIndex=function(e){var t=l;l=e;return t};(function(u){var a,l;t=jQuery.extend(true,{},t||{});if(t.baseYear)u.baseYear=Number(t.baseYear);if(t.format)u.fmt=t.format;n=u.fmt.length;if(t.dayAbbreviations)u.dAbbr=e.makeArray(t.dayAbbreviations);if(t.dayNames){u.dNames=e.makeArray(t.dayNames);r=1;s=1e3;for(a=0;a<7;a++){l=u.dNames[a].length;if(l>r)r=l;if(l<s)s=l}}if(t.eraAbbreviations)u.eAbbr=e.makeArray(t.eraAbbreviations);if(t.monthAbbreviations)u.mAbbr=e.makeArray(t.monthAbbreviations);if(t.monthNames){u.mNames=e.makeArray(t.monthNames);i=1;o=1e3;for(a=0;a<12;a++){l=u.mNames[a].length;if(l>i)i=l;if(l<o)o=l}}if(typeof t.utcFormatOffsetImposed!="undefined")f=t.utcFormatOffsetImposed;if(typeof t.utcParseOffsetAssumed!="undefined")c=t.utcParseOffsetAssumed;if(t.utcParseOffsetCapture)p=true})(this)};AnyTime.noPicker=function(e){if(u[e]){u[e].cleanup();delete u[e]}};AnyTime.picker=function(a,f){if(u[a])throw'Cannot create another AnyTime.picker for "'+a+'"';var l=null;u[a]={twelveHr:false,ajaxOpts:null,denyTab:true,askEra:false,cloak:null,conv:null,bMinW:0,bMinH:0,dMinW:0,dMinH:0,div:null,dB:null,dD:null,dY:null,dMo:null,dDoM:null,hDoM:null,hMo:null,hTitle:null,hY:null,dT:null,dH:null,dM:null,dS:null,dO:null,earliest:null,fBtn:null,fDOW:0,hBlur:null,hClick:null,hFocus:null,hKeydown:null,hKeypress:null,id:null,inp:null,latest:null,lastAjax:null,lostFocus:false,lX:"X",lY:"Year",lO:"Time Zone",oBody:null,oConv:null,oCur:null,oDiv:null,oLab:null,oListMinW:0,oMinW:0,oSel:null,offMin:Number.MIN_VALUE,offSI:-1,offStr:"",pop:true,time:null,tMinW:0,tMinH:0,url:null,wMinW:0,wMinH:0,yAhead:null,y0XXX:null,yCur:null,yDiv:null,yLab:null,yNext:null,yPast:null,yPrior:null,initialize:function(i){l=this;this.id="AnyTime--"+i.replace(/[^-_.A-Za-z0-9]/g,"--AnyTime--");f=jQuery.extend(true,{},f||{});f.utcParseOffsetCapture=true;this.conv=new AnyTime.Converter(f);if(f.placement){if(f.placement=="inline")this.pop=false;else if(f.placement!="popup")throw"unknown placement: "+f.placement}if(f.ajaxOptions){this.ajaxOpts=jQuery.extend({},f.ajaxOptions);if(!this.ajaxOpts.success)this.ajaxOpts.success=function(e,t){l.inp.val(e)}}if(f.earliest){if(typeof f.earliest.getTime=="function")this.earliest=f.earliest.getTime();else this.earliest=this.conv.parse(f.earliest.toString())}if(f.firstDOW){if(f.firstDOW<0||f.firstDOW>6)throw new Exception("illegal firstDOW: "+f.firstDOW);this.fDOW=f.firstDOW}if(f.latest){if(typeof f.latest.getTime=="function")this.latest=f.latest.getTime();else this.latest=this.conv.parse(f.latest.toString())}this.lX=f.labelDismiss||"X";this.lY=f.labelYear||"Year";this.lO=f.labelTimeZone||"Time Zone";var s;var o;var u;var a=0;var c=this.conv.fmt;if(typeof f.askEra!="undefined")this.askEra=f.askEra;else this.askEra=c.indexOf("%B")>=0||c.indexOf("%C")>=0||c.indexOf("%E")>=0;var h=c.indexOf("%Y")>=0||c.indexOf("%y")>=0||c.indexOf("%Z")>=0||c.indexOf("%z")>=0;var p=c.indexOf("%b")>=0||c.indexOf("%c")>=0||c.indexOf("%M")>=0||c.indexOf("%m")>=0;var d=c.indexOf("%D")>=0||c.indexOf("%d")>=0||c.indexOf("%e")>=0;var v=h||p||d;this.twelveHr=c.indexOf("%h")>=0||c.indexOf("%I")>=0||c.indexOf("%l")>=0||c.indexOf("%r")>=0;var m=this.twelveHr||c.indexOf("%H")>=0||c.indexOf("%k")>=0||c.indexOf("%T")>=0;var g=c.indexOf("%i")>=0||c.indexOf("%r")>=0||c.indexOf("%T")>=0;var y=c.indexOf("%r")>=0||c.indexOf("%S")>=0||c.indexOf("%s")>=0||c.indexOf("%T")>=0;if(y&&typeof f.askSecond!="undefined")y=f.askSecond;var b=c.indexOf("%#")>=0||c.indexOf("%+")>=0||c.indexOf("%-")>=0||c.indexOf("%:")>=0||c.indexOf("%;")>=0||c.indexOf("%<")>=0||c.indexOf("%>")>=0||c.indexOf("%@")>=0;var w=m||g||y||b;if(b)this.oConv=new AnyTime.Converter({format:f.formatUtcOffset||c.match(/\S*%[-+:;<>#@]\S*/g).join(" ")});this.inp=e(document.getElementById(i));this.div=e('<div class="AnyTime-win AnyTime-pkr ui-widget ui-widget-content ui-corner-all" style="width:0;height:0" id="'+this.id+'" aria-live="off"/>');this.inp.after(this.div);this.wMinW=this.div.outerWidth(!e.browser.safari);this.wMinH=this.div.AnyTime_height(true);this.hTitle=e('<h5 class="AnyTime-hdr ui-widget-header ui-corner-top"/>');this.div.append(this.hTitle);this.dB=e('<div class="AnyTime-body" style="width:0;height:0"/>');this.div.append(this.dB);this.bMinW=this.dB.outerWidth(true);this.bMinH=this.dB.AnyTime_height(true);if(f.hideInput)this.inp.css({border:0,height:"1px",margin:0,padding:0,width:"1px"});o=null;var E=null;if(this.pop){E=e('<div class="AnyTime-x-btn ui-state-default">'+this.lX+"</div>");this.hTitle.append(E);E.click(function(e){l.dismiss(e)})}u="";if(v){this.dD=e('<div class="AnyTime-date" style="width:0;height:0"/>');this.dB.append(this.dD);this.dMinW=this.dD.outerWidth(true);this.dMinH=this.dD.AnyTime_height(true);if(h){this.yLab=e('<h6 class="AnyTime-lbl AnyTime-lbl-yr">'+this.lY+"</h6>");this.dD.append(this.yLab);this.dY=e('<ul class="AnyTime-yrs ui-helper-reset" />');this.dD.append(this.dY);this.yPast=this.btn(this.dY,"<",this.newYear,["yrs-past"],"- "+this.lY);this.yPrior=this.btn(this.dY,"1",this.newYear,["yr-prior"],"-1 "+this.lY);this.yCur=this.btn(this.dY,"2",this.newYear,["yr-cur"],this.lY);this.yCur.removeClass("ui-state-default");this.yCur.addClass("AnyTime-cur-btn ui-state-default ui-state-highlight");this.yNext=this.btn(this.dY,"3",this.newYear,["yr-next"],"+1 "+this.lY);this.yAhead=this.btn(this.dY,">",this.newYear,["yrs-ahead"],"+ "+this.lY);a++}if(p){u=f.labelMonth||"Month";this.hMo=e('<h6 class="AnyTime-lbl AnyTime-lbl-month">'+u+"</h6>");this.dD.append(this.hMo);this.dMo=e('<ul class="AnyTime-mons" />');this.dD.append(this.dMo);for(s=0;s<12;s++){var S=this.btn(this.dMo,this.conv.mAbbr[s],function(n){var r=e(n.target);if(r.hasClass("AnyTime-out-btn"))return;var i=n.target.AnyTime_month;var s=new Date(this.time.getTime());if(s.getDate()>t[i])s.setDate(t[i]);s.setMonth(i);this.set(s);this.upd(r)},["mon","mon"+String(s+1)],u+" "+this.conv.mNames[s]);S[0].AnyTime_month=s}a++}if(d){u=f.labelDayOfMonth||"Day of Month";this.hDoM=e('<h6 class="AnyTime-lbl AnyTime-lbl-dom">'+u+"</h6>");this.dD.append(this.hDoM);this.dDoM=e('<table border="0" cellpadding="0" cellspacing="0" class="AnyTime-dom-table"/>');this.dD.append(this.dDoM);o=e('<thead class="AnyTime-dom-head"/>');this.dDoM.append(o);var x=e('<tr class="AnyTime-dow"/>');o.append(x);for(s=0;s<7;s++)x.append('<th class="AnyTime-dow AnyTime-dow'+String(s+1)+'">'+this.conv.dAbbr[(this.fDOW+s)%7]+"</th>");var T=e('<tbody class="AnyTime-dom-body" />');this.dDoM.append(T);for(var N=0;N<6;N++){x=e('<tr class="AnyTime-wk AnyTime-wk'+String(N+1)+'"/>');T.append(x);for(s=0;s<7;s++)this.btn(x,"x",function(t){var n=e(t.target);if(n.hasClass("AnyTime-out-btn"))return;var r=Number(n.html());if(r){var i=new Date(this.time.getTime());i.setDate(r);this.set(i);this.upd(n)}},["dom"],u)}a++}}if(w){var C,k;this.dT=e('<div class="AnyTime-time" style="width:0;height:0" />');this.dB.append(this.dT);this.tMinW=this.dT.outerWidth(true);this.tMinH=this.dT.AnyTime_height(true);if(m){this.dH=e('<div class="AnyTime-hrs"/>');this.dT.append(this.dH);u=f.labelHour||"Hour";this.dH.append(e('<h6 class="AnyTime-lbl AnyTime-lbl-hr">'+u+"</h6>"));var L=e('<ul class="AnyTime-hrs-am"/>');this.dH.append(L);var A=e('<ul class="AnyTime-hrs-pm"/>');this.dH.append(A);for(s=0;s<12;s++){if(this.twelveHr){if(s==0)o="12am";else o=String(s)+"am"}else o=AnyTime.pad(s,2);this.btn(L,o,this.newHour,["hr","hr"+String(s)],u+" "+o);if(this.twelveHr){if(s==0)o="12pm";else o=String(s)+"pm"}else o=s+12;this.btn(A,o,this.newHour,["hr","hr"+String(s+12)],u+" "+o)}a++}if(g){this.dM=e('<div class="AnyTime-mins"/>');this.dT.append(this.dM);u=f.labelMinute||"Minute";this.dM.append(e('<h6 class="AnyTime-lbl AnyTime-lbl-min">'+u+"</h6>"));C=e('<ul class="AnyTime-mins-tens"/>');this.dM.append(C);for(s=0;s<6;s++)this.btn(C,s,function(t){var n=e(t.target);if(n.hasClass("AnyTime-out-btn"))return;var r=new Date(this.time.getTime());r.setMinutes(Number(n.text())*10+this.time.getMinutes()%10);this.set(r);this.upd(n)},["min-ten","min"+s+"0"],u+" "+s+"0");for(;s<12;s++)this.btn(C," ",e.noop,["min-ten","min"+s+"0"],u+" "+s+"0").addClass("AnyTime-min-ten-btn-empty ui-state-default ui-state-disabled");k=e('<ul class="AnyTime-mins-ones"/>');this.dM.append(k);for(s=0;s<10;s++)this.btn(k,s,function(t){var n=e(t.target);if(n.hasClass("AnyTime-out-btn"))return;var r=new Date(this.time.getTime());r.setMinutes(Math.floor(this.time.getMinutes()/10)*10+Number(n.text()));this.set(r);this.upd(n)},["min-one","min"+s],u+" "+s);for(;s<12;s++)this.btn(k," ",e.noop,["min-one","min"+s+"0"],u+" "+s).addClass("AnyTime-min-one-btn-empty ui-state-default ui-state-disabled");a++}if(y){this.dS=e('<div class="AnyTime-secs"/>');this.dT.append(this.dS);u=f.labelSecond||"Second";this.dS.append(e('<h6 class="AnyTime-lbl AnyTime-lbl-sec">'+u+"</h6>"));C=e('<ul class="AnyTime-secs-tens"/>');this.dS.append(C);for(s=0;s<6;s++)this.btn(C,s,function(t){var n=e(t.target);if(n.hasClass("AnyTime-out-btn"))return;var r=new Date(this.time.getTime());r.setSeconds(Number(n.text())*10+this.time.getSeconds()%10);this.set(r);this.upd(n)},["sec-ten","sec"+s+"0"],u+" "+s+"0");for(;s<12;s++)this.btn(C," ",e.noop,["sec-ten","sec"+s+"0"],u+" "+s+"0").addClass("AnyTime-sec-ten-btn-empty ui-state-default ui-state-disabled");k=e('<ul class="AnyTime-secs-ones"/>');this.dS.append(k);for(s=0;s<10;s++)this.btn(k,s,function(t){var n=e(t.target);if(n.hasClass("AnyTime-out-btn"))return;var r=new Date(this.time.getTime());r.setSeconds(Math.floor(this.time.getSeconds()/10)*10+Number(n.text()));this.set(r);this.upd(n)},["sec-one","sec"+s],u+" "+s);for(;s<12;s++)this.btn(k," ",e.noop,["sec-one","sec"+s+"0"],u+" "+s).addClass("AnyTime-sec-one-btn-empty ui-state-default ui-state-disabled");a++}if(b){this.dO=e('<div class="AnyTime-offs" />');this.dT.append(this.dO);this.oMinW=this.dO.outerWidth(true);this.oLab=e('<h6 class="AnyTime-lbl AnyTime-lbl-off">'+this.lO+"</h6>");this.dO.append(this.oLab);var O=e('<ul class="AnyTime-off-list ui-helper-reset" />');this.dO.append(O);this.oCur=this.btn(O,"",this.newOffset,["off","off-cur"],u);this.oCur.removeClass("ui-state-default");this.oCur.addClass("AnyTime-cur-btn ui-state-default ui-state-highlight");this.oCur.css({overflow:"hidden"});this.oSel=this.btn(O,"±",this.newOffset,["off","off-select"],"+/- "+this.lO);this.oListMinW=this.oCur.outerWidth(true)+this.oSel.outerWidth(true);a++}}if(f.labelTitle)this.hTitle.append(f.labelTitle);else if(a>1)this.hTitle.append("Select a "+(v?w?"Date and Time":"Date":"Time"));else this.hTitle.append("Select");try{this.time=this.conv.parse(this.inp.val());this.offMin=this.conv.getUtcParseOffsetCaptured();this.offSI=this.conv.getUtcParseOffsetSubIndex()}catch(M){this.time=new Date}this.lastAjax=this.time;if(this.pop){this.div.hide();if(n)n.hide();this.div.css("position","absolute")}this.inp.blur(this.hBlur=function(e){l.inpBlur(e)});this.inp.click(this.hClick=function(e){l.showPkr(e)});this.inp.focus(this.hFocus=function(e){if(l.lostFocus)l.showPkr(e);l.lostFocus=false});this.inp.keydown(this.hKeydown=function(e){l.key(e)});this.inp.keypress(this.hKeypress=function(t){if(e.browser.opera&&l.denyTab)t.preventDefault()});this.div.click(function(e){l.lostFocus=false;l.inp.focus()});e(window).resize(function(e){l.pos(e)});if(r)this.onReady()},ajax:function(){if(this.ajaxOpts&&this.time.getTime()!=this.lastAjax.getTime()){try{var t=jQuery.extend({},this.ajaxOpts);if(typeof t.data=="object")t.data[this.inp[0].name||this.inp[0].id]=this.inp.val();else{var n=(this.inp[0].name||this.inp[0].id)+"="+encodeURI(this.inp.val());if(t.data)t.data+="&"+n;else t.data=n}e.ajax(t);this.lastAjax=this.time}catch(r){}}return},askOffset:function(t){if(!this.oDiv){this.makeCloak();this.oDiv=e('<div class="AnyTime-win AnyTime-off-selector ui-widget ui-widget-content ui-corner-all" style="position:absolute" />');this.div.append(this.oDiv);var n=e('<h5 class="AnyTime-hdr AnyTime-hdr-off-selector ui-widget-header ui-corner-top" />');this.oDiv.append(n);this.oBody=e('<div class="AnyTime-body AnyTime-body-off-selector" style="overflow:auto;white-space:nowrap" />');this.oDiv.append(this.oBody);var r=this.oBody.AnyTime_height(true);var i=this.oBody.AnyTime_width(true);var u=n.AnyTime_width(true);var a=e('<div class="AnyTime-x-btn ui-state-default">'+this.lX+"</div>");n.append(a);a.click(function(e){l.dismissODiv(e)});n.append(this.lO);if(s||o)n.width(String(this.lO.length*.8)+"em");var f=n.AnyTime_width(true)-i;var c=e('<ul class="AnyTime-off-off" />');var h=null;this.oBody.append(c);var p=this.oConv.fmt.indexOf("%@")>=0;var d=0;if(AnyTime.utcLabel)for(var v=-720;v<720;v++)if(AnyTime.utcLabel[v]){this.oConv.setUtcFormatOffsetAlleged(v);for(var m=0;m<AnyTime.utcLabel[v].length;m++){this.oConv.setUtcFormatOffsetSubIndex(m);h=this.btn(c,this.oConv.format(this.time),this.newOPos,["off-off"],v);h[0].AnyTime_offMin=v;h[0].AnyTime_offSI=m;var g=h.width();if(g>d)d=g;if(!p)break}}if(h)h.addClass("AnyTime-off-off-last-btn");this.oBody.find(".AnyTime-off-off-btn").width(d);if(h){var y=h.AnyTime_width(true);if(y>f)f=y+1}this.oBody.width(f);f=this.oBody.AnyTime_width(true);this.oDiv.width(f);if(s||o)n.width(f-u);var b=this.oDiv.AnyTime_height(true);var w=this.div.height()*.75;if(b>w){b=w;this.oBody.height(b-(n.AnyTime_height(true)+r));this.oBody.width(this.oBody.width()+20);this.oDiv.width(this.oDiv.width()+20);if(s||o)n.width(this.oBody.AnyTime_width(true)-u)}if(!o)this.oDiv.height(String(b)+"px")}else{this.cloak.show();this.oDiv.show()}this.pos(t);this.updODiv(null);var E=this.oDiv.find(".AnyTime-off-off-btn.AnyTime-cur-btn:first");if(!E.length)E=this.oDiv.find(".AnyTime-off-off-btn:first");this.setFocus(E)},askYear:function(t){if(!this.yDiv){this.makeCloak();this.yDiv=e('<div class="AnyTime-win AnyTime-yr-selector ui-widget ui-widget-content ui-corner-all" style="position:absolute" />');this.div.append(this.yDiv);var n=e('<h5 class="AnyTime-hdr AnyTime-hdr-yr-selector ui-widget-header ui-corner-top" />');this.yDiv.append(n);var r=e('<div class="AnyTime-x-btn ui-state-default">'+this.lX+"</div>");n.append(r);r.click(function(e){l.dismissYDiv(e)});n.append(this.lY);var u=e('<div class="AnyTime-body AnyTime-body-yr-selector" />');var a=u.AnyTime_width(true);var f=0;this.yDiv.append(u);cont=e('<ul class="AnyTime-yr-mil" />');u.append(cont);this.y0XXX=this.btn(cont,0,this.newYPos,["mil","mil0"],this.lY+" "+0+"000");for(i=1;i<10;i++)this.btn(cont,i,this.newYPos,["mil","mil"+i],this.lY+" "+i+"000");a+=cont.AnyTime_width(true);if(f<cont.AnyTime_height(true))f=cont.AnyTime_height(true);cont=e('<ul class="AnyTime-yr-cent" />');u.append(cont);for(i=0;i<10;i++)this.btn(cont,i,this.newYPos,["cent","cent"+i],this.lY+" "+i+"00");a+=cont.AnyTime_width(true);if(f<cont.AnyTime_height(true))f=cont.AnyTime_height(true);cont=e('<ul class="AnyTime-yr-dec" />');u.append(cont);for(i=0;i<10;i++)this.btn(cont,i,this.newYPos,["dec","dec"+i],this.lY+" "+i+"0");a+=cont.AnyTime_width(true);if(f<cont.AnyTime_height(true))f=cont.AnyTime_height(true);cont=e('<ul class="AnyTime-yr-yr" />');u.append(cont);for(i=0;i<10;i++)this.btn(cont,i,this.newYPos,["yr","yr"+i],this.lY+" "+i);a+=cont.AnyTime_width(true);if(f<cont.AnyTime_height(true))f=cont.AnyTime_height(true);if(this.askEra){cont=e('<ul class="AnyTime-yr-era" />');u.append(cont);this.btn(cont,this.conv.eAbbr[0],function(t){var n=new Date(this.time.getTime());var r=n.getFullYear();if(r>0)n.setFullYear(0-r);this.set(n);this.updYDiv(e(t.target))},["era","bce"],this.conv.eAbbr[0]);this.btn(cont,this.conv.eAbbr[1],function(t){var n=new Date(this.time.getTime());var r=n.getFullYear();if(r<0)n.setFullYear(0-r);this.set(n);this.updYDiv(e(t.target))},["era","ce"],this.conv.eAbbr[1]);a+=cont.AnyTime_width(true);if(f<cont.AnyTime_height(true))f=cont.AnyTime_height(true)}if(e.browser.msie)a+=1;else if(e.browser.safari)a+=2;f+=u.AnyTime_height(true);u.css("width",String(a)+"px");if(!o)u.css("height",String(f)+"px");if(s||o)n.width(u.outerWidth(true));f+=n.AnyTime_height(true);if(n.AnyTime_width(true)>a)a=n.AnyTime_width(true);this.yDiv.css("width",String(a)+"px");if(!o)this.yDiv.css("height",String(f)+"px")}else{this.cloak.show();this.yDiv.show()}this.pos(t);this.updYDiv(null);this.setFocus(this.yDiv.find(".AnyTime-yr-btn.AnyTime-cur-btn:first"))},inpBlur:function(e){if(this.oDiv&&this.oDiv.is(":visible")){l.inp.focus();return}this.lostFocus=true;setTimeout(function(){if(l.lostFocus){l.div.find(".AnyTime-focus-btn").removeClass("AnyTime-focus-btn ui-state-focus");if(l.pop)l.dismiss(e);else l.ajax()}},334)},btn:function(t,n,r,i,s){var o=t[0].nodeName.toLowerCase()=="ul"?"li":"td";var u="<"+o+' class="AnyTime-btn';for(var a=0;a<i.length;a++)u+=" AnyTime-"+i[a]+"-btn";var f=e(u+' ui-state-default">'+n+"</"+o+">");t.append(f);f.AnyTime_title=s;f.click(function(e){l.tempFunc=r;l.tempFunc(e)});f.dblclick(function(t){var n=e(this);if(n.is(".AnyTime-off-off-btn"))l.dismissODiv(t);else if(n.is(".AnyTime-mil-btn")||n.is(".AnyTime-cent-btn")||n.is(".AnyTime-dec-btn")||n.is(".AnyTime-yr-btn")||n.is(".AnyTime-era-btn"))l.dismissYDiv(t);else if(l.pop)l.dismiss(t)});return f},cleanup:function(e){this.inp.unbind("blur",this.hBlur);this.inp.unbind("click",this.hClick);this.inp.unbind("focus",this.hFocus);this.inp.unbind("keydown",this.hKeydown);this.inp.unbind("keypress",this.hKeypress);this.div.remove()},dismiss:function(e){this.ajax();if(n)n.hide();if(this.yDiv)this.dismissYDiv();if(this.oDiv)this.dismissODiv();this.div.hide();this.lostFocus=true},dismissODiv:function(e){this.oDiv.hide();this.cloak.hide();this.setFocus(this.oCur)},dismissYDiv:function(e){this.yDiv.hide();this.cloak.hide();this.setFocus(this.yCur)},setFocus:function(e){if(!e.hasClass("AnyTime-focus-btn")){this.div.find(".AnyTime-focus-btn").removeClass("AnyTime-focus-btn ui-state-focus");this.fBtn=e;e.removeClass("ui-state-default ui-state-highlight");e.addClass("AnyTime-focus-btn ui-state-default ui-state-highlight ui-state-focus")}if(e.hasClass("AnyTime-off-off-btn")){var t=this.oBody.offset().top;var n=e.offset().top;var r=e.AnyTime_height(true);if(n-r<t)this.oBody.scrollTop(n+this.oBody.scrollTop()-(this.oBody.innerHeight()+t)+r*2);else if(n+r>t+this.oBody.innerHeight())this.oBody.scrollTop(n+this.oBody.scrollTop()-(t+r))}},key:function(e){var n;var r=null;var i=this;var s=this.div.find(".AnyTime-focus-btn");var o=e.keyCode||e.which;this.denyTab=true;if(o==16){}else if(o==10||o==13||o==27){if(this.oDiv&&this.oDiv.is(":visible"))this.dismissODiv(e);else if(this.yDiv&&this.yDiv.is(":visible"))this.dismissYDiv(e);else if(this.pop)this.dismiss(e)}else if(o==33||o==9&&e.shiftKey){if(this.fBtn.hasClass("AnyTime-off-off-btn")){if(o==9)this.dismissODiv(e)}else if(this.fBtn.hasClass("AnyTime-mil-btn")){if(o==9)this.dismissYDiv(e)}else if(this.fBtn.hasClass("AnyTime-cent-btn"))this.yDiv.find(".AnyTime-mil-btn.AnyTime-cur-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-dec-btn"))this.yDiv.find(".AnyTime-cent-btn.AnyTime-cur-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-yr-btn"))this.yDiv.find(".AnyTime-dec-btn.AnyTime-cur-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-era-btn"))this.yDiv.find(".AnyTime-yr-btn.AnyTime-cur-btn").triggerHandler("click");else if(this.fBtn.parents(".AnyTime-yrs").length){if(o==9){this.denyTab=false;return}}else if(this.fBtn.hasClass("AnyTime-mon-btn")){if(this.dY)this.yCur.triggerHandler("click");else if(o==9){this.denyTab=false;return}}else if(this.fBtn.hasClass("AnyTime-dom-btn")){if(o==9&&e.shiftKey){this.denyTab=false;return}else{r=new Date(this.time.getTime());if(e.shiftKey)r.setFullYear(r.getFullYear()-1);else{n=r.getMonth()-1;if(r.getDate()>t[n])r.setDate(t[n]);r.setMonth(n)}this.keyDateChange(r)}}else if(this.fBtn.hasClass("AnyTime-hr-btn")){r=this.dDoM||this.dMo;if(r)r.AnyTime_clickCurrent();else if(this.dY)this.yCur.triggerHandler("click");else if(o==9){this.denyTab=false;return}}else if(this.fBtn.hasClass("AnyTime-min-ten-btn")){r=this.dH||this.dDoM||this.dMo;if(r)r.AnyTime_clickCurrent();else if(this.dY)this.yCur.triggerHandler("click");else if(o==9){this.denyTab=false;return}}else if(this.fBtn.hasClass("AnyTime-min-one-btn"))this.dM.AnyTime_clickCurrent();else if(this.fBtn.hasClass("AnyTime-sec-ten-btn")){if(this.dM)r=this.dM.find(".AnyTime-mins-ones");else r=this.dH||this.dDoM||this.dMo;if(r)r.AnyTime_clickCurrent();else if(this.dY)this.yCur.triggerHandler("click");else if(o==9){this.denyTab=false;return}}else if(this.fBtn.hasClass("AnyTime-sec-one-btn"))this.dS.AnyTime_clickCurrent();else if(this.fBtn.hasClass("AnyTime-off-btn")){if(this.dS)r=this.dS.find(".AnyTime-secs-ones");else if(this.dM)r=this.dM.find(".AnyTime-mins-ones");else r=this.dH||this.dDoM||this.dMo;if(r)r.AnyTime_clickCurrent();else if(this.dY)this.yCur.triggerHandler("click");else if(o==9){this.denyTab=false;return}}}else if(o==34||o==9){if(this.fBtn.hasClass("AnyTime-mil-btn"))this.yDiv.find(".AnyTime-cent-btn.AnyTime-cur-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-cent-btn"))this.yDiv.find(".AnyTime-dec-btn.AnyTime-cur-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-dec-btn"))this.yDiv.find(".AnyTime-yr-btn.AnyTime-cur-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-yr-btn")){r=this.yDiv.find(".AnyTime-era-btn.AnyTime-cur-btn");if(r.length)r.triggerHandler("click");else if(o==9)this.dismissYDiv(e)}else if(this.fBtn.hasClass("AnyTime-era-btn")){if(o==9)this.dismissYDiv(e)}else if(this.fBtn.hasClass("AnyTime-off-off-btn")){if(o==9)this.dismissODiv(e)}else if(this.fBtn.parents(".AnyTime-yrs").length){r=this.dDoM||this.dMo||this.dH||this.dM||this.dS||this.dO;if(r)r.AnyTime_clickCurrent();else if(o==9){this.denyTab=false;return}}else if(this.fBtn.hasClass("AnyTime-mon-btn")){r=this.dDoM||this.dH||this.dM||this.dS||this.dO;if(r)r.AnyTime_clickCurrent();else if(o==9){this.denyTab=false;return}}else if(this.fBtn.hasClass("AnyTime-dom-btn")){if(o==9){r=this.dH||this.dM||this.dS||this.dO;if(r)r.AnyTime_clickCurrent();else{this.denyTab=false;return}}else{r=new Date(this.time.getTime());if(e.shiftKey)r.setFullYear(r.getFullYear()+1);else{n=r.getMonth()+1;if(r.getDate()>t[n])r.setDate(t[n]);r.setMonth(n)}this.keyDateChange(r)}}else if(this.fBtn.hasClass("AnyTime-hr-btn")){r=this.dM||this.dS||this.dO;if(r)r.AnyTime_clickCurrent();else if(o==9){this.denyTab=false;return}}else if(this.fBtn.hasClass("AnyTime-min-ten-btn"))this.dM.find(".AnyTime-mins-ones .AnyTime-cur-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-min-one-btn")){r=this.dS||this.dO;if(r)r.AnyTime_clickCurrent();else if(o==9){this.denyTab=false;return}}else if(this.fBtn.hasClass("AnyTime-sec-ten-btn"))this.dS.find(".AnyTime-secs-ones .AnyTime-cur-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-sec-one-btn")){if(this.dO)this.dO.AnyTime_clickCurrent();else if(o==9){this.denyTab=false;return}}else if(this.fBtn.hasClass("AnyTime-off-btn")){if(o==9){this.denyTab=false;return}}}else if(o==35){if(this.fBtn.hasClass("AnyTime-mil-btn")||this.fBtn.hasClass("AnyTime-cent-btn")||this.fBtn.hasClass("AnyTime-dec-btn")||this.fBtn.hasClass("AnyTime-yr-btn")||this.fBtn.hasClass("AnyTime-era-btn")){r=this.yDiv.find(".AnyTime-ce-btn");if(!r.length)r=this.yDiv.find(".AnyTime-yr9-btn");r.triggerHandler("click")}else if(this.fBtn.hasClass("AnyTime-dom-btn")){r=new Date(this.time.getTime());r.setDate(1);r.setMonth(r.getMonth()+1);r.setDate(r.getDate()-1);if(e.ctrlKey)r.setMonth(11);this.keyDateChange(r)}else if(this.dS)this.dS.find(".AnyTime-sec9-btn").triggerHandler("click");else if(this.dM)this.dM.find(".AnyTime-min9-btn").triggerHandler("click");else if(this.dH)this.dH.find(".AnyTime-hr23-btn").triggerHandler("click");else if(this.dDoM)this.dDoM.find(".AnyTime-dom-btn-filled:last").triggerHandler("click");else if(this.dMo)this.dMo.find(".AnyTime-mon12-btn").triggerHandler("click");else if(this.dY)this.yAhead.triggerHandler("click")}else if(o==36){if(this.fBtn.hasClass("AnyTime-mil-btn")||this.fBtn.hasClass("AnyTime-cent-btn")||this.fBtn.hasClass("AnyTime-dec-btn")||this.fBtn.hasClass("AnyTime-yr-btn")||this.fBtn.hasClass("AnyTime-era-btn")){this.yDiv.find(".AnyTime-mil0-btn").triggerHandler("click")}else if(this.fBtn.hasClass("AnyTime-dom-btn")){r=new Date(this.time.getTime());r.setDate(1);if(e.ctrlKey)r.setMonth(0);this.keyDateChange(r)}else if(this.dY)this.yCur.triggerHandler("click");else if(this.dMo)this.dMo.find(".AnyTime-mon1-btn").triggerHandler("click");else if(this.dDoM)this.dDoM.find(".AnyTime-dom-btn-filled:first").triggerHandler("click");else if(this.dH)this.dH.find(".AnyTime-hr0-btn").triggerHandler("click");else if(this.dM)this.dM.find(".AnyTime-min00-btn").triggerHandler("click");else if(this.dS)this.dS.find(".AnyTime-sec00-btn").triggerHandler("click")}else if(o==37){if(this.fBtn.hasClass("AnyTime-dom-btn")){r=new Date(this.time.getTime());r.setDate(r.getDate()-1);this.keyDateChange(r)}else this.keyBack()}else if(o==38){if(this.fBtn.hasClass("AnyTime-dom-btn")){r=new Date(this.time.getTime());r.setDate(r.getDate()-7);this.keyDateChange(r)}else this.keyBack()}else if(o==39){if(this.fBtn.hasClass("AnyTime-dom-btn")){r=new Date(this.time.getTime());r.setDate(r.getDate()+1);this.keyDateChange(r)}else this.keyAhead()}else if(o==40){if(this.fBtn.hasClass("AnyTime-dom-btn")){r=new Date(this.time.getTime());r.setDate(r.getDate()+7);this.keyDateChange(r)}else this.keyAhead()}else if((o==86||o==118)&&e.ctrlKey){this.inp.val("").change();setTimeout(function(){i.showPkr(null)},100);return}else this.showPkr(null);e.preventDefault()},keyAhead:function(){if(this.fBtn.hasClass("AnyTime-mil9-btn"))this.yDiv.find(".AnyTime-cent0-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-cent9-btn"))this.yDiv.find(".AnyTime-dec0-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-dec9-btn"))this.yDiv.find(".AnyTime-yr0-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-yr9-btn"))this.yDiv.find(".AnyTime-bce-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-sec9-btn")){}else if(this.fBtn.hasClass("AnyTime-sec50-btn"))this.dS.find(".AnyTime-sec0-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-min9-btn")){if(this.dS)this.dS.find(".AnyTime-sec00-btn").triggerHandler("click")}else if(this.fBtn.hasClass("AnyTime-min50-btn"))this.dM.find(".AnyTime-min0-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-hr23-btn")){if(this.dM)this.dM.find(".AnyTime-min00-btn").triggerHandler("click");else if(this.dS)this.dS.find(".AnyTime-sec00-btn").triggerHandler("click")}else if(this.fBtn.hasClass("AnyTime-hr11-btn"))this.dH.find(".AnyTime-hr12-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-mon12-btn")){if(this.dDoM)this.dDoM.AnyTime_clickCurrent();else if(this.dH)this.dH.find(".AnyTime-hr0-btn").triggerHandler("click");else if(this.dM)this.dM.find(".AnyTime-min00-btn").triggerHandler("click");else if(this.dS)this.dS.find(".AnyTime-sec00-btn").triggerHandler("click")}else if(this.fBtn.hasClass("AnyTime-yrs-ahead-btn")){if(this.dMo)this.dMo.find(".AnyTime-mon1-btn").triggerHandler("click");else if(this.dH)this.dH.find(".AnyTime-hr0-btn").triggerHandler("click");else if(this.dM)this.dM.find(".AnyTime-min00-btn").triggerHandler("click");else if(this.dS)this.dS.find(".AnyTime-sec00-btn").triggerHandler("click")}else if(this.fBtn.hasClass("AnyTime-yr-cur-btn"))this.yNext.triggerHandler("click");else this.fBtn.next().triggerHandler("click")},keyBack:function(){if(this.fBtn.hasClass("AnyTime-cent0-btn"))this.yDiv.find(".AnyTime-mil9-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-dec0-btn"))this.yDiv.find(".AnyTime-cent9-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-yr0-btn"))this.yDiv.find(".AnyTime-dec9-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-bce-btn"))this.yDiv.find(".AnyTime-yr9-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-yr-cur-btn"))this.yPrior.triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-mon1-btn")){if(this.dY)this.yCur.triggerHandler("click")}else if(this.fBtn.hasClass("AnyTime-hr0-btn")){if(this.dDoM)this.dDoM.AnyTime_clickCurrent();else if(this.dMo)this.dMo.find(".AnyTime-mon12-btn").triggerHandler("click");else if(this.dY)this.yNext.triggerHandler("click")}else if(this.fBtn.hasClass("AnyTime-hr12-btn"))this.dH.find(".AnyTime-hr11-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-min00-btn")){if(this.dH)this.dH.find(".AnyTime-hr23-btn").triggerHandler("click");else if(this.dDoM)this.dDoM.AnyTime_clickCurrent();else if(this.dMo)this.dMo.find(".AnyTime-mon12-btn").triggerHandler("click");else if(this.dY)this.yNext.triggerHandler("click")}else if(this.fBtn.hasClass("AnyTime-min0-btn"))this.dM.find(".AnyTime-min50-btn").triggerHandler("click");else if(this.fBtn.hasClass("AnyTime-sec00-btn")){if(this.dM)this.dM.find(".AnyTime-min9-btn").triggerHandler("click");else if(this.dH)this.dH.find(".AnyTime-hr23-btn").triggerHandler("click");else if(this.dDoM)this.dDoM.AnyTime_clickCurrent();else if(this.dMo)this.dMo.find(".AnyTime-mon12-btn").triggerHandler("click");else if(this.dY)this.yNext.triggerHandler("click")}else if(this.fBtn.hasClass("AnyTime-sec0-btn"))this.dS.find(".AnyTime-sec50-btn").triggerHandler("click");else this.fBtn.prev().triggerHandler("click")},keyDateChange:function(e){if(this.fBtn.hasClass("AnyTime-dom-btn")){this.set(e);this.upd(null);this.setFocus(this.dDoM.find(".AnyTime-cur-btn"))}},makeCloak:function(){if(!this.cloak){this.cloak=e('<div class="AnyTime-cloak" style="position:absolute" />');this.div.append(this.cloak);this.cloak.click(function(e){if(l.oDiv&&l.oDiv.is(":visible"))l.dismissODiv(e);else l.dismissYDiv(e)})}else this.cloak.show()},newHour:function(t){var n;var r;var i=e(t.target);if(i.hasClass("AnyTime-out-btn"))return;if(!this.twelveHr)n=Number(i.text());else{var s=i.text();r=s.indexOf("a");if(r<0){r=Number(s.substr(0,s.indexOf("p")));n=r==12?12:r+12}else{r=Number(s.substr(0,r));n=r==12?0:r}}r=new Date(this.time.getTime());r.setHours(n);this.set(r);this.upd(i)},newOffset:function(e){if(e.target==this.oSel[0])this.askOffset(e);else{this.upd(this.oCur)}},newOPos:function(t){var n=e(t.target);this.offMin=n[0].AnyTime_offMin;this.offSI=n[0].AnyTime_offSI;var r=new Date(this.time.getTime());this.set(r);this.updODiv(n)},newYear:function(t){var n=e(t.target);if(n.hasClass("AnyTime-out-btn"))return;var r=n.text();if(r=="<"||r=="<")this.askYear(t);else if(r==">"||r==">")this.askYear(t);else{var i=new Date(this.time.getTime());i.setFullYear(Number(r));this.set(i);this.upd(this.yCur)}},newYPos:function(t){var n=e(t.target);if(n.hasClass("AnyTime-out-btn"))return;var r=1;var i=this.time.getFullYear();if(i<0){r=-1;i=0-i}i=AnyTime.pad(i,4);if(n.hasClass("AnyTime-mil-btn"))i=n.html()+i.substring(1,4);else if(n.hasClass("AnyTime-cent-btn"))i=i.substring(0,1)+n.html()+i.substring(2,4);else if(n.hasClass("AnyTime-dec-btn"))i=i.substring(0,2)+n.html()+i.substring(3,4);else i=i.substring(0,3)+n.html();if(i=="0000")i=1;var s=new Date(this.time.getTime());s.setFullYear(r*i);this.set(s);this.updYDiv(n)},onReady:function(){this.lostFocus=true;if(!this.pop)this.upd(null);else{if(this.div.parent()!=document.body)this.div.appendTo(document.body)}},pos:function(t){if(this.pop){var n=this.inp.offset();var r=e(document.body).outerWidth(true);var i=this.div.outerWidth(true);var s=n.left;if(s+i>r-20)s=r-(i+20);var o=n.top-this.div.outerHeight(true);if(o<0)o=n.top+this.inp.outerHeight(true);this.div.css({top:String(o)+"px",left:String(s<0?0:s)+"px"})}var u=this.div.offset();if(this.oDiv&&this.oDiv.is(":visible")){var a=this.oLab.offset();if(this.div.css("position")=="absolute"){a.top-=u.top;a.left=a.left-u.left;u={top:0,left:0}}var f=this.oDiv.AnyTime_width(true);var l=this.div.AnyTime_width(true);if(a.left+f>u.left+l){a.left=u.left+l-f;if(a.left<2)a.left=2}var c=this.oDiv.AnyTime_height(true);var h=this.div.AnyTime_height(true);a.top+=this.oLab.AnyTime_height(true);if(a.top+c>u.top+h)a.top=a.top-c;if(a.top<u.top)a.top=u.top;this.oDiv.css({top:a.top+"px",left:a.left+"px"})}else if(this.yDiv&&this.yDiv.is(":visible")){var p=this.yLab.offset();if(this.div.css("position")=="absolute"){p.top-=u.top;p.left=p.left-u.left;u={top:0,left:0}}p.left+=(this.yLab.outerWidth(true)-this.yDiv.outerWidth(true))/2;this.yDiv.css({top:p.top+"px",left:p.left+"px"})}if(this.cloak)this.cloak.css({top:u.top+"px",left:u.left+"px",height:String(this.div.outerHeight(true)-2)+"px",width:String(this.div.outerWidth(!e.browser.safari)-2)+"px"})},set:function(e){var t=e.getTime();if(this.earliest&&t<this.earliest)this.time=new Date(this.earliest);else if(this.latest&&t>this.latest)this.time=new Date(this.latest);else this.time=e},setEarliest:function(e){this.earliest=e;this.set(this.time)},setLatest:function(e){this.latest=e;this.set(this.time)},showPkr:function(e){try{this.time=this.conv.parse(this.inp.val());this.offMin=this.conv.getUtcParseOffsetCaptured();this.offSI=this.conv.getUtcParseOffsetSubIndex()}catch(t){this.time=new Date}this.set(this.time);this.upd(null);fBtn=null;var r=".AnyTime-cur-btn:first";if(this.dDoM)fBtn=this.dDoM.find(r);else if(this.yCur)fBtn=this.yCur;else if(this.dMo)fBtn=this.dMo.find(r);else if(this.dH)fBtn=this.dH.find(r);else if(this.dM)fBtn=this.dM.find(r);else if(this.dS)fBtn=this.dS.find(r);this.setFocus(fBtn);this.pos(e);if(this.pop&&n)setTimeout(function(){var e=l.div.offset();n.css({height:String(l.div.outerHeight(true))+"px",left:String(e.left)+"px",position:"absolute",top:String(e.top)+"px",width:String(l.div.outerWidth(true))+"px"});n.show()},300)},upd:function(t){var n=new Date(this.time.getTime());n.setMonth(0,1);n.setHours(12,0,0,0);var r=new Date(this.time.getTime());r.setMonth(11,31);r.setHours(23,59,59,999);var i=this.time.getFullYear();if(this.earliest&&this.yPast){r.setYear(i-2);if(r.getTime()<this.earliest)this.yPast.addClass("AnyTime-out-btn ui-state-disabled");else this.yPast.removeClass("AnyTime-out-btn ui-state-disabled")}if(this.yPrior){this.yPrior.text(AnyTime.pad(i==1?-1:i-1,4));if(this.earliest){r.setYear(i-1);if(r.getTime()<this.earliest)this.yPrior.addClass("AnyTime-out-btn ui-state-disabled");else this.yPrior.removeClass("AnyTime-out-btn ui-state-disabled")}}if(this.yCur)this.yCur.text(AnyTime.pad(i,4));if(this.yNext){this.yNext.text(AnyTime.pad(i==-1?1:i+1,4));if(this.latest){n.setYear(i+1);if(n.getTime()>this.latest)this.yNext.addClass("AnyTime-out-btn ui-state-disabled");else this.yNext.removeClass("AnyTime-out-btn ui-state-disabled")}}if(this.latest&&this.yAhead){n.setYear(i+2);if(n.getTime()>this.latest)this.yAhead.addClass("AnyTime-out-btn ui-state-disabled");else this.yAhead.removeClass("AnyTime-out-btn ui-state-disabled")}n.setFullYear(this.time.getFullYear());r.setFullYear(this.time.getFullYear());var u=0;i=this.time.getMonth();e("#"+this.id+" .AnyTime-mon-btn").each(function(){n.setMonth(u);r.setDate(1);r.setMonth(u+1);r.setDate(0);e(this).AnyTime_current(u==i,(!l.earliest||r.getTime()>=l.earliest)&&(!l.latest||n.getTime()<=l.latest));u++});n.setFullYear(this.time.getFullYear());r.setFullYear(this.time.getFullYear());n.setMonth(this.time.getMonth());r.setMonth(this.time.getMonth(),1);i=this.time.getDate();var a=this.time.getMonth();var f=n.getDay();if(this.fDOW>f)f+=7;var c=0,h=0;e("#"+this.id+" .AnyTime-wk").each(function(){h=l.fDOW;e(this).children().each(function(){if(h-l.fDOW<7){var t=e(this);if(c==0&&h<f||n.getMonth()!=a){t.html(" ");t.removeClass("AnyTime-dom-btn-filled AnyTime-cur-btn ui-state-default ui-state-highlight");t.addClass("AnyTime-dom-btn-empty");if(c){if(n.getDate()==1&&h!=0)t.addClass("AnyTime-dom-btn-empty-after-filled");else t.removeClass("AnyTime-dom-btn-empty-after-filled");if(n.getDate()<=7)t.addClass("AnyTime-dom-btn-empty-below-filled");else t.removeClass("AnyTime-dom-btn-empty-below-filled");n.setDate(n.getDate()+1);r.setDate(r.getDate()+1)}else{t.addClass("AnyTime-dom-btn-empty-above-filled");if(h==f-1)t.addClass("AnyTime-dom-btn-empty-before-filled");else t.removeClass("AnyTime-dom-btn-empty-before-filled")}t.addClass("ui-state-default ui-state-disabled")}else{u=n.getDate();t.text(u);t.removeClass("AnyTime-dom-btn-empty AnyTime-dom-btn-empty-above-filled AnyTime-dom-btn-empty-before-filled "+"AnyTime-dom-btn-empty-after-filled AnyTime-dom-btn-empty-below-filled "+"ui-state-default ui-state-disabled");t.addClass("AnyTime-dom-btn-filled ui-state-default");t.AnyTime_current(u==i,(!l.earliest||r.getTime()>=l.earliest)&&(!l.latest||n.getTime()<=l.latest));n.setDate(u+1);r.setDate(u+1)}}h++});c++});n.setFullYear(this.time.getFullYear());r.setFullYear(this.time.getFullYear());n.setMonth(this.time.getMonth(),this.time.getDate());r.setMonth(this.time.getMonth(),this.time.getDate());var p=!this.twelveHr;var d=this.time.getHours();e("#"+this.id+" .AnyTime-hr-btn").each(function(){var t=this.innerHTML;var i;if(p)i=Number(t);else{i=Number(t.substring(0,t.length-2));if(t.charAt(t.length-2)=="a"){if(i==12)i=0}else if(i<12)i+=12}n.setHours(i);r.setHours(i);e(this).AnyTime_current(d==i,(!l.earliest||r.getTime()>=l.earliest)&&(!l.latest||n.getTime()<=l.latest));if(i<23)n.setHours(n.getHours()+1)});n.setHours(this.time.getHours());r.setHours(this.time.getHours(),9);var v=this.time.getMinutes();var m=String(Math.floor(v/10));var g=String(v%10);e("#"+this.id+" .AnyTime-min-ten-btn:not(.AnyTime-min-ten-btn-empty)").each(function(){e(this).AnyTime_current(this.innerHTML==m,(!l.earliest||r.getTime()>=l.earliest)&&(!l.latest||n.getTime()<=l.latest));if(n.getMinutes()<50){n.setMinutes(n.getMinutes()+10);r.setMinutes(r.getMinutes()+10)}});n.setMinutes(Math.floor(this.time.getMinutes()/10)*10);r.setMinutes(Math.floor(this.time.getMinutes()/10)*10);e("#"+this.id+" .AnyTime-min-one-btn:not(.AnyTime-min-one-btn-empty)").each(function(){e(this).AnyTime_current(this.innerHTML==g,(!l.earliest||r.getTime()>=l.earliest)&&(!l.latest||n.getTime()<=l.latest));n.setMinutes(n.getMinutes()+1);r.setMinutes(r.getMinutes()+1)});n.setMinutes(this.time.getMinutes());r.setMinutes(this.time.getMinutes(),9);v=this.time.getSeconds();m=String(Math.floor(v/10));g=String(v%10);e("#"+this.id+" .AnyTime-sec-ten-btn:not(.AnyTime-sec-ten-btn-empty)").each(function(){e(this).AnyTime_current(this.innerHTML==m,(!l.earliest||r.getTime()>=l.earliest)&&(!l.latest||n.getTime()<=l.latest));if(n.getSeconds()<50){n.setSeconds(n.getSeconds()+10);r.setSeconds(r.getSeconds()+10)}});n.setSeconds(Math.floor(this.time.getSeconds()/10)*10);r.setSeconds(Math.floor(this.time.getSeconds()/10)*10);e("#"+this.id+" .AnyTime-sec-one-btn:not(.AnyTime-sec-one-btn-empty)").each(function(){e(this).AnyTime_current(this.innerHTML==g,(!l.earliest||r.getTime()>=l.earliest)&&(!l.latest||n.getTime()<=l.latest));n.setSeconds(n.getSeconds()+1);r.setSeconds(r.getSeconds()+1)});if(this.oConv){this.oConv.setUtcFormatOffsetAlleged(this.offMin);this.oConv.setUtcFormatOffsetSubIndex(this.offSI);var y=this.oConv.format(this.time);this.oCur.html(y)}if(t)this.setFocus(t);this.conv.setUtcFormatOffsetAlleged(this.offMin);this.conv.setUtcFormatOffsetSubIndex(this.offSI);this.inp.val(this.conv.format(this.time)).change();this.div.show();var b,w=0,E=0,S=0,x=0,T=0;if(this.dY){E=S=this.dY.outerWidth(true);w=this.yLab.AnyTime_height(true)+this.dY.AnyTime_height(true)}if(this.dMo){x=this.dMo.outerWidth(true);if(x>E)E=x;w+=this.hMo.AnyTime_height(true)+this.dMo.AnyTime_height(true)}if(this.dDoM){T=this.dDoM.outerWidth(true);if(T>E)E=T;if(s||o){if(x>T)this.dDoM.css("width",String(x)+"px");else if(S>T)this.dDoM.css("width",String(S)+"px")}w+=this.hDoM.AnyTime_height(true)+this.dDoM.AnyTime_height(true)}if(this.dD){this.dD.css({width:String(E)+"px",height:String(w)+"px"});E+=this.dMinW;w+=this.dMinH}var N=0,C=0,k=0,L=0;if(this.dH){N=this.dH.outerWidth(true);L+=N+1;C=this.dH.AnyTime_height(true);if(C>k)k=C}if(this.dM){N=this.dM.outerWidth(true);L+=N+1;C=this.dM.AnyTime_height(true);if(C>k)k=C}if(this.dS){N=this.dS.outerWidth(true);L+=N+1;C=this.dS.AnyTime_height(true);if(C>k)k=C}if(this.dO){N=this.oMinW;if(L<N+1)L=N+1;k+=this.dO.AnyTime_height(true)}if(this.dT){this.dT.css({width:String(L)+"px",height:String(k)+"px"});L+=this.tMinW+1;k+=this.tMinH;E+=L;if(k>w)w=k;if(this.dO){var A=this.dT.width()-(this.oMinW+1);this.dO.css({width:String(A)+"px"});this.oCur.css({width:String(A-(this.oListMinW+4))+"px"})}}this.dB.css({height:String(w)+"px",width:String(E)+"px"});w+=this.bMinH;E+=this.bMinW;w+=this.hTitle.AnyTime_height(true)+this.wMinH;E+=this.wMinW;if(this.hTitle.outerWidth(true)>E)E=this.hTitle.outerWidth(true);this.div.css({height:String(w)+"px",width:String(E)+"px"});if(!this.pop)this.ajax()},updODiv:function(t){var n,r=false,i=null;this.oDiv.find(".AnyTime-off-off-btn").each(function(){if(this.AnyTime_offMin==l.offMin){if(this.AnyTime_offSI==l.offSI)e(this).AnyTime_current(r=true,true);else{e(this).AnyTime_current(false,true);if(i==null)i=e(this)}}else e(this).AnyTime_current(false,true)});if(!r&&i!=null)i.AnyTime_current(true,true);this.conv.setUtcFormatOffsetAlleged(this.offMin);this.conv.setUtcFormatOffsetSubIndex(this.offSI);this.inp.val(this.conv.format(this.time)).change();this.upd(t)},updYDiv:function(t){var n,r;var i=1;var s=this.time.getFullYear();if(s<0){i=-1;s=0-s}s=AnyTime.pad(s,4);var o=l.earliest&&(new Date(l.earliest)).getFullYear();var u=l.latest&&(new Date(l.latest)).getFullYear();n=0;this.yDiv.find(".AnyTime-mil-btn").each(function(){r=(!l.earliest||i*(n+(i<0?0:999))>=o)&&(!l.latest||i*(n+(i>0?0:999))<=u);e(this).AnyTime_current(this.innerHTML==s.substring(0,1),r);n+=1e3});n=Math.floor(s/1e3)*1e3;this.yDiv.find(".AnyTime-cent-btn").each(function(){r=(!l.earliest||i*(n+(i<0?0:99))>=o)&&(!l.latest||i*(n+(i>0?0:99))<=u);e(this).AnyTime_current(this.innerHTML==s.substring(1,2),r);n+=100});n=Math.floor(s/100)*100;this.yDiv.find(".AnyTime-dec-btn").each(function(){r=(!l.earliest||i*(n+(i<0?0:9))>=o)&&(!l.latest||i*(n+(i>0?0:9))<=u);e(this).AnyTime_current(this.innerHTML==s.substring(2,3),r);n+=10});n=Math.floor(s/10)*10;this.yDiv.find(".AnyTime-yr-btn").each(function(){r=(!l.earliest||i*n>=o)&&(!l.latest||i*n<=u);e(this).AnyTime_current(this.innerHTML==s.substring(3),r);n+=1});this.yDiv.find(".AnyTime-bce-btn").each(function(){e(this).AnyTime_current(i<0,!l.earliest||l.earliest<0)});this.yDiv.find(".AnyTime-ce-btn").each(function(){e(this).AnyTime_current(i>0,!l.latest||l.latest>0)});this.conv.setUtcFormatOffsetAlleged(this.offMin);this.conv.setUtcFormatOffsetSubIndex(this.offSI);this.inp.val(this.conv.format(this.time)).change();this.upd(t)}};u[a].initialize(a)};AnyTime.setEarliest=function(e,t){u[e].setEarliest(t)};AnyTime.setLatest=function(e,t){u[e].setLatest(t)}})(jQuery);
// REMOVE FROM HERE DOWN
if(window.location.hostname.length&&(window.location.hostname!='www.ama3.com'))alert('REMOVE THE LAST LINE FROM anytime.js!');