
hxx.Init=function(j,l,m){Sdule.Mode=2;l=Sdule.mta;m=Sdule.yzm;hxx.instanceName=j;hxx.separator="-";hxx.Width=200;hxx.iix=new Date();hxx.today=new Date();hxx.startYear=1930;hxx.endYear=hxx.today.getFullYear()+20;hxx.oTaget=null;hxx.oPreviousCell=null;hxx.sDIVId=j+"_Div";hxx.sTABLEId=j+"_Table";hxx.sMONTHId=j+"_Month";hxx.sYEARId=j+"_Year";hxx.sHourId=j+"_Hour";hxx.sMinuteId=j+"_Minute";hxx.sSecondId=j+"_Second";hxx.sTODAYBTNId=j+"_TODAYBTN";var n,sYear,sDay;n=hxx.iix.getMonth();sYear=hxx.iix.getFullYear();sDay=hxx.iix.getDate();var o=new nzy();o.append("<div id=\""+hxx.sDIVId+"\" class=\"\"   >\n");o.append("<div class=\"week_detail_list \">");o.append("<div style=\"\">");o.append("<table  cellpadding=\"0\" cellspacing=\"0\" class=\"ui-calendar-calendar\">");o.append("<tbody>");o.append("<tr class=\"week_title\" id=\""+hxx.sTABLEId+"_WHead\" >");o.append("<th   style=\"width:60px; text-align:right; padding-right:3px;\" >");o.append("<span title=\"\" week=\"-1\"></span></th>");o.append("<th  style=\"\">");o.append("<span title=\"周日\" week=\"0\" >17 周日</span></th>");o.append("<th style=\"\">");o.append("<span title=\"周一\" week=\"1\">18 周一</span></th>");o.append("<th style=\"\">");o.append("<span title=\"周二\" week=\"2\">19 周二</span></th>");o.append("<th style=\"\">");o.append("<span title=\"周三\" week=\"3\">20 周三</span></th>");o.append("<th style=\"\">");o.append("<span title=\"周四\" week=\"4\">21 周四</span></th>");o.append("<th style=\"\">");o.append("<span title=\"周五\" week=\"5\">22 周五</span></th>");o.append("<th style=\"\">");o.append("<span title=\"周六\" week=\"6\">23 周六</span></th>");o.append("</tr>");o.append("<tr >");o.append("<td  style=\"width:60px; text-align:right; padding-right:3px;\" >");o.append("<dl class=\"no-bottom\" style=\"\">");for(var i=1;i<=23;i++){o.append("<dd  class=\"no-bottom\" hour=\""+i+"\">");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("<span class=\"\">"+s+" "+(i<10?"&nbsp;":"")+i+"点</span>");o.append("<div class=\"day_item_detail\"></div>");o.append("</dd>")}
o.append("</dl>");o.append("</td>");for(var i=0;i<=6;i++){o.append("<td  >");o.append("<dl week=\""+i+"\" style=\"\" class=\"weektime\">");for(var k=1;k<=23;k++){o.append("<dd hour=\""+k+"\" title=\"请点击，添加日程\" style=\"cursor:pointer;\">");o.append("<span class=\"\">&nbsp;</span>");o.append("<div class=\"day_item_detail\"></div>");o.append("</dd>")}
o.append("</dl>");o.append("</td>")}
o.append("</tr>");o.append("</tbody>");o.append("</table>");o.append("<div id=\""+hxx.sTABLEId+"_DataList\" style=\"position: absolute;top: 0;left:0;\">");o.append("</div>");o.append("</div>");o.append("</div>");o.append("</div>\n");hxx.wcm=$(o.toString());l.html("");l.append(hxx.wcm);var p=hxx.sTABLEId+"_WHead";hxx.xve=hxx.wcm.find("#"+p);hxx.yrb=hxx.wcm.find("dl[week]");var p=hxx.sTABLEId+"_DataList";hxx.kxb=hxx.wcm.find("#"+p);hxx.qkt(hxx.iix);var q=$.browser.msie?"mouseenter":"mouseover";var r=$.browser.msie?"mouseleave":"mouseout";hxx.wcm.unbind(q).bind(q,function(){heh=true});hxx.wcm.unbind(r).bind(r,function(){heh=false});Sdule.yzm.show().find(".btn_pre").attr("title","上一周");Sdule.yzm.find(".btn_next").attr("title","下一周");Sdule.yzm.find("[ck='goMonth']").unbind("click").bind("click",function(){var a=$(this).attr("to");hxx.tbu(parseInt(a,10))});var t=null;hxx.yrb.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=parseInt($(this).attr("year"),10);var e=parseInt($(this).attr("month"),10);var f=parseInt($(this).attr("day"),10);var g=parseInt($(this).attr("week"),10);var h=hxx.iix.getHours();if(!ymr(b)&&b.length>0)h=parseInt(b.attr("hour"),10);var i=d+"-"+(e+1)+"-"+f+" "+h+":00:00";t=b;Sdule.bcp(a.target,i,2)});hxx.wcm.find("div.dscroll").dcxScrollbar("vertical",300,"ubs",1.05,"auto","yes","no",15,true,true)}
hxx.qkt=function(g){var h,rowIndex,cellIndex;if(ymr(g))g=hxx.iix;var j=g.getMonth();var k=g.getFullYear();var l=g.getDay();var m=new Date();var n=g.getDate();var o=1;var p=Sdule.owp(k,j);var q=k;var r=j-1;if(r<1){r=11;q--}
var s=k;var t=j+1;if(t>=12){t=0;s++}
var u=g;u.setDate(u.getDate()-u.getDay());var v=new Date(u.getFullYear(),u.getMonth(),u.getDate());u.setDate(u.getDate()+6);var w=new Date(u.getFullYear(),u.getMonth(),u.getDate(),23,59,59);hxx.CurDataKey="W"+v.getFullYear()+"_"+v.getMonth()+"_"+v.getDate()+"_"+w.getFullYear()+"_"+w.getMonth()+"_"+w.getDate();hxx.CurIsOk=false;Sdule.wcx(2,v,w);hxx.xve.find("span").each(function(i){var a=parseInt($(this).attr("week"),10);if(a>=0){var b=hxx.yrb.filter("[week="+a+"]");a=l-a;var c=n-a;var d=j;var e=k;var f="";if(c<1){c=parseInt(Sdule.owp(q,r),10)+c;d=r;e=q;f=(r+1)+"-"+(c)}else if(c>p){c=c-p;f=(t+1)+"-"+(c);d=t;e=s}else f=c;b.attr("year",e).attr("day",c).attr("month",d).attr("date",e+"-"+d+"-"+c);$(this).text(f+" "+$(this).attr("title"))}});hxx.CurIsOk=true;Sdule.yzm.find("h1").text(g.getFullYear()+"年"+(g.getMonth()+1)+"月")};hxx.hwm=function(){var a,rowIndex,cellIndex;var b=hxx.iix;var c=b.getMonth();var d=b.getFullYear();var e=b.getDay();var f=new Date();var g=b.getDate();var h=1;var i=Sdule.owp(d,c);var j=d;var k=c-1;if(k<1){k=11;j--}
var l=d;var m=c+1;if(m>=12){m=0;l++}
var n=b;n.setDate(n.getDate()-n.getDay());var o=new Date(n.getFullYear(),n.getMonth(),n.getDate());n.setDate(n.getDate()+6);var p=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59);return{"f":o,"l":p}};hxx.tbu=function(c){if(c>0)hxx.iix.setDate(hxx.iix.getDate()+(7-hxx.iix.getDay()));else hxx.iix.setDate(hxx.iix.getDate()+(-7-hxx.iix.getDay()));hxx.qkt(hxx.iix)}
hxx.gwj=function(a){var b,rowIndex,y;var c=hxx.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;d.setDate(d.getDate()-d.getDay());var q=new Date(d.getFullYear(),d.getMonth(),d.getDate());d.setDate(d.getDate()+6);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;var v=1;for(var i=s.length-1;i>=0;i--){var w=s[i];w.StartTime=Dcx.Date.lvk(w.StartTime);w.EndTime=Dcx.Date.lvk(w.EndTime);var d=w.StartTime;var x=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();var y=d.getDay();var z=125*y+75;var A=w.StartTime.getHours()+w.StartTime.getMinutes()/60;var B=(A-u)*41+21;var C=w.EndTime.getHours()+w.EndTime.getMinutes()/60;var D=new Date(d.getFullYear(),d.getMonth(),d.getDate());d=w.EndTime;var E=new Date(d.getFullYear(),d.getMonth(),d.getDate());if(Dcx.Date.xcb(D,E)==0){A=C-A;if(A<4)A=4}else A=4;var F=41*A;var G="<div class=\"sdule-item\" sid=\""+w.SId+"\" title=\"可以拖动\" style=\"z-index:"+A+";background:"+Sdule.jsm(w.TypeId)+";top: "+B+"px;left:";v++;var H="px;height:"+F+"px;\"><label >"+w.Title+"</label></div>\n";if(w.RepeatType==1){for(var i=y;i<=6;i++){z=125*i;t.append(G+z+H)}}else if(w.RepeatType==2){if(y==0)y=1;for(var i=y;i<6;i++){z=125*i;t.append(G+z+H)}}else{t.append(G+z+H)}}
hxx.kxb.html(t.toString());hxx.kxb.children().draggable()}