text: FJ.define("widget.Calendar",["widget.DragDrop","widget.Tooltip"],function(){var d,c,a=d=c=this.flareJ,b=this.jQuery;this.CalendarJ=this.CDRJ=d.CalendarJ=d.CDRJ=d.CJ.extend({init:function(e,f){this._super(e,b.extend(true,{fjType:"CDRJ",renderTo:e,width:370,height:270,hasMonthE:true,showMoreDay:true,dateFormat:"yyyy-mm-dd",dateInit:d.Date.toFormatString(new Date(),"yyyy-mm-dd"),isTimeInit:true,dayColor:[],hasGradient:false,borderWidth:0,menuSpeed:d.isIElt9?1:100,isShowWatermark:true,isShowToday:false,isShowSelectYear:true,isShowTimePicker:false,fontFamily:"宋体",fontSizeMonth:13,fontSizeMonthE:18,fontSizeBody:12,headPaddingH:c.isIE7?0:4,weekPaddingH:0,bodyPaddingH:0,cdrheadHeight:35,bodyShiftH:67,menuShiftT:7,dateRange:null,hasDayTitle:true,inSameMonth:function(l,k){var h=l.split("-"),g=k.split("-"),j=false;if(h[0]==g[0]&&h[1]==g[1]){j=true}return j},colorParams:{borderOut:null,bgColor:null,bgColor1:null,bgColor2:null,headerBackColor:null,headerFontColor:null,menuOverColor:null,bodyBarBackColor:null,bodyBarFontColor:null,bodyFontColor:null,bodyHolidayFontColor:null,borderDay:"#868686",watermarkColor:null,moreDayColor:null},evts:{clickDay:null,getDayColor:null,afterBindDate:null,leaveTimePicker:null}},f));this.date=null;this.timer=null;this.initFn();return this},initFn:function(){var e=this;this._super();this.dateSelect=this.p.dateInit;this.create();if(c.isMobile){this.cdrBodyOut.onGestureJ(c.Evt.click,function(h,g){g.evt.stopPropagation();var f=b(g.evt.target);if(f.hasClass("fj-tap-elem")){c.lazyDo(function(){f.trigger(c.Evt.customClick)})}},{tapHoverCls:"cdrj-tap",tapHoverElem:"tap"});this.cdrMenu.on("touchend",function(f){f.stopPropagation()})}this.show()},create:function(){this._super();var g=this;this.divOut.addClass("cdrj").attr("id","CalendarJ"+this.objId).css({height:d.isWebkit?g.p.height-4:g.p.height});this.divOut.addClass("cdrj_bg").css({borderWidth:1});if(this.p.hasGradient){if(c.isIElt9){this.filterBg=b('<div class="cdrj_filterBg"></div>');this.divOut.append(this.filterBg)}else{if(c.isOpera||d.isIEgt9){this.svgBg=b('<div class="cdrj_svgBg"></div>');this.divOut.css({borderRadius:"5px"}).append(this.svgBg)}else{if(c.isFF){this.divOut.addClass("cdrj_bg_ff")}else{if(c.isWebkit){this.divOut.addClass("cdrj_bg_wk")}}}}}else{this.divOut.addClass("cdrj_bg_img")}this.cdrWmYear=b('<div class="cj_divCvFd3" >2010</div>');this.cdrWatermark=(b('<div class="cdrj_watermark cj_divCvFd1"></div>').css({height:this.p.height+"px"}).append(b('<div class="cj_divCvFd2"></div>').append(this.cdrWmYear)));if(this.p.colorParams.watermarkColor){this.cdrWatermark.css("color",this.p.colorParams.watermarkColor)}if(!this.p.isShowWatermark){this.cdrWatermark.hide()}this.cdrBodyOut=b('<div class="cdrj_bodyOut"></div>');this.cdrMenu=b('<div style="position:absolute;z-index:10;left:0px;top:0px;display:none;" ></div>').hover(function(){g.showMenu(null,true)},function(){g.hideMenu()});this.divOut.append(this.cdrWatermark).append(this.cdrBodyOut.append(this.getHeader()).append(this.getBodyBar()).append(this.getBody()).append(this.getBodyToday())).append(this.cdrMenu);if(this.p.isShowTimePicker){this.timePicker=b('<div class="cdrj_timePicker"></div>');this.time=this.p.isTimeInit?c.Date.toFormatString(new Date(),"hh:MM:ss"):"00:00:00";this.timePos=2;var j=function(){if(g.currentInput){var n=g.currentInput.val();if(d.RX.datetime(n)){var o=n.split(" ")[0];g.currentInput.val(o+" "+g.time)}}};this.timeInput=b('<input class="cdrj_timeInput" type="text" value="'+this.time+'" />');this.timeInput.click(function(){var n=g.timeInput.textPositionJ();switch(n){case 0:case 1:case 2:g.timeInput.selectRangeJ(0,2);g.timePos=0;break;case 3:case 4:case 5:g.timeInput.selectRangeJ(3,5);g.timePos=1;break;case 6:case 7:case 8:g.timeInput.selectRangeJ(6,8);g.timePos=2;break}}).bind("change",function(){var o=g.timeInput.val();if(!d.RX.time(o)){g.timeInput.val(g.time)}else{var q=parseFloat(o.substr(0,2));var n=parseFloat(o.substr(3,2));var p=parseFloat(o.substr(6,2));if(q>=0&&q<=23&&n>=0&&n<=59&&p>=0&&p<=59){g.time=o}else{g.timeInput.val(g.time)}}}).bind("mouseleave",function(){g.timeInput.trigger("change");j();g.fire("leaveTimePicker",{time:g.time})});var m=b('<div class="cdrj_timeDiv"></div>');var l=b('<input class="cdrj_timeBtn" type="button" />');var h=function(){b(this).removeClass("cdrj_timeBtnLeave").addClass("cdrj_timeBtnHover")};var e=function(){b(this).removeClass("cdrj_timeBtnHover").addClass("cdrj_timeBtnLeave")};var f=function(){var q=b(this).attr("bNum");var o=g.timeInput.val();var p=0;switch(g.timePos){case 0:p=parseFloat(o.substr(0,2));break;case 1:p=parseFloat(o.substr(3,2));break;case 2:p=parseFloat(o.substr(6,2));break}if(q==1){p+=1}else{p-=1}switch(g.timePos){case 0:if(p>23){p=0}else{if(p<0){p=23}}break;case 1:case 2:if(p>59){p=0}else{if(p<0){p=59}}break}switch(g.timePos){case 0:g.time=d.Math.addZero(p)+o.substr(2,6);g.timeInput.val(g.time);g.timeInput.selectRangeJ(0,2);break;case 1:g.time=o.substr(0,3)+d.Math.addZero(p)+o.substr(5,3);g.timeInput.val(g.time);g.timeInput.selectRangeJ(3,5);break;case 2:g.time=o.substr(0,6)+d.Math.addZero(p);g.timeInput.val(g.time);g.timeInput.selectRangeJ(6,8);break}j()};l.css({backgroundImage:"url("+d.CDRJ.imgFolderSrc+"spinner_arrow_up.gif)",backgroundRepeat:"no-repeat",backgroundPosition:"5px 1px"});var k=l.clone().css({backgroundImage:"url("+d.CDRJ.imgFolderSrc+"spinner_arrow_down.gif)",backgroundRepeat:"no-repeat",backgroundPosition:"5px 1px"}).attr("bNum","2").hover(h,e).click(f);l.attr("bNum","1").hover(h,e).click(f);m.append(l).append(k);this.divOut.append(this.timePicker.append("<img src='"+d.CDRJ.imgFolderSrc+"time.gif' />").append(this.timeInput).append(m))}this.cdrHeader.find("td").css({fontFamily:this.p.fontFamily,fontSize:this.p.fontSizeMonth+"px"});this.cdrHeader.find("td.currentMonthE").css((function(){var n={fontSize:g.p.fontSizeMonthE+"px"};if(d.isChrome){n.textAlign="left"}return n})());this.divOut.find(".cdrj_bodyBar span,.cdrj_bodyBar td,.cdrj_body td").css({fontFamily:this.p.fontFamily,fontSize:this.p.fontSizeBody+"px"});return this},show:function(){this._super();this.bindDate(this.p.dateInit);return this},getHeader:function(){var e=this;this.cdrHeader=b('<table class="cdrj_header" cellSpacing="2" ></table>');this.cdrHeader.css({width:(this.p.width-this.p.headPaddingH*2)+"px",height:this.p.cdrheadHeight+"px"});if(this.p.colorParams.headerBackColor){this.cdrHeader.css("background-color",this.p.colorParams.headerBackColor)}if(this.p.colorParams.headerFontColor){this.cdrHeader.css("color",this.p.colorParams.headerFontColor)}var f=b('<tr align="center"></tr>');this.previousYear=b('<td class="cdrj-previousYear" title="上一年份" style="cursor:pointer;width:10px;" ></td>').on(c.Evt.customClick,function(){e.onChangeYear(false)});var h=b("<div class='cdrj-head-btn"+(c.isMobile?"":" fj-pc")+" icon-chevron-left fj-tap-elem'></div>").on(c.Evt.customClick,function(l){l.stopPropagation();e.onChangeYear(false)});this.previousYear.append(h);this.previousMonth=b('<td class="cdrj-previousMonth" title="上一月份" style="cursor:pointer;width:10px;" ></td>');var j=b("<div class='cdrj-head-btn"+(c.isMobile?"":" fj-pc")+" icon-chevron-left fj-tap-elem'></div>").on(c.Evt.customClick,function(l){l.stopPropagation();e.onChangeMonth(false)});this.previousMonth.append(j);this.previousMonth.on(c.Evt.customClick,function(){e.onChangeMonth(false)});this.currentYear=b('<td class="cdrj-currentYear fj-tap-elem" style="width:90px;cursor:pointer;" >0</td>').on(c.Evt.customClick,function(){e.showMenu(true)}).on("mouseout",function(){e.hideMenu()});this.currentMonth=b('<td class="cdrj-currentMonth fj-tap-elem" style="width:70px;cursor:pointer;" >0</td>').on(c.Evt.customClick,function(){e.showMenu(false)}).on("mouseout",function(){e.hideMenu()});this.currentMonthE=b('<td class="currentMonthE" style="width:100px;" >September</td>');this.nextMonth=b('<td class="cdrj-nextMonth" title="下一月份" style="cursor:pointer;width:10px;" ></td>');var g=b("<div class='cdrj-head-btn"+(c.isMobile?"":" fj-pc")+" icon-chevron-right fj-tap-elem'></div>").on(c.Evt.customClick,function(l){l.stopPropagation();e.onChangeMonth(true)});this.nextMonth.append(g);this.nextMonth.on(c.Evt.customClick,function(){e.onChangeMonth(true)});this.nextYear=b('<td class="cdrj-nextYear" title="下一年份" style="cursor:pointer;width:10px;" ></td>').on(c.Evt.customClick,function(){e.onChangeYear(true)});var k=b("<div class='cdrj-head-btn"+(c.isMobile?"":" fj-pc")+" icon-chevron-right fj-tap-elem'></div>").on(c.Evt.customClick,function(l){l.stopPropagation();e.onChangeYear(true)});this.nextYear.append(k);this.cdrHeader.append(f.append(this.previousYear).append(this.currentYear).append(this.nextYear).append((function(){if(e.p.hasMonthE){return e.currentMonthE}else{return null}})).append(this.previousMonth).append(this.currentMonth).append(this.nextMonth));if(!this.p.isShowSelectYear){this.previousYear.hide();this.nextYear.hide()}return this.cdrHeader},getBodyBar:function(){this.cdrBodyBar=b('<table class="cdrj_bodyBar" cellSpacing="2" cellPadding="0"></table>');this.cdrBodyBar.css({width:(this.p.width-this.p.weekPaddingH*2)+"px"});if(this.p.colorParams.bodyBarBackColor){this.cdrBodyBar.css("background-color",this.p.colorParams.bodyBarBackColor)}if(this.p.colorParams.bodyBarFontColor){this.cdrBodyBar.css("color",this.p.colorParams.bodyBarFontColor)}var f=b('<tr align="center"></tr>');var e=['<span class="cdrj_holiday" '+(this.p.colorParams.bodyHolidayFontColor?('style="color:'+this.p.colorParams.bodyHolidayFontColor)+'"':"")+" >日</span>","一","二","三","四","五",'<span class="cdrj_holiday" '+(this.p.colorParams.bodyHolidayFontColor?('style="color:'+this.p.colorParams.bodyHolidayFontColor)+'"':"")+" >六</span>"];for(i=0;i<7;i++){f.append("<td >"+e[i]+"</td>")}this.cdrBodyBar.append(f);return this.cdrBodyBar},getBody:function(){var h=0,g;this.cdrBody=b('<table class="cdrj_body" cellSpacing="2" cellPadding="0"></table>');this.cdrBody.css({width:(this.p.width-this.p.bodyPaddingH*2)+"px",height:(this.p.height-this.p.bodyShiftH)+"px",borderCollapse:"separate",borderSpacing:"2px"});if(this.p.colorParams.bodyFontColor){this.cdrBody.css("color",this.p.colorParams.bodyFontColor)}this.cdrDay=[];for(var f=0;f<6;f++){g=b('<tr align="center"></tr>');for(var e=0;e<7;e++){this.cdrDay[h]=b('<td class="cdrj_dayOut" width="13%"></td>');g.append(this.cdrDay[h]);h++}this.cdrBody.append(g)}return this.cdrBody},getBodyToday:function(){var f=this;this.cdrBodyToday=b('<table class="cdrj_bodyBar" style="" cellSpacing="2" cellPadding="0"></table>');if(!this.p.isShowToday){this.cdrBodyToday.hide()}var e=b('<tr align="center" ></tr>');this.cdrTodayBtn=b('<td style="cursor:pointer;" >今天：'+d.Date.toFormatString(new Date(),"yyyy年mm月dd日")+"</td>").bind("click",function(){f.getToday()});this.cdrBodyToday.append(e.append(this.cdrTodayBtn));return this.cdrBodyToday},showMenu:function(g,e){if(this.timer){clearTimeout(this.timer)}if(g!=null){var f=g?this.currentYear:this.currentMonth;if(g){this.getYearMenu(this.date.getFullYear()-5)}else{this.getMonthMenu()}this.cdrMenu.css({top:f[0].offsetTop+f[0].offsetHeight-this.p.menuShiftT,left:f[0].offsetLeft+this.p.headPaddingH,width:f[0].offsetWidth})}if(!e){if(this.p.menuSpeed>1){this.cdrMenu.stop().css({opacity:0}).show().animate({opacity:0.95},this.p.menuSpeed)}else{this.cdrMenu.show()}}else{this.cdrMenu.show()}},hideMenu:function(){var e=this;this.timer=window.setTimeout(function(){if(e.p.menuSpeed>1){e.cdrMenu.stop().animate({opacity:0},e.p.menuSpeed,function(){e.cdrMenu.hide()})}else{e.cdrMenu.hide()}},500)},getYearMenu:function(n){var j=this;this.yearMenu=b('<table cellSpacing="0" class="cdrj_Menu" cellPadding="0"></table>');var m="",o,k;for(var g=1;g<=10;g++){var h=n+g;var q=new Date(h,this.date.getMonth(),this.date.getDate());o=b('<tr align="center" ></tr>');m="<td ";if(this.date.getFullYear()!=h){m+="onmouseover=\"this.className='cdrj_menuOver'\" onmouseout=\"this.className=''\" "}else{m+='class="cdrj_menuOver"'}m+=">"+h+"年</td>";k=b(m);(function(r){k.bind("click",function(){j.bindDate(d.Date.toFormatString(r,"-"))})})(q);this.yearMenu.append(o.append(k))}var f=b('<tr align="center"></tr>');var p=b("<td></td>");var l=b('<table style="font-size:12px;width:100%;" cellSpacing="0" cellPadding="0"></table>');var e=b('<tr class="cdrj-year-menu-nav"></tr>');this.btnSubYear=b('<td style="height:20px;" onmouseover="this.className=\'cdrj_menuOver\'" onmouseout="this.className=\'\'" ><i class="icon-double-angle-left"></i></td>').bind("click",function(){j.getYearMenu(n-10)});this.btnAddYear=b('<td onmouseover="this.className=\'cdrj_menuOver\'" onmouseout="this.className=\'\'" ><i class="icon-double-angle-right"></i></td>').bind("click",function(){j.getYearMenu(n+10)});this.yearMenu.append(f.append(p.append(l.append(e.append(this.btnSubYear).append(this.btnAddYear)))));this.cdrMenu.html(this.yearMenu)},getMonthMenu:function(){var j=this;this.monthMenu=b('<table cellSpacing="0" class="cdrj_Menu" cellPadding="0"></table>');var l="",h,k;for(var g=1;g<=12;g++){var f=this.date.getDate();if(g==2){f=28}var e=new Date(this.date.getFullYear(),g-1,f);h=b('<tr align="center"></tr>');l="<td ";if(this.date.getMonth()+1!=g){l+="onmouseover=\"this.className='cdrj_menuOver'\" onmouseout=\"this.className=''\" "}else{l+='class="cdrj_menuOver"'}l+=">"+g+"月</td>";k=b(l);(function(m){k.bind("click",function(){j.bindDate(d.Date.toFormatString(m,"-"))})})(e);this.monthMenu.append(h.append(k))}this.cdrMenu.html(this.monthMenu)},onChangeYear:function(h){var g=this.date.getFullYear();var f=this.date.getMonth()+1;var e=this.date.getDate();if(g>999&&g<10000){if(h){g++}else{g--}}else{alert("年份超出范围（1000-9999）!")}this.bindDate(g+"-"+f+"-"+e)},onChangeMonth:function(h){var g=this.date.getFullYear();var f=this.date.getMonth()+1;var e=this.date.getDate();if(h){f++}else{f--}if(g>999&&g<10000){if(f<1){f=12;g--}if(f>12){f=1;g++}}else{alert("年份超出范围（1000-9999）!")}if(f==2){e=28}this.bindDate(g+"-"+f+"-"+e)},bindDate:function(z){var B=this;this.dateM=z;this.fire("getDayColor",{date:z});var g=[31,30,31,30,31,30,31,31,30,31,30,31];var j=z.replace(/[^\d]/ig,"-").replace(/^\-|\-$/ig,"").split("-");var q=new Date(j[0],j[1]-1,j[2]);if(isNaN(q)){q=new Date()}this.date=q;this.bindHeader();var h=q.getFullYear();var p=q.getMonth();var A=1;var y=new Date();var n=y.getMonth();var w=y.getFullYear();var u=new Date(h,p,1).getDay();var v=p==0?h-1:h;var m=p==0?11:p-1;var t=g[m];if(m==1){t=((v%4==0)&&(v%100!=0)||(v%400==0))?29:28}t-=u-1;var s=1;g[1]=((h%4==0)&&(h%100!=0)||(h%400==0))?29:28;for(i=0;i<42;i++){var e=this.cdrDay[i],l=null;e.css({backgroundColor:"transparent"}).removeClass("hasColor_"+this.objId+" cdrj_currentDay").attr("date","");e.unbind("mouseover").bind("mouseover",function(){B.onMouseOver(this)}).unbind("mouseout").bind("mouseout",function(){B.onMouseOut(this)});this.onMouseOut(e[0]);e.css("color","");if(i<u){if(this.p.showMoreDay){var f=new Date(h,p-1,t);l=b("<div class='cdrj-day-bg fj-tap-elem'>"+t+"</div>");e.html(l).removeClass("cdrj_normalDay cdrj_normalDayN cdrj_normalDayS");if(this.p.hasDayTitle){e.attr("title",d.Date.toFormatString(f,"yyyy年mm月dd日"))}var k=d.Date.toFormatString(f,this.p.dateFormat);e.attr("value",k);e.addClass("cdrj_moreDay");if(this.p.colorParams.moreDayColor){e.css("color",this.p.colorParams.moreDayColor)}this.setDayColor(f,e,t);if(k==this.dateSelect){this.setDaySelect(k,e)}t++}else{e.html("");e.attr("title","")}}else{if(A>g[p]){if(this.p.showMoreDay){var r=new Date(h,p+1,s);l=b("<div class='cdrj-day-bg fj-tap-elem'>"+s+"</div>");e.html(l).removeClass("cdrj_normalDay cdrj_normalDayN cdrj_normalDayS");if(this.p.hasDayTitle){e.attr("title",d.Date.toFormatString(r,"yyyy年mm月dd日"))}var k=d.Date.toFormatString(r,this.p.dateFormat);e.attr("value",k);e.addClass("cdrj_moreDay");if(this.p.colorParams.moreDayColor){e.css("color",this.p.colorParams.moreDayColor)}this.setDayColor(r,e,s);if(k==this.dateSelect){this.setDaySelect(k,e)}s++}else{e.html("");e.attr("title","")}}else{if(i>=new Date(h,p,1).getDay()&&A<=g[p]){l=b("<div class='cdrj-day-bg fj-tap-elem'>"+A+"</div>");e.html(l).removeClass("cdrj_moreDay cdrj_normalDayN cdrj_normalDayS");var x="";if(A==new Date().getDate()){if(p==n&&h==w){e.addClass("cdrj_currentDay");x="今天:"}}else{e.removeClass("cdrj_currentDay")}if(this.isHoliday(h,p,A)){if(this.p.colorParams.bodyHolidayFontColor){e.css("color",this.p.colorParams.bodyHolidayFontColor)}else{e.addClass("cdrj_holiday")}}var o=new Date(h,p,A);if(this.p.hasDayTitle){e.attr("title",x+d.Date.toFormatString(o,"yyyy年mm月dd日"))}var k=d.Date.toFormatString(o,this.p.dateFormat);e.attr("value",k);e.addClass("cdrj_normalDay");this.setDayColor(this.date,e,A);if(k==this.dateSelect){this.setDaySelect(k,e)}A++}else{e.html("");e.attr("title","")}}}if(l){l.on(c.Evt.customClick,function(){B.onClick(this)})}}this.cdrMenu.hide();this.p.dayColor=[];this.fire("afterBindDate",{date:z})},bindHeader:function(){this.currentYear.text(d.Date.toFormatString(this.date,"yyyy年"));var e=d.Date.toFormatString(this.date,"mm",true);this.currentMonth.text(e+"月");this.cdrWmYear.text(this.date.getFullYear());if(this.p.hasMonthE){switch(e){case"1":this.currentMonthE.text("January");break;case"2":this.currentMonthE.text("February");break;case"3":this.currentMonthE.text("March");break;case"4":this.currentMonthE.text("April");break;case"5":this.currentMonthE.text("May");break;case"6":this.currentMonthE.text("June");break;case"7":this.currentMonthE.text("July");break;case"8":this.currentMonthE.text("August");break;case"9":this.currentMonthE.text("September");break;case"10":this.currentMonthE.text("October");break;case"11":this.currentMonthE.text("November");break;case"12":this.currentMonthE.text("December");break}}},onClick:function(l,f){if(l.innerHTML!=""){if(this.p.isShowTimePicker){this.timeInput.blur()}var n=f?b(l):b(l).parent(),j=n.attr("value"),m=n.hasClass("hasColor_"+this.objId),q=true,h=this.p.dateRange,g=true;this.gtLimit=false;if(h){if((h[0]!=null&&c.Date.dateDiff(j,c.Date.parse(h[0]))<0)||(h[1]!=null&&c.Date.dateDiff(j,c.Date.parse(h[1]))>0)){q=false}}if(this.p.verifyGt){var o=this.ttj.currentObj.attr("dpjType"),e,k;if(o=="start"){e=j;k=this.endElem.val()}else{if(o=="end"){e=this.startElem.val();k=j}}if(c.RX.datetimeO(e)&&c.RX.datetimeO(k)){g=(k>=e);if(g&&this.p.limitDays){var p=c.Date.dateDiff(k,e);if(p>this.p.limitDays){this.gtLimit=true}}}}this.setDaySelect(j);this.fire("clickDay",{date:j,time:this.time,inRange:q,hasColor:m,dayElement:n,endGtStart:g,gtLimit:this.gtLimit})}},selectDate:function(f,j){for(var g=0,e=this.cdrDay.length;g<e;g++){var h=this.cdrDay[g];if(f==h.attr("value")){if(j){return h}this.onClick(h[0],true);break}}},changeDrawTheme:function(e){},refresh:function(e){this.bindDate(e!=null?e:c.Date.toFormatString(this.date,"-"))},setDayColor:function(g,h,e){for(var f=0;f<this.p.dayColor.length;f++){var k=this.p.dayColor[f];if(k.date==c.Date.toFormatString(g,"yyyy-mm-")+c.Math.addZero(e)){if(k.borderColor){h.css("border-color",k.borderColor)}h.css({backgroundColor:k.color,color:k.fontColor}).addClass("hasColor_"+this.objId).addClass("cdrj_normalDayN");for(var l in k){h.attr(l,k[l])}break}}},setDaySelect:function(e,f){this.dateSelect=e;this.cdrBody.find("td").removeClass("cdrj_normalDayS");if(!f){f=this.selectDate(e,true)}f.addClass("cdrj_normalDayS")},getToday:function(){var e=new Date();this.bindDate(d.Date.toFormatString(e,"-"))},isHoliday:function(g,h,f){var e=new Date(g,h,f);return(e.getDay()==6||e.getDay()==0)},onMouseOver:function(e){b(e).addClass("cdrj_normalDayH")},onMouseOut:function(e){b(e).removeClass("cdrj_normalDayH")}});d.CDRJ.show=function(e){return new d.CDRJ(d.oBody,e).show()};b.fn.extend({CalendarJ:function(e){if(this&&this.length>0){return new d.CalendarJ(this,c.CDRJ_commonConfig?b.extend(true,c.clone(c.CDRJ_commonConfig),e):e)}},CDRJ:function(e){return b(this).CalendarJ(e)}});d.CDRJ.imgFolderSrc=d.imgPath+"Calendar/";this.DatePickerJ=this.DPJ=d.DatePickerJ=d.DPJ=d.CalendarJ.extend({init:function(e,h){var g=this;this.ttj=b(e).TTJ(b.extend(true,{borderWidth:0,width:360,height:270,hoverDirect:"bottom",shiftLeft:10,shiftTop:20,loadType:"html",hoverType:"click",hasShadow:true,onlyFirstLoad:true,isAsync:false,loadSpeed:1,speed:1,showSpeed:d.isIElt9?1:100,isRenderHF:false,tranOrigin:"50% 0%",tranScaleShow:"scale(0.5, 0.5)",tranScaleClose:"scale(0.7, 0.7)",loadHTML:function(){g.divOut.show();return g.divOut},colorParams:{bgColorBody:"#e6e6e6",bgColor:"transparent"},overflow:"hidden",radius:5,closeCheckScroll:c.isMobile?true:false,responsive:true,responsiveParam:{"(min-width: 641px)|DPJ":{preHandler:function(j){if(!j){this.setVisible(false)}},params:{zIndex:600,onlyShiftPos:false,isFixScroll:false,tranOrigin:"50% 0%"},handler:function(){var j=this.p;if(j.shiftLeftI!=null){j.shiftLeft=j.shiftLeftI}if(j.shiftTopI!=null){j.shiftTop=j.shiftTopI}c.lazyDo(function(){j.hasDivGray=false;j.showRendorBody=false},300)}},"(max-width: 640px)|DPJ":{preHandler:function(j){if(!j){this.setVisible(false)}},params:{hasDivGray:true,zIndex:100001,showRendorBody:true,onlyShiftPos:true,isFixScroll:true,tranOrigin:"50% 50%"},handler:function(){var j=this.p;if(j.shiftLeftI==null){j.shiftLeftI=j.shiftLeft}if(j.shiftTopI==null){j.shiftTopI=j.shiftTop}j.shiftLeft=c.pageWidth()/2-j.width/2;j.shiftTop=c.pageHeight()/2-j.height/2;if(j.shiftTop<20){j.shiftTop=20}}}},evts:{afterBodyLoad:function(k,j){if(this.p.hasShadow&&!d.isIElt9){this.divOut.css("background-color","#e6e6e6")}if(g.p.isShowTimePicker){g.timePicker.css("left",g.divOut.width()/2-g.timePicker.width()/2)}},afterBodyLoad2:function(q,o){if(!(g.p.autoDate||g.p.isShowTimePicker)){return}var k=this.currentObj.val();if(g.p.autoDate){var l=g.dateM,r=g.dateSelect;if(c.RX.datetimeO(k)){var j=k.split(" ")[0];if(g.p.inSameMonth(j,l)){if(j!=r){g.setDaySelect(j)}}else{g.dateSelect=j;g.bindDate(j)}}}if(g.p.isShowTimePicker){g.currentInput=this.currentObj;if(d.RX.datetime(k)){g.time=k.split(" ")[1];g.timeInput.val(g.time)}else{var m=this.currentObj.attr("dpjType"),n=c.Date.toFormatString(new Date(),"hh:MM:ss");if(m){if(m=="start"){g.time=g.p.isTimeInit?n:"00:00:00"}else{if(m=="end"){g.time="23:59:59"}}}else{if(g.p.isTimeInit){g.time=n}}g.timeInput.val(g.time)}}},onMouseleave:function(){if(d.isIE7){g.cdrMenu.hide()}}}},h));var f=0;if(d.isWebkit){f=4}h.width=this.ttj.p.width-2;h.height=this.ttj.p.height-2+f;this._super(d.oBody,b.extend(true,{fjType:"DPJ",canDrag:true,menuSpeed:d.isIElt9?1:100,closeBySelect:true,menuShiftT:10,autoDate:false,verifyGt:false,limitDays:null,evts:{clickDay:function(l,k){var j=k.date;if(k.time){j+=" "+k.time}if(k.inRange&&k.endGtStart&&(this.ttj.currentObj.attr("type")=="text"||this.ttj.currentObj[0].tagName.toLowerCase()=="textarea")){this.ttj.currentObj.val(j).blur()}if(this.p.closeBySelect){this.ttj.closeByFocus=true;this.ttj.p.hoverSpeed=0;this.ttj.close();k.dayElement.trigger("mouseleave");this.ttj.p.hoverSpeed=777;if(c.isMobile){this.ttj.currentObj.blur()}}this.fire("clickDayP",{date:k.date,time:k.time,inRange:k.inRange,endGtStart:k.endGtStart,gtLimit:k.gtLimit});if(c.isIElt8){this.cdrMenu.hide()}}}},h));if(this.p.canDrag){this.drj=b(this.cdrBodyOut).DRJ({oRoot:this.ttj.divOut,drjCls:"dpj-drj"})}if(this.p.readOnly){this.ttj.p.obj.attr("readonly",true)}this.ttj.bodyIn.css({overflowX:"hidden",overflowY:"hidden"});if(this.p.verifyGt){e.each(function(){var k=b(this),j=k.attr("dpjType");if(j=="start"){g.startElem=k}else{if(j=="end"){g.endElem=k}}})}this.divOut.hide();return this},remove:function(){this.ttj.remove();this._super()}});b.fn.extend({DatePickerJ:function(e){if(this&&this.length>0){return new DatePickerJ(this,c.DPJ_commonConfig?b.extend(true,c.clone(c.DPJ_commonConfig),e):e)}},DPJ:function(e){return b(this).DatePickerJ(e)}})});