(function($,undefined){function testProps(props){var i;for(i in props){if(mod[props[i]]!==undefined){return true}}return false}function testPrefix(){var prefixes=["Webkit","Moz","O","ms"],p;for(p in prefixes){if(testProps([prefixes[p]+"Transform"])){return"-"+prefixes[p].toLowerCase()+"-"}}return""}function init(that,options,args){var ret=that;if(typeof options==="object"){return that.each(function(){if(!this.id){this.id="mobiscroll"+(++id)}if(instances[this.id]){instances[this.id].destroy()}new $.mobiscroll.classes[options.component||"Scroller"](this,options)})}if(typeof options==="string"){that.each(function(){var r,inst=instances[this.id];if(inst&&inst[options]){r=inst[options].apply(this,Array.prototype.slice.call(args,1));if(r!==undefined){ret=r;return false}}})}return ret}var id=+new Date(),touches={},instances={},extend=$.extend,mod=document.createElement("modernizr").style,has3d=testProps(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]),hasFlex=testProps(["flex","msFlex","WebkitBoxDirection"]),prefix=testPrefix(),pr=prefix.replace(/^\-/,"").replace(/\-$/,"").replace("moz","Moz");$.fn.mobiscroll=function(method){extend(this,$.mobiscroll.components);return init(this,method,arguments)};$.mobiscroll=$.mobiscroll||{version:"2.13.2",util:{prefix:prefix,jsPrefix:pr,has3d:has3d,hasFlex:hasFlex,testTouch:function(e){if(e.type=="touchstart"){touches[e.target]=true}else{if(touches[e.target]){delete touches[e.target];return false}}return true},isNumeric:function(a){return a-parseFloat(a)>=0},getCoord:function(e,c){var ev=e.originalEvent||e;return ev.changedTouches?ev.changedTouches[0]["page"+c]:e["page"+c]},constrain:function(val,min,max){return Math.max(min,Math.min(val,max))}},tapped:false,presets:{scroller:{},numpad:{}},themes:{listview:{}},i18n:{},instances:instances,classes:{},components:{},defaults:{theme:"mobiscroll",context:"body"},userdef:{},setDefaults:function(o){extend(this.userdef,o)},presetShort:function(name,c,p){this.components[name]=function(s){return init(this,extend(s,{component:c,preset:p===false?undefined:name}),arguments)}}};$.scroller=$.scroller||$.mobiscroll;$.fn.scroller=$.fn.scroller||$.fn.mobiscroll})(jQuery);(function($){$.mobiscroll.i18n.zh=$.extend($.mobiscroll.i18n.zh,{setText:"确定",cancelText:"取消",clearText:"明确",selectedText:"选",dateFormat:"yy/mm/dd",dateOrder:"yymmdd",dayNames:["周日","周一","周二","周三","周四","周五","周六"],dayNamesShort:["日","一","二","三","四","五","六"],dayNamesMin:["日","一","二","三","四","五","六"],dayText:"日",hourText:"时",minuteText:"分",monthNames:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthNamesShort:["一","二","三","四","五","六","七","八","九","十","十一","十二"],monthText:"月",secText:"秒",timeFormat:"HH:ii",timeWheels:"HHii",yearText:"年",nowText:"当前",pmText:"下午",amText:"上午",dateText:"日",timeText:"时间",calendarText:"日历",closeText:"关闭",fromText:"开始时间",toText:"结束时间",wholeText:"合计",fractionText:"分数",unitText:"单位",labels:["年","月","日","小时","分钟","秒",""],labelsShort:["年","月","日","点","分","秒",""],startText:"开始",stopText:"停止",resetText:"重置",lapText:"圈",hideText:"隐藏"})})(jQuery);(function($,window,document,undefined){var $activeElm,preventShow,extend=$.extend,ms=$.mobiscroll,instances=ms.instances,userdef=ms.userdef,util=ms.util,pr=util.jsPrefix,has3d=util.has3d,getCoord=util.getCoord,constrain=util.constrain,isOldAndroid=/android [1-3]/i.test(navigator.userAgent),animEnd="webkitAnimationEnd animationend",empty=function(){},prevdef=function(ev){ev.preventDefault()};ms.classes.Widget=function(el,settings,inherit){var $ariaDiv,$ctx,$header,$markup,$overlay,$persp,$popup,$wnd,$wrapper,buttons,btn,doAnim,hasButtons,isModal,lang,modalWidth,modalHeight,posEvents,preset,preventPos,s,scrollLock,setReadOnly,theme,wasReadOnly,wndWidth,wndHeight,that=this,$elm=$(el),elmList=[],posDebounce={};function onBtnStart(ev){if(btn){btn.removeClass("dwb-a")}btn=$(this);if(!btn.hasClass("dwb-d")&&!btn.hasClass("dwb-nhl")){btn.addClass("dwb-a")}if(ev.type==="mousedown"){$(document).on("mouseup",onBtnEnd)}}function onBtnEnd(ev){if(btn){btn.removeClass("dwb-a");btn=null}if(ev.type==="mouseup"){$(document).off("mouseup",onBtnEnd)}}function onShow(prevFocus){if(!prevFocus){$popup.focus()}that.ariaMessage(s.ariaMessage)}function onHide(prevAnim){var activeEl,value,type,focus=s.focusOnClose;$markup.remove();if($activeElm&&!prevAnim){setTimeout(function(){if(focus===undefined){preventShow=true;activeEl=$activeElm[0];type=activeEl.type;value=activeEl.value;try{activeEl.type="button"}catch(ex){}$activeElm.focus();activeEl.type=type;activeEl.value=value}else{if(focus){if(instances[$(focus).attr("id")]){ms.tapped=false}$(focus).focus()}}},200)}that._isVisible=false;event("onHide",[])}function onPosition(ev){clearTimeout(posDebounce[ev.type]);posDebounce[ev.type]=setTimeout(function(){var isScroll=ev.type=="scroll";if(isScroll&&!scrollLock){return }that.position(!isScroll)},200)}function event(name,args){var ret;args.push(that);$.each([userdef,theme,preset,settings],function(i,v){if(v&&v[name]){ret=v[name].apply(el,args)}});return ret}that.position=function(check){var w,l,t,anchor,aw,ah,ap,at,al,arr,arrw,arrl,dh,scroll,sl,st,totalw=0,minw=0,css={},nw=Math.min($wnd[0].innerWidth||$wnd.innerWidth(),$persp.width()),nh=$wnd[0].innerHeight||$wnd.innerHeight();if((wndWidth===nw&&wndHeight===nh&&check)||preventPos){return}if(isModal&&that._isLiquid&&s.display!=="bubble"){$popup.width(nw)}if(event("onPosition",[$markup,nw,nh])===false||!isModal){return}sl=$wnd.scrollLeft();st=$wnd.scrollTop();anchor=s.anchor===undefined?$elm:$(s.anchor);if(that._isLiquid&&s.layout!=="liquid"){if(nw<400){$markup.addClass("dw-liq")}else{$markup.removeClass("dw-liq")}}if(/modal|bubble/.test(s.display)){$wrapper.width("");$(".mbsc-w-p",$markup).each(function(){w=$(this).outerWidth(true);totalw+=w;minw=(w>minw)?w:minw});w=totalw>nw?minw:totalw;$wrapper.width(w).css("white-space",totalw>nw?"":"nowrap")}modalWidth=$popup.outerWidth();modalHeight=$popup.outerHeight(true);scrollLock=modalHeight<=nh&&modalWidth<=nw;that.scrollLock=scrollLock;if(s.display=="modal"){l=Math.max(0,sl+(nw-modalWidth)/2);t=st+(nh-modalHeight)/2}else{if(s.display=="bubble"){scroll=true;arr=$(".dw-arrw-i",$markup);ap=anchor.offset();at=Math.abs($ctx.offset().top-ap.top);al=Math.abs($ctx.offset().left-ap.left);aw=anchor.outerWidth();ah=anchor.outerHeight();l=constrain(al-($popup.outerWidth(true)-aw)/2,sl+3,sl+nw-modalWidth-3);t=at-modalHeight;if((tst+nh)){$popup.removeClass("dw-bubble-top").addClass("dw-bubble-bottom");t=at+ah}else{$popup.removeClass("dw-bubble-bottom").addClass("dw-bubble-top")}arrw=arr.outerWidth();arrl=constrain(al+aw/2-(l+(modalWidth-arrw)/2),0,arrw);$(".dw-arr",$markup).css({left:arrl})}else{l=sl;if(s.display=="top"){t=st}else{if(s.display=="bottom"){t=st+nh-modalHeight}}}}t=t<0?0:t;css.top=t;css.left=l;$popup.css(css);$persp.height(0);dh=Math.max(t+modalHeight,s.context=="body"?$(document).height():$ctx[0].scrollHeight);$persp.css({height:dh});if(scroll&&((t+modalHeight>st+nh)||(at>st+nh))){preventPos=true;setTimeout(function(){preventPos=false},300);$wnd.scrollTop(Math.min(t+modalHeight-nh,dh-nh))}wndWidth=nw;wndHeight=nh};that.attachShow=function($elm,beforeShow){elmList.push($elm);if(s.display!=="inline"){$elm.on("mousedown.dw",function(ev){if(setReadOnly){ev.preventDefault()}}).on((s.showOnFocus?"focus.dw":"")+(s.showOnTap?" click.dw":""),function(ev){if((ev.type!=="focus"||(ev.type==="focus"&&!preventShow))&&!ms.tapped){if(beforeShow){beforeShow()}if($(document.activeElement).is("input,textarea")){$(document.activeElement).blur()}$activeElm=$elm;that.show()}setTimeout(function(){preventShow=false},300)})}};that.select=function(){if(!isModal||that.hide(false,"set")!==false){that._fillValue();event("onSelect",[that.val])}};that.cancel=function(){if(!isModal||that.hide(false,"cancel")!==false){event("onCancel",[that.val])}};that.clear=function(){event("onClear",[$markup]);if(isModal&&!that.live){that.hide(false,"clear")}that.setValue(null,true)};that.enable=function(){s.disabled=false;if(that._isInput){$elm.prop("disabled",false)}};that.disable=function(){s.disabled=true;if(that._isInput){$elm.prop("disabled",true)}};that.show=function(prevAnim,prevFocus){var html;if(s.disabled||that._isVisible){return}if(doAnim!==false){if(s.display=="top"){doAnim="slidedown"}if(s.display=="bottom"){doAnim="slideup"}}that._readValue();event("onBeforeShow",[]);html='
'+'
'+(isModal?'
':"")+"'+(s.display==="bubble"?'
':"")+'
'+'
'+(s.headerText?'
'+s.headerText+"
":"")+'
';html+=that._generateContent();html+="
";if(hasButtons){html+='
';$.each(buttons,function(i,b){b=(typeof b==="string")?that.buttons[b]:b;html+="
'+b.text+"
"});html+="
"}html+="
";$markup=$(html);$persp=$(".dw-persp",$markup);$overlay=$(".dwo",$markup);$wrapper=$(".dwwr",$markup);$header=$(".dwv",$markup);$popup=$(".dw",$markup);$ariaDiv=$(".dw-aria",$markup);that._markup=$markup;that._header=$header;that._isVisible=true;posEvents="orientationchange resize";that._markupReady();event("onMarkupReady",[$markup]);if(isModal){$(window).on("keydown.dw",function(ev){if(ev.keyCode==13){that.select()}else{if(ev.keyCode==27){that.cancel() }}});if(s.scrollLock){$markup.on("touchstart touchmove",function(ev){if(scrollLock){ev.preventDefault()}})}if(pr!=="Moz"){$("input,select,button",$ctx).each(function(){if(!this.disabled){$(this).addClass("dwtd").prop("disabled",true)}})}posEvents+=" scroll";ms.activeInstance=that;$markup.appendTo($ctx);if(has3d&&doAnim&&!prevAnim){$markup.addClass("dw-in dw-trans").on(animEnd,function(){$markup.removeClass("dw-in dw-trans").find(".dw").removeClass("dw-"+doAnim);onShow(prevFocus)}).find(".dw").addClass("dw-"+doAnim)}}else{if($elm.is("div")){$elm.html($markup)}else{$markup.insertAfter($elm)}}event("onMarkupInserted",[$markup]);that.position();$wnd.on(posEvents,onPosition);$markup.on("selectstart mousedown",prevdef).on("click",".dwb-e",prevdef).on("keydown",".dwb-e",function(ev){if(ev.keyCode==32){ev.preventDefault();ev.stopPropagation();$(this).click()}});setTimeout(function(){$.each(buttons,function(i,b){that.tap($(".dwb"+i,$markup),function(ev){b=(typeof b==="string")?that.buttons[b]:b;b.handler.call(this,ev,that)},true)});if(s.closeOnOverlay){that.tap($overlay,function(){that.cancel()})}if(isModal&&!doAnim){onShow(prevFocus)}$markup.on("touchstart mousedown",".dwb-e",onBtnStart).on("touchend",".dwb-e",onBtnEnd);that._attachEvents($markup)},300);event("onShow",[$markup,that._valueText])};that.hide=function(prevAnim,btn,force){if(!that._isVisible||(!force&&!that._isValid&&btn=="set")||(!force&&event("onClose",[that._valueText,btn])===false)){return false}if($markup){if(pr!=="Moz"){$(".dwtd",$ctx).each(function(){$(this).prop("disabled",false).removeClass("dwtd")})}if(has3d&&isModal&&doAnim&&!prevAnim&&!$markup.hasClass("dw-trans")){$markup.addClass("dw-out dw-trans").find(".dw").addClass("dw-"+doAnim).on(animEnd,function(){onHide(prevAnim)})}else{onHide(prevAnim)}$wnd.off(posEvents,onPosition)}delete ms.activeInstance};that.ariaMessage=function(txt){$ariaDiv.html("");setTimeout(function(){$ariaDiv.html(txt)},100)};that.isVisible=function(){return that._isVisible};that.setValue=empty;that._generateContent=empty;that._attachEvents=empty;that._readValue=empty;that._fillValue=empty;that._markupReady=empty;that._processSettings=empty;that.tap=function(el,handler,prevent){var startX,startY,moved;if(s.tap){el.on("touchstart.dw",function(ev){if(prevent){ev.preventDefault()}startX=getCoord(ev,"X");startY=getCoord(ev,"Y");moved=false}).on("touchmove.dw",function(ev){if(Math.abs(getCoord(ev,"X")-startX)>20||Math.abs(getCoord(ev,"Y")-startY)>20){moved=true}}).on("touchend.dw",function(ev){var that=this;if(!moved){ev.preventDefault();setTimeout(function(){handler.call(that,ev)},isOldAndroid?400:10)}ms.tapped=true;setTimeout(function(){ms.tapped=false},500)})}el.on("click.dw",function(ev){if(!ms.tapped){handler.call(this,ev)}ev.preventDefault()})};that.option=function(opt,value){var obj={};if(typeof opt==="object"){obj=opt}else{obj[opt]=value}that.init(obj)};that.destroy=function(){that.hide(true,false,true);$.each(elmList,function(i,v){v.off(".dw")});if(that._isInput&&setReadOnly){el.readOnly=wasReadOnly}event("onDestroy",[]);delete instances[el.id]};that.getInst=function(){return that};that.trigger=event;that.init=function(ss){that.settings=s={};extend(settings,ss);extend(s,ms.defaults,that._defaults,userdef,settings);theme=ms.themes[s.theme]||ms.themes.mobiscroll;lang=ms.i18n[s.lang];event("onThemeLoad",[lang,settings]);extend(s,theme,lang,userdef,settings);preset=ms.presets[that._class][s.preset];s.buttons=s.buttons||(s.display!=="inline"?["set","cancel"]:[]);s.headerText=s.headerText===undefined?(s.display!=="inline"?"{value}":false):s.headerText;if(preset){preset=preset.call(el,that);extend(s,preset,settings)}if(!ms.themes[s.theme]){s.theme="mobiscroll"}that._isLiquid=(s.layout||(/top|bottom/.test(s.display)?"liquid":""))==="liquid";that._processSettings();$elm.off(".dw");doAnim=isOldAndroid?false:s.animate;buttons=s.buttons;isModal=s.display!=="inline";setReadOnly=s.showOnFocus||s.showOnTap;$wnd=$(s.context=="body"?window:s.context);$ctx=$(s.context);if(!s.setText){buttons.splice($.inArray("set",buttons),1)}if(!s.cancelText){buttons.splice($.inArray("cancel",buttons),1)}if(s.button3){buttons.splice($.inArray("set",buttons)+1,0,{text:s.button3Text,handler:s.button3})}that.context=$wnd;that.live=$.inArray("set",buttons)==-1;that.buttons.set={text:s.setText,css:"dwb-s",handler:that.select};that.buttons.cancel={text:(that.live)?s.closeText:s.cancelText,css:"dwb-c",handler:that.cancel};that.buttons.clear={text:s.clearText,css:"dwb-cl",handler:that.clear};that._isInput=$elm.is("input");hasButtons=buttons.length>0;if(that._isVisible){that.hide(true,false,true)}if(isModal){that._readValue();if(that._isInput&&setReadOnly){if(wasReadOnly===undefined){wasReadOnly=el.readOnly}el.readOnly=true}that.attachShow($elm)}else{that.show()}if(that._isInput){$elm.on("change.dw",function(){if(!that._preventChange){that.setValue($elm.val(),false)}that._preventChange=false})}};that.val=null;that.buttons={};that._isValid=true;if(!inherit){instances[el.id]=that; that.init(settings)}};ms.classes.Widget.prototype._defaults={lang:"en",setText:"Set",selectedText:"Selected",closeText:"Close",cancelText:"Cancel",clearText:"Clear",disabled:false,closeOnOverlay:true,showOnFocus:true,showOnTap:true,display:"modal",scrollLock:true,tap:true,btnWidth:true,focusOnClose:false};ms.themes.mobiscroll={rows:5,showLabel:false,headerText:false,btnWidth:false,selectedLineHeight:true,selectedLineBorder:1,dateOrder:"MMddyy",weekDays:"min",checkIcon:"ion-ios7-checkmark-empty",btnPlusClass:"mbsc-ic mbsc-ic-arrow-down5",btnMinusClass:"mbsc-ic mbsc-ic-arrow-up5",btnCalPrevClass:"mbsc-ic mbsc-ic-arrow-left5",btnCalNextClass:"mbsc-ic mbsc-ic-arrow-right5"};$(window).on("focus",function(){if($activeElm){preventShow=true}});$(document).on("mouseover mouseup mousedown click",function(ev){if(ms.tapped){ev.stopPropagation();ev.preventDefault();return false}})})(jQuery,window,document);(function($,window,document,undefined){var move,ms=$.mobiscroll,classes=ms.classes,instances=ms.instances,util=ms.util,pr=util.jsPrefix,has3d=util.has3d,hasFlex=util.hasFlex,getCoord=util.getCoord,constrain=util.constrain,testTouch=util.testTouch;function convert(w){var ret={values:[],keys:[]};$.each(w,function(k,v){ret.keys.push(k);ret.values.push(v)});return ret}classes.Scroller=function(el,settings,inherit){var $markup,btn,isScrollable,itemHeight,s,trigger,valueText,click,moved,start,startTime,stop,p,min,max,target,index,lines,timer,that=this,$elm=$(el),iv={},pos={},pixels={},wheels=[];function onStart(ev){if(testTouch(ev)&&!move&&!click&&!btn&&!isReadOnly(this)){ev.preventDefault();ev.stopPropagation();move=true;isScrollable=s.mode!="clickpick";target=$(".dw-ul",this);setGlobals(target);moved=iv[index]!==undefined;p=moved?getCurrentPosition(target):pos[index];start=getCoord(ev,"Y");startTime=new Date();stop=start;scroll(target,index,p,0.001);if(isScrollable){target.closest(".dwwl").addClass("dwa")}if(ev.type==="mousedown"){$(document).on("mousemove",onMove).on("mouseup",onEnd)}}}function onMove(ev){if(move){if(isScrollable){ev.preventDefault();ev.stopPropagation();stop=getCoord(ev,"Y");if(Math.abs(stop-start)>3||moved){scroll(target,index,constrain(p+(start-stop)/itemHeight,min-1,max+1));moved=true}}}}function onEnd(ev){if(move){var time=new Date()-startTime,val=constrain(p+(start-stop)/itemHeight,min-1,max+1),speed,dist,tindex,ttop=target.offset().top;ev.stopPropagation();if(has3d&&time<300){speed=(stop-start)/time;dist=(speed*speed)/s.speedUnit;if(stop-start<0){dist=-dist}}else{dist=stop-start}tindex=Math.round(p-dist/itemHeight);if(!moved){var idx=Math.floor((stop-ttop)/itemHeight),li=$($(".dw-li",target)[idx]),valid=li.hasClass("dw-v"),hl=isScrollable;if(trigger("onValueTap",[li])!==false&&valid){tindex=idx}else{hl=true}if(hl&&valid){li.addClass("dw-hl");setTimeout(function(){li.removeClass("dw-hl")},100)}}if(isScrollable){calc(target,tindex,0,true,Math.round(val))}if(ev.type==="mouseup"){$(document).off("mousemove",onMove).off("mouseup",onEnd)}move=false}}function onBtnStart(ev){btn=$(this);if(btn.hasClass("dwwb")){if(testTouch(ev)){step(ev,btn.closest(".dwwl"),btn.hasClass("dwwbp")?plus:minus)}}if(ev.type==="mousedown"){$(document).on("mouseup",onBtnEnd)}}function onBtnEnd(ev){btn=null;if(click){clearInterval(timer);click=false}if(ev.type==="mouseup"){$(document).off("mouseup",onBtnEnd)}}function onKeyDown(ev){if(ev.keyCode==38){step(ev,$(this),minus)}else{if(ev.keyCode==40){step(ev,$(this),plus)}}}function onKeyUp(){if(click){clearInterval(timer);click=false}}function onScroll(ev){if(!isReadOnly(this)){ev.preventDefault();ev=ev.originalEvent||ev;var delta=ev.wheelDelta?(ev.wheelDelta/120):(ev.detail?(-ev.detail/3):0),t=$(".dw-ul",this);setGlobals(t);calc(t,Math.round(pos[index]-delta),delta<0?1:2)}}function step(ev,w,func){ev.stopPropagation();ev.preventDefault();if(!click&&!isReadOnly(w)&&!w.hasClass("dwa")){click=true;var t=w.find(".dw-ul");setGlobals(t);clearInterval(timer);timer=setInterval(function(){func(t)},s.delay);func(t)}}function isReadOnly(wh){if($.isArray(s.readonly)){var i=$(".dwwl",$markup).index(wh);return s.readonly[i]}return s.readonly}function generateWheelItems(i){var html='
',ww=wheels[i],w=ww.values?ww:convert(ww),l=1,labels=w.labels||[],values=w.values,keys=w.keys||values;$.each(values,function(j,v){if(l%20===0){html+='
'}html+='
'+'
1?' style="line-height:'+Math.round(itemHeight/lines)+"px;font-size:"+Math.round(itemHeight/lines*0.8)+'px;"':"")+">"+v+"
";l++});html+="
";return html}function setGlobals(t){var multiple=t.closest(".dwwl").hasClass("dwwms");min=$(".dw-li",t).index($(multiple?".dw-li":".dw-v",t).eq(0));max=Math.max(min,$(".dw-li",t).index($(multiple?".dw-li":".dw-v",t).eq(-1))-(multiple?s.rows-1:0));index=$(".dw-ul",$markup).index(t) }function formatHeader(v){var t=s.headerText;return t?(typeof t==="function"?t.call(el,v):t.replace(/\{value\}/i,v)):""}function getCurrentPosition(t){var style=window.getComputedStyle?getComputedStyle(t[0]):t[0].style,matrix,px;if(has3d){$.each(["t","webkitT","MozT","OT","msT"],function(i,v){if(style[v+"ransform"]!==undefined){matrix=style[v+"ransform"];return false}});matrix=matrix.split(")")[0].split(", ");px=matrix[13]||matrix[5]}else{px=style.top.replace("px","")}return Math.round(-px/itemHeight)}function ready(t,i){clearTimeout(iv[i]);delete iv[i];t.closest(".dwwl").removeClass("dwa")}function scroll(t,index,val,time,active){var px=-val*itemHeight,style=t[0].style;if(px==pixels[index]&&iv[index]){return}pixels[index]=px;style[pr+"Transition"]="all "+(time?time.toFixed(3):0)+"s ease-out";if(has3d){style[pr+"Transform"]="translate3d(0,"+px+"px,0)"}else{style.top=px+"px"}if(iv[index]){ready(t,index)}if(time&&active){t.closest(".dwwl").addClass("dwa");iv[index]=setTimeout(function(){ready(t,index)},time*1000)}pos[index]=val}function getValid(val,t,dir,multiple){var cell=$('.dw-li[data-val="'+val+'"]',t),cells=$(".dw-li",t),v=cells.index(cell),l=cells.length;if(multiple){setGlobals(t)}else{if(!cell.hasClass("dw-v")){var cell1=cell,cell2=cell,dist1=0,dist2=0;while(v-dist1>=0&&!cell1.hasClass("dw-v")){dist1++;cell1=cells.eq(v-dist1)}while(v+dist2max?min:val,1,true)}function minus(t){var val=pos[index]-1;calc(t,val-1){wheels[i]=w;$(".dw-ul",$markup).eq(i).html(generateWheelItems(i));nr--;if(!nr){that.position();scrollToPos(time,undefined,manual);return false}}i++});if(!nr){return false}})}};that.getValidCell=getValid;that._generateContent=function(){var lbl,html="",l=0;$.each(s.wheels,function(i,wg){html+='
'+'
"+(hasFlex?"":'');$.each(wg,function(j,w){wheels[l]=w;lbl=w.label!==undefined?w.label:j;html+="<"+(hasFlex?"div":"td")+' class="dwfl"'+' style="'+(s.fixedWidth?("width:"+(s.fixedWidth[l]||s.fixedWidth)+"px;"):(s.minWidth?("min-width:"+(s.minWidth[l]||s.minWidth)+"px;"):"min-width:"+s.width+"px;")+(s.maxWidth?("max-width:"+(s.maxWidth[l]||s.maxWidth)+"px;"):""))+'">'+'
'+(s.mode!="scroller"?'
+
'+'
':"")+'
'+lbl+"
"+'
'+'
'+'
'; html+=generateWheelItems(l)+'
"+(hasFlex?"":"");l++});html+=(hasFlex?"":"
")+"
"});return html};that._attachEvents=function($markup){$markup.on("DOMMouseScroll mousewheel",".dwwl",onScroll).on("keydown",".dwwl",onKeyDown).on("keyup",".dwwl",onKeyUp).on("touchstart mousedown",".dwwl",onStart).on("touchmove",".dwwl",onMove).on("touchend",".dwwl",onEnd).on("touchstart mousedown",".dwb-e",onBtnStart).on("touchend",".dwb-e",onBtnEnd)};that._markupReady=function(){$markup=that._markup;scrollToPos()};that._fillValue=function(){that._hasValue=true;setValue(true,true,0,true)};that._readValue=function(){var v=$elm.val()||"";that._hasValue=v!=="";that.temp=that.values?that.values.slice(0):s.parseValue(v,that);setValue()};that._processSettings=function(){s=that.settings;trigger=that.trigger;itemHeight=s.height;lines=s.multiline;that._isLiquid=(s.layout||(/top|bottom/.test(s.display)&&s.wheels.length==1?"liquid":""))==="liquid";that.values=null;that.temp=null;if(lines>1){s.cssClass=(s.cssClass||"")+" dw-ml"}};that._selectedValues={};if(!inherit){instances[el.id]=that;that.init(settings)}};classes.Scroller.prototype._class="scroller";classes.Scroller.prototype._defaults=$.extend({},classes.Widget.prototype._defaults,{minWidth:80,height:40,rows:3,multiline:1,delay:300,readonly:false,showLabel:true,wheels:[],mode:"scroller",preset:"",speedUnit:0.0012,timeUnit:0.08,formatResult:function(d){return d.join(" ")},parseValue:function(value,inst){var val=value.split(" "),ret=[],i=0,keys;$.each(inst.settings.wheels,function(j,wg){$.each(wg,function(k,w){w=w.values?w:convert(w);keys=w.keys||w.values;if($.inArray(val[i],keys)!==-1){ret.push(val[i])}else{ret.push(keys[0])}i++})});return ret}})})(jQuery,window,document);(function($,undefined){var defaults={inputClass:"",invalid:[],rtl:false,showInput:true,group:false,groupLabel:"Groups",checkIcon:"checkmark"};$.mobiscroll.presetShort("select");$.mobiscroll.presets.scroller.select=function(inst){var change,grIdx,gr,group,input,optIdx,option,prev,prevent,timer,w,orig=$.extend({},inst.settings),s=$.extend(inst.settings,defaults,orig),layout=s.layout||(/top|bottom/.test(s.display)?"liquid":""),isLiquid=layout=="liquid",elm=$(this),multiple=elm.prop("multiple"),id=this.id+"_dummy",lbl=$('label[for="'+this.id+'"]').attr("for",id),label=s.label!==undefined?s.label:(lbl.length?lbl.text():elm.attr("name")),selectedClass="dw-msel mbsc-ic mbsc-ic-"+s.checkIcon,groupHdr=$("optgroup",elm).length&&!s.group,invalid=[],origValues=[],main={},roPre=s.readonly;function genValues(cont,keys,values){$("option",cont).each(function(){values.push(this.text);keys.push(this.value);if(this.disabled){invalid.push(this.value)}})}function genWheels(){var cont,wheel,wg=0,values=[],keys=[],w=[[]];if(s.group){$("optgroup",elm).each(function(i){values.push(this.label);keys.push(i)});wheel={values:values,keys:keys,label:s.groupLabel};if(isLiquid){w[0][wg]=wheel}else{w[wg]=[wheel]}cont=group;wg++}else{cont=elm}values=[];keys=[];if(groupHdr){$("optgroup",elm).each(function(i){values.push(this.label);keys.push("__group"+i);invalid.push("__group"+i);genValues(this,keys,values)})}else{genValues(cont,keys,values)}wheel={multiple:multiple,values:values,keys:keys,label:label};if(isLiquid){w[0][wg]=wheel}else{w[wg]=[wheel]}return w}function getOption(v){var def=$("option",elm).attr("value");option=multiple?(v?v[0]:def):(v===undefined||v===null?def:v);if(s.group){group=elm.find('option[value="'+option+'"]').parent();gr=group.index()}}function setVal(v,fill,change){var value=[];if(multiple){var sel=[],i=0;for(i in inst._selectedValues){sel.push(main[i]);value.push(i)}input.val(sel.join(", "))}else{input.val(v);value=fill?inst.temp[optIdx]:null}if(fill){elm.val(value);if(change){prevent=true;elm.change()}}}function onTap(li){var val=li.attr("data-val"),selected=li.hasClass("dw-msel");if(multiple&&li.closest(".dwwl").hasClass("dwwms")){if(li.hasClass("dw-v")){if(selected){li.removeClass(selectedClass).removeAttr("aria-selected");delete inst._selectedValues[val]}else{li.addClass(selectedClass).attr("aria-selected","true");inst._selectedValues[val]=val}if(inst.live){setVal(val,true,true)}}return false}}if(s.group&&!$("optgroup",elm).length){s.group=false}if(!s.invalid.length){s.invalid=invalid}if(s.group){grIdx=0;optIdx=1}else{grIdx=-1;optIdx=0}$("option",elm).each(function(){main[this.value]=this.text});getOption(elm.val());$("#"+id).remove();input=$('');if(s.showInput){input.insertBefore(elm)}inst.attachShow(input);var v=elm.val()||[],i=0;for(i;i12?(h-12):(h===0?12:h)),2);break;case"H":output+=f1("H",date.getHours(),2);break;case"i":output+=f1("i",date.getMinutes(),2);break;case"s":output+=f1("s",date.getSeconds(),2);break;case"a":output+=date.getHours()>11?s.pmText:s.amText;break;case"A":output+=date.getHours()>11?s.pmText.toUpperCase():s.amText.toUpperCase();break;case"'":if(look("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(i)}}}return output},parseDate:function(format,value,settings){var s=$.extend({},ms.datetime.defaults,settings),def=s.defaultValue||new Date();if(!format||!value){return def}if(value.getTime){return value}value=(typeof value=="object"?value.toString():value+"");var shortYearCutoff=s.shortYearCutoff,year=s.getYear(def),month=s.getMonth(def)+1,day=s.getDay(def),doy=-1,hours=def.getHours(),minutes=def.getMinutes(),seconds=0,ampm=-1,literal=false,lookAhead=function(match){var matches=(iFormat+1-1){month=1;day=doy;do{var dim=32-new Date(year,month-1,32).getDate();if(day<=dim){break}month++;day-=dim}while(true)}hours=(ampm==-1)?hours:((ampm&&hours<12)?(hours+12):(!ampm&&hours==12?0:hours));var date=s.getDate(year,month-1,day,hours,minutes,seconds);if(s.getYear(date)!=year||s.getMonth(date)+1!=month||s.getDay(date)!=day){return def}return date}};ms.formatDate=ms.datetime.formatDate;ms.parseDate=ms.datetime.parseDate})(jQuery);(function($,undefined){var ms=$.mobiscroll,datetime=ms.datetime,date=new Date(),defaults={startYear:date.getFullYear()-100,endYear:date.getFullYear()+1,showNow:false,stepHour:1,stepMinute:1,stepSecond:1,separator:" ",dateFormat:"mm/dd/yy",dateOrder:"mmddy",timeWheels:"hhiiA",timeFormat:"hh:ii A",dayText:"Day",yearText:"Year",hourText:"Hours",minuteText:"Minutes",ampmText:" ",secText:"Seconds",nowText:"Now"},preset=function(inst){var that=$(this),html5def={},format;if(that.is("input")){switch(that.attr("type")){case"date":format="yy-mm-dd";break;case"datetime":format="yy-mm-ddTHH:ii:ssZ";break;case"datetime-local":format="yy-mm-ddTHH:ii:ss";break;case"month":format="yy-mm";html5def.dateOrder="mmyy";break;case"time":format="HH:ii:ss";break}var min=that.attr("min"),max=that.attr("max");if(min){html5def.minDate=datetime.parseDate(format,min)}if(max){html5def.maxDate=datetime.parseDate(format,max)}}var i,k,keys,values,wg,start,end,hasTime,mins,maxs,orig=$.extend({},inst.settings),s=$.extend(inst.settings,ms.datetime.defaults,defaults,html5def,orig),offset=0,validValues=[],wheels=[],ord=[],o={},f={y:getYear,m:getMonth,d:getDay,h:getHour,i:getMinute,s:getSecond,a:getAmPm},invalid=s.invalid,valid=s.valid,p=s.preset,dord=s.dateOrder,tord=s.timeWheels,regen=dord.match(/D/),ampm=tord.match(/a/i),hampm=tord.match(/h/),hformat=p=="datetime"?s.dateFormat+s.separator+s.timeFormat:p=="time"?s.timeFormat:s.dateFormat,defd=new Date(),stepH=s.stepHour,stepM=s.stepMinute,stepS=s.stepSecond,mind=s.minDate||new Date(s.startYear,0,1),maxd=s.maxDate||new Date(s.endYear,11,31,23,59,59),minH=mind.getHours()%stepH,minM=mind.getMinutes()%stepM,minS=mind.getSeconds()%stepS,maxH=getMax(stepH,minH,(hampm?11:23)),maxM=getMax(stepM,minM,59),maxS=getMax(stepM,minM,59); format=format||hformat;if(p.match(/date/i)){$.each(["y","m","d"],function(j,v){i=dord.search(new RegExp(v,"i"));if(i>-1){ord.push({o:i,v:v})}});ord.sort(function(a,b){return a.o>b.o?1:-1});$.each(ord,function(i,v){o[v.v]=i});wg=[];for(k=0;k<3;k++){if(k==o.y){offset++;values=[];keys=[];start=s.getYear(mind);end=s.getYear(maxd);for(i=start;i<=end;i++){keys.push(i);values.push((dord.match(/yy/i)?i:(i+"").substr(2,2))+(s.yearSuffix||""))}addWheel(wg,keys,values,s.yearText)}else{if(k==o.m){offset++;values=[];keys=[];for(i=0;i<12;i++){var str=dord.replace(/[dy]/gi,"").replace(/mm/,(i<9?"0"+(i+1):i+1)+(s.monthSuffix||"")).replace(/m/,i+1+(s.monthSuffix||""));keys.push(i);values.push(str.match(/MM/)?str.replace(/MM/,''+s.monthNames[i]+""):str.replace(/M/,''+s.monthNamesShort[i]+""))}addWheel(wg,keys,values,s.monthText)}else{if(k==o.d){offset++;values=[];keys=[];for(i=1;i<32;i++){keys.push(i);values.push((dord.match(/dd/i)&&i<10?"0"+i:i)+(s.daySuffix||""))}addWheel(wg,keys,values,s.dayText)}}}}wheels.push(wg)}if(p.match(/time/i)){hasTime=true;ord=[];$.each(["h","i","s","a"],function(i,v){i=tord.search(new RegExp(v,"i"));if(i>-1){ord.push({o:i,v:v})}});ord.sort(function(a,b){return a.o>b.o?1:-1});$.each(ord,function(i,v){o[v.v]=offset+i});wg=[];for(k=offset;k=12?hour-12:hour;return step(hour,stepH,minH,maxH)}function getMinute(d){return step(d.getMinutes(),stepM,minM,maxM)}function getSecond(d){return step(d.getSeconds(),stepS,minS,maxS)}function getAmPm(d){return ampm&&d.getHours()>11?1:0}function getDate(d){if(d===null){return d}var hour=get(d,"h",0);return s.getDate(get(d,"y"),get(d,"m"),get(d,"d"),get(d,"a",0)?hour+12:hour,get(d,"i",0),get(d,"s",0))}function getMax(step,min,max){return Math.floor((max-min)/step)*step+min}function getClosestValidDate(d,dir){var next,prev,nextValid=false,prevValid=false,up=0,down=0;if(isValid(d)){return d}if(dmaxd){d=maxd}next=d;prev=d;if(dir!==2){nextValid=isValid(next);while(!nextValid&&nextmind){prev=new Date(prev.getTime()-1000*60*60*24);prevValid=isValid(prev);down++}}if(dir===1&&nextValid){return next}if(dir===2&&prevValid){return prev}return downmaxd){return false}if(isInObj(d,valid)){return true}if(isInObj(d,invalid)){return false}return true}function isInObj(d,obj){var curr,j,v;if(obj){for(j=0;j=0){idx[k]=val}}}}}}}}function validateTimes(vobj,i,v,temp,y,m,d,target,valid){var dd,ss,str,parts1,parts2,prop1,prop2,v1,v2,j,i1,i2,add,remove,all,hours1,hours2,hours3,spec={},steps={h:stepH,i:stepM,s:stepS,a:1},day=s.getDate(y,m,d),w=["a","h","i","s"];if(vobj){$.each(vobj,function(i,obj){if(obj.start){obj.apply=false;dd=obj.d;ss=dd+"";str=ss.split("/");if(dd&&((dd.getTime&&y==s.getYear(dd)&&m==s.getMonth(dd)&&d==s.getDay(dd))||(!ss.match(/w/i)&&((str[1]&&d==str[1]&&m==str[0]-1)||(!str[1]&&d==str[0])))||(ss.match(/w/i)&&day.getDay()==+ss.replace("w","")))){obj.apply=true; spec[day]=true}}});$.each(vobj,function(x,obj){add=0;remove=0;i1=0;i2=undefined;prop1=true;prop2=true;all=false;if(obj.start&&(obj.apply||(!obj.d&&!spec[day]))){parts1=obj.start.split(":");parts2=obj.end.split(":");for(j=0;j<3;j++){if(parts1[j]===undefined){parts1[j]=0}if(parts2[j]===undefined){parts2[j]=59}parts1[j]=+parts1[j];parts2[j]=+parts2[j]}parts1.unshift(parts1[0]>11?1:0);parts2.unshift(parts2[0]>11?1:0);if(hampm){if(parts1[1]>=12){parts1[1]=parts1[1]-12}if(parts2[1]>=12){parts2[1]=parts2[1]-12}}for(j=0;j0){add=steps[v]}if(parts2[j]max){return $(".dw-li",t).length}return getIndex(t,v)+add}function getArray(d){var i,ret=[];if(d===null||d===undefined){return d}for(i in o){ret[o[i]]=f[i](d)}return ret}function convertRanges(arr){var i,v,start,ret=[];if(arr){for(i=0;i'+s.dayNames[w]+""):str.replace(/D/,''+s.dayNamesShort[w]+""))})}}if(minprop&&mind){min=f[i](mind)}if(maxprop&&maxd){max=f[i](maxd)}if(i!="y"){var i1=getIndex(t,min),i2=getIndex(t,max);$(".dw-li",t).removeClass("dw-v").slice(i1,i2+1).addClass("dw-v");if(i=="d"){$(".dw-li",t).removeClass("dw-h").slice(maxdays).addClass("dw-h")}}if(valmax){val=max}if(minprop){minprop=val==min}if(maxprop){maxprop=val==max}if(i=="d"){var first=s.getDate(y,m,1).getDay(),idx={};validateDates(invalid,y,m,first,maxdays,idx,1);validateDates(valid,y,m,first,maxdays,idx,0);$.each(idx,function(i,v){if(v){$(".dw-li",t).eq(i).removeClass("dw-v")}})}}});if(hasTime){$.each(["a","h","i","s"],function(i,v){var val=get(temp,v),d=get(temp,"d"),t=$(".dw-ul",dw).eq(o[v]);if(o[v]!==undefined){validateTimes(invalid,i,v,temp,y,m,d,t,0);validateTimes(valid,i,v,temp,y,m,d,t,1);validValues[i]=+inst.getValidCell(val,t,dir).val}})}inst.temp=temp}}};$.each(["date","time","datetime"],function(i,v){ms.presets.scroller[v]=preset;ms.presetShort(v)})})(jQuery);(function($){$.mobiscroll.themes["sense-ui"]={btnStartClass:"mbsc-ic mbsc-ic-play3",btnStopClass:"mbsc-ic mbsc-ic-pause2",btnResetClass:"mbsc-ic mbsc-ic-stop2",btnLapClass:"mbsc-ic mbsc-ic-loop2"} })(jQuery);(function($){var themes=$.mobiscroll.themes,theme={dateOrder:"Mddyy",rows:5,minWidth:76,height:36,showLabel:false,selectedLineHeight:true,selectedLineBorder:2,useShortLabels:true,icon:{filled:"star3",empty:"star"},btnPlusClass:"mbsc-ic mbsc-ic-arrow-down6",btnMinusClass:"mbsc-ic mbsc-ic-arrow-up6",onThemeLoad:function(lang,s){if(s.theme){s.theme=s.theme.replace("android-ics","android-holo").replace(" light","-light")}},onMarkupReady:function(markup){markup.addClass("mbsc-android-holo")}};themes["android-holo"]=theme;themes["android-holo-light"]=theme;themes["android-ics"]=theme;themes["android-ics light"]=theme;themes["android-holo light"]=theme})(jQuery);