
iab.Init=function(k,l,m){Sdule.Mode=3;iab.instanceName=k;iab.separator="-";iab.Width=200;iab.iix=new Date();iab.today=new Date();iab.startYear=1930;iab.endYear=iab.today.getFullYear()+20;iab.oTaget=null;iab.oPreviousCell=null;iab.sDIVId=k+"_Div";iab.sTABLEId=k+"_Table";iab.sMONTHId=k+"_Month";iab.sYEARId=k+"_Year";iab.sHourId=k+"_Hour";iab.sMinuteId=k+"_Minute";iab.sSecondId=k+"_Second";iab.sTODAYBTNId=k+"_TODAYBTN";var n,sYear,sDay;n=iab.iix.getMonth();sYear=iab.iix.getFullYear();sDay=iab.iix.getDate();var o=new nzy();o.append("<div id=\""+iab.sDIVId+"\" class=\"day_main day_main_nofate day_main_min\">\n");o.append("<div class=\"day_nav settingtable\">\n");o.append("<div class=\"day_info\">\n");o.append("<div class=\"day_num\">24</div><div class=\"date-txt\">2013年5月24日 星期五</div>\n");o.append("<div></div>\n");o.append("</div>\n");o.append("<div class=\"day_calendar calendar \">\n");o.append("<div class=\"title_year\">\n");o.append("<span class=\"selecter\">\n");o.append("<a class=\"btn_pre\" href=\"javascript:void(0);\" ck=\"minCalGoMonth\" to=\"-1\" title=\"前一月\">\<span class=\"arrow_l\"></span></a>\n");o.append("<a class=\"btn_next\" href=\"javascript:void(0);\"  ck=\"minCalGoMonth\" to=\"1\" title=\"下一月\"><span class=\"arrow_r\"></span></a>\n");o.append("<span class=\"date-txt\">2013年5月</span></span>\n");o.append("</div>\n");o.append("</div>\n");o.append("<div class=\"day_calendar\">\n");o.append("<div class=\"calendar\">\n");o.append("<table id=\""+iab.sTABLEId+"_Head\" class=\" datelist\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" align=\"center\" valign=\"top\">\n");o.append("<tbody>");o.append("<tr  align=\"center\">");o.append("<th  class=\"day week_title graytext\">");o.append("<span title=\"日\">日</span></th>");o.append("<th class=\"day week_title graytext\">");o.append("<span title=\"一\">一</span></th>");o.append("<th class=\"day week_title graytext\">");o.append("<span title=\"二\">二</span></th>");o.append("<th class=\"day week_title graytext\">");o.append("<span title=\"三\">三</span></th>");o.append("<th class=\"day week_title graytext\">");o.append("<span title=\"四\">四</span></th>");o.append("<th class=\"day week_title graytext\">");o.append("<span title=\"五\">五</span></th>");o.append("<th class=\"day week_title graytext\" class=\"day week_title graytext\">");o.append("<span title=\"六\">六</span></th>");o.append("</tr>");for(var i=1;i<=6;i++){o.append("<tr index=\""+i+"\">");for(j=0;j<7;j++){o.append("<td class=\"day  \" >\n");o.append("&nbsp;</td>")}
o.append("</tr>")}
o.append("</tbody>");o.append("</table>");o.append("</div>");o.append("</div>");o.append("</div>");o.append("<div class=\"day_detail dscroll \" id=\"workList\" style=\"postion:relative;\">");o.append("<div class=\"day_detail_list  dscroll-box\">");o.append("<div class=\"dscroll-container \" style=\"overflow: hidden; top: 0px;width: 100%;\">");o.append("<dl class=\"hourlist\">");for(var i=1;i<=23;i++){o.append("<dd hour=\""+i+"\" title=\"请点击，新建日程\">");var s="凌晨";if(i>=6&&i<12)s="上午";else if(i==12)s="正午";else if(i>12&&i<19)s="下午";else if(i>=19)s="晚上";o.append("<label class=\"\">"+s+"  "+(i<10?"&nbsp;&nbsp;":"")+i+"点</label>");o.append("<div class=\"day_item_detail\"></div>");o.append("</dd>")}
o.append("</dl>");o.append("</div>");o.append("<div class=\" dragger-container\" style=\"display: none;\"><div class=\"dscroll-dragger\" style=\"top: 0px; display: none;\"></div></div>");o.append("</div>");o.append("<div id=\""+iab.sDIVId+"_DataList\" style=\"position: absolute;top: 0;left:0;\">");o.append("</div>");o.append("</div>\n");o.append("</div>\n");iab.wcm=$(o.toString());l.html("");if(!ymr(l)&&l.length>0)l.append(iab.wcm);else $("body",document).html(iab.wcm);iab.rqb=iab.wcm.find("div.day_info");iab.jlt=iab.wcm.find("div.title_year");iab.jlt.find(".btn_pre").attr("title","上一月");iab.jlt.find(".btn_next").attr("title","下一月");iab.jlt.find("[ck='minCalGoMonth']").unbind("click").bind("click",function(){var a=$(this).attr("to");iab.cqe(parseInt(a,10))});iab.ggm=iab.wcm.find("table.datelist");iab.wcj=iab.ggm.find("tr[index]");iab.uqy();iab.qkt(iab.iix.getFullYear(),iab.iix.getMonth());Sdule.yzm.hide();var p=iab.sDIVId+"_DataList";iab.kxb=iab.wcm.find("#"+p);iab.$hourlist=iab.wcm.find("dl.hourlist");iab.$hourlist.unbind("click").bind("click",function(a){var b=$(a.target);var c=0;while(c<50&&b.length>0&&b.attr("tagName").toLowerCase()!="dd"){b=b.parent();c++}
var d=iab.iix;var e=d.getMonth();var f=d.getFullYear();var g=d.getDate();var h=d.getHours();if(!ymr(b)&&b.length>0)h=parseInt(b.attr("hour"),10);var i=f+"-"+(e+1)+"-"+g+" "+h+":00:00";$lastClick=b;Sdule.bcp(a.target,i,3)});var q=iab.iix;iab.rqb.find("div.day_num").html(q.getDate());iab.rqb.find("div.date-txt").html(q.getFullYear()+"年"+(q.getMonth()+1)+"月"+q.getDate()+"日 星期"+iab.bmx(q.getDay()));var r=null;iab.ggm.unbind("click").bind("click",function(e){var a=$(e.target);var b=0;while(b<3&&!ymr(a)&&a.length>0){var c=a.attr("tagName");if(!ymr(c)&&c.toLowerCase()=="td")break;else a=a.parent();b++}
var d=a.attr("date");if(ymr(d)){return false}
d=Dcx.Date.nqx(d);iab.iix=d;iab.rqb.find("div.day_num").html(d.getDate());iab.rqb.find("div.date-txt").html(d.getFullYear()+"年"+(d.getMonth()+1)+"月"+d.getDate()+"日 星期"+iab.bmx(d.getDay()));a.addClass("selectedtd");if(!ymr(r)&&(a.attr("date")==""||a.attr("date")!=r.attr("date"))){r.removeClass("selectedtd")}
r=a;iab.uqy()})}
iab.qkt=function(c,d){var e,rowIndex,cellIndex;var f=iab.iix.getMonth();var g=iab.iix.getFullYear();var h=(new Date(g,f,1)).getDay();var j=new Date();var k=j.getDate();if(j.getFullYear()!=g||j.getMonth()!=f)k=-1;var l=1;var n=Sdule.owp(g,f);var o=iab.wcj;var p=g;var q=f-1;if(q<1){q=11;p--}
var r=Sdule.owp(p,q);var s=g;var t=f+1;if(t>=12){t=0;s++}
for(rowIndex=1;rowIndex<=6;rowIndex++){var u=o.filter("tr[index="+rowIndex+"]");if(u.length<1)continue;if(l>n){u.hide();break}
if(rowIndex==6)u.show();cellIndex=0;if(rowIndex==1)cellIndex=h;u.children().each(function(i){var a=$(this);var v=l;var m=f;var b="";if((rowIndex==1&&i<cellIndex)){v=r-h+i+1;b=p+"-"+(q+1)+"-"+v;m=q;a.addClass("invalidateday")}else if(l>n){v=l-n;m=t;b=s+"-"+(t+1)+"-"+v;a.addClass("invalidateday");l++}else{b=g+"-"+(f+1)+"-"+v;a.removeClass("invalidateday");l++}
a.removeClass("todaytd selectedtd").html("<a href=\"javascript:void(0);\">"+v+"</a>").attr("date",b);if(v==k&&f==m)a.addClass("todaytd")})}
iab.jlt.find("span.date-txt").html(g+"年"+(f+1)+"月")};iab.hwm=function(){var d=iab.iix;var a=new Date(d.getFullYear(),d.getMonth(),d.getDate());var b=new Date(d.getFullYear(),d.getMonth(),d.getDate(),23,59,59);return{"f":a,"l":b}};iab.cqe=function(c){iab.iix.setMonth(iab.iix.getMonth()+c);iab.qkt(iab.iix.getFullYear(),iab.iix.getMonth())}
iab.uqy=function(){var d=iab.iix;var a=new Date(d.getFullYear(),d.getMonth(),d.getDate());var b=new Date(d.getFullYear(),d.getMonth(),d.getDate(),23,59,59);iab.CurDataKey="D"+a.getFullYear()+"_"+a.getMonth()+"_"+a.getDate()+"_"+b.getFullYear()+"_"+b.getMonth()+"_"+b.getDate();iab.CurIsOk=true;Sdule.wcx(3,a,b)};iab.bmx=function(a){if(a==0)return"日";else if(a==1)return"一";else if(a==2)return"二";else if(a==3)return"三";else if(a==4)return"四";else if(a==5)return"五";else if(a==6)return"六"}
iab.gwj=function(a){var b,rowIndex,cellIndex;var c=iab.iix;var e=c.getMonth();var f=c.getFullYear();var g=c.getDay();var h=new Date();var j=h.getDate();var k=1;var l=Sdule.owp(f,e);var m=f;var n=e-1;if(n<1){n=11;m--}
var o=f;var p=e+1;if(p>=12){p=0;o++}
var d=c;var q=new Date(d.getFullYear(),d.getMonth(),d.getDate());var r=new Date(d.getFullYear(),d.getMonth(),d.getDate(),23,59,59);var s=Sdule.DataList[a];var t=new nzy();var u=1;for(var i=s.length-1;i>=0;i--){var v=s[i];v.StartTime=Dcx.Date.lvk(v.StartTime);v.EndTime=Dcx.Date.lvk(v.EndTime);var d=v.StartTime;var w=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();var x=147;var y=v.StartTime.getHours()+v.StartTime.getMinutes()/60;var z=(y-u)*42.8-10;var A=v.EndTime.getHours()+v.EndTime.getMinutes()/60;var B=new Date(d.getFullYear(),d.getMonth(),d.getDate());d=v.EndTime;var C=new Date(d.getFullYear(),d.getMonth(),d.getDate());if(Dcx.Date.xcb(B,C)==0){y=A-y;if(y<4)y=4}else y=4;var D=41*y;var E="<div class=\"sdule-item\" sid=\""+v.SId+"\" style=\"z-index:"+y+";background:"+Sdule.jsm(v.TypeId)+";top: "+z+"px;left:";var F="px;height:"+D+"px;\"><label >"+v.Title+"</label></div>\n";t.append(E+x+F)}
iab.kxb.html(t.toString());iab.kxb.children().draggable()}