text: Ext.ECalendar.weekview=function(a){Ext.apply(this,a);this.addEvents("dblClickTaskAllDay","beforeWeekChange","afterWeekChange","launchEventList");Ext.ECalendar.weekview.superclass.constructor.call(this);};Ext.extend(Ext.ECalendar.weekview,Ext.util.Observable,{referid:"weekview",header:true,headerButtons:true,headerFormat:"W",headerShowDates:true,dayformatLabel:"D j",scrolltoHour:false,hourFormat:"G:i",startTime:"00:00:00 am",endTime:"11:59:59 pm",style:"google",alldayTaksMore:"window",alldayTaskTPL:new Ext.XTemplate('<tpl for="."><div class="ecal-show-basetasktpl-div">Event:{subject}<br>Location:{location}',"Starts:{startdate}<br>Ends:{enddate}<br>Description:<br>{description}<div><hr></tpl>"),alldayTasksMaxView:3,alldayTasks:[],weekTasks:[],store:null,headerDayClick:"none",currentweek:1,task_format:"Y-m-d H:i:s",task_bgcolor_base:"#E0FFA2",task_showqtip:true,task_width:50,tasksOffset:20,taskelements:0,ShowMenuItems:[1,1,1,1,1,1],task_ShowMenuItems:[1,1,1,1,1],moreMenuItems:[],task_eventLaunch:"click",taskAdd_timer_dblclick:false,scrolltoHour:false,allday24HinsideBody:false,task_clsOver:"",forceTaskFit:false,startDay:1,customHTMLinpos:"before",headerUseTpl:false,headerTpl:new Ext.XTemplate('<tpl for=".">{title}-from {initday:this.formatx} to {enday:this.formatx}</tpl>',{formatx:function(a){return a.format("m-d-y");}}),headerData:{title:"Custom header for Week",initday:new Date(),enday:new Date()},init:function(b,a){this.calx=b;this.datetohandle=a;},refreshView:function(){this.render();},render:function(){this.datetohandle=this.calx.currentdate;var H=this.getDatesforWeek(this.datetohandle);var r=Ext.get(this.calx.body);var c=r.dom.childNodes.length;if(c){for(var O=c;O<c;O++){r.dom.removeChild(r.dom.childNodes[0]);}}r.update("");var r=Ext.get(this.calx.body);var l='<div id="'+this.calx.id+'-main-calendar-header"></div>';l+='<div id="'+this.calx.id+'-main-calendar-week-body"></div>';r.update(l);if(this.header){var f=this.datetohandle;var p=Ext.get(this.calx.id+"-main-calendar-header");var b=p;var G=b.wrap({tag:"div",cls:"x-calendar-weekv-header",html:""});if(this.headerButtons){var n=G.createChild({id:this.calx.id+"-btn-pw",tag:"div",cls:"x-calendar-week-previous",html:""});var I=G.createChild({id:this.calx.id+"-btn-nw",tag:"div",cls:"x-calendar-week-next",html:""});n.dom["qtip"]=e2cs.cal_locale.headerTooltipsWeek.prev;n.addListener("click",function(){this.onclickprev_week();},this);n.addClassOnOver("x-calendar-week-previous-over");I.dom["qtip"]=e2cs.cal_locale.headerTooltipsWeek.next;I.addListener("click",function(){this.onclicknext_week();},this);I.addClassOnOver("x-calendar-week-next-over");}if(this.headerUseTpl){var R=this.headerTpl.apply(this.headerData);var t=G.createChild({tag:"div",id:this.calx.id+"-sub-"+"header",html:""+R+""});}else{complementtext="";if(this.headerShowDates){complementtext=' <span class="x-calendar-weekv-header-small">'+e2cs.cal_locale.weekheaderlabel_from+H[0].format("d/m/Y")+e2cs.cal_locale.weekheaderlabel_to+H[1].format("d/m/Y")+"</span>";}if(H[0].format(this.headerFormat)==H[1].format(this.headerFormat)){var g=e2cs.cal_locale.weekheaderlabel+f.format(this.headerFormat);}else{var g=e2cs.cal_locale.weekheaderlabel+H[0].format(this.headerFormat)+" - "+H[1].format(this.headerFormat);}var t=G.createChild({tag:"div",id:this.calx.id+"-sub-"+"header",html:""+g+complementtext+""});}}var a=Ext.get(this.calx.id+"-main-calendar-week-body");var y=a.createChild({tag:"div",id:this.calx.id+"-weekvbody",cls:"x-calendar-weekv-body",html:""});var H=this.getDatesforWeek(this.datetohandle);if(this.style=="plain"){daysintro=this.genDaysHeader(H[0]);y.insertHtml("beforeEnd",daysintro,false);}else{daysintro=this.genAlldayContainer(H[0]);y.insertHtml("beforeEnd",daysintro,false);var E=Ext.get(this.calx.id+"-allday1");var L=Ext.get(this.calx.id+"-alldaycontainer");var K=Ext.get("alldayrefer");L.setXY(E.getXY());L.setHeight(E.getHeight(true));ancho=0;for(var O=1;O<8;O++){ancho+=Ext.get(this.calx.id+"-allday"+O).getWidth(false);}if(Ext.isIE){ancho+=7;}else{ancho+=5;}L.setWidth(ancho,false);var J=Ext.get("alldaylistbutton");var s=this.getWeekTasks(this.datetohandle,0);if(L.dom.childNodes.length==1&&L.dom.childNodes[0].childNodes.length==0){J.setDisplayed("none");}else{if(s.length>this.alldayTasksMaxView){J.setDisplayed("block");}else{J.setDisplayed("none");}}J.addClassOnOver("alldaylistover");J.addListener("click",function(){this.showMoreTasksList();},this);}var v=this.genBody(H[0]);y.insertHtml("beforeEnd",v,false);for(var O=1;O<8;O++){var N=Ext.get(this.calx.id+"-day"+O);N.setHeight(Ext.get(this.calx.id+"-wd"+O).getHeight(true));var P=Ext.get(N.dom.childNodes[0]);P.setHeight(Ext.get(this.calx.id+"-wd"+O).getHeight(false));if(Ext.isOpera){P.addListener("mousedown",this.operabuttons_body,this);}else{P.addListener("contextmenu",this.oncontextmenu_bodyday,this,{stopPropagation:false,normalized:true,preventDefault:true});}}var z=Ext.get(this.calx.id+"-weekbodydisplay");if(Ext.isIE){z.setStyle({position:"relative"});}if(this.calx.ownerCt!=undefined){if(this.calx.ownerCt.ctype&&this.calx.ownerCt.ctype=="Ext.Component"){this.calx.height=this.calx.ownerCt.getInnerHeight();}}if(!this.calx.height||this.calx.height=="undefined"){if(this.calx.getEl().dom.offsetParent!=null){var o=this.calx.getEl().dom.offsetParent.clientHeight;}else{var o=0;}}else{var o=this.calx.height;}if(o==0){o=300;}styleheaderheight=0;if(this.style=="plain"){styleheaderheight=Ext.get(this.calx.id+"-allday_w_task").getHeight(true)+8;}else{styleheaderheight=Ext.get(this.calx.id+"-allday_w_task").getHeight(true)+8;styleheaderheight+=Ext.get("alldaylistbutton").getHeight(true);}if(this.header){o+=-24;}if(this.calx.showCal_tbar){o+=-26;}if(this.calx.header){o+=-26;}var B=0;z.setStyle({height:""+(o-styleheaderheight)-B+"px"});z.setStyle({overflow:"auto"});if(Ext.isIE||Ext.isIE6){Ext.get(this.calx.id+"-tableweek-layout").setWidth(Ext.get(this.calx.id+"-tableweek-layout").getWidth()-16,false);Ext.get(this.calx.id+"-tableweek-layout").setStyle({position:"relative"});}var h=Ext.get(this.calx.id+"-weekbodydisplay").getHeight(true);var e=Ext.get(this.calx.id+"-week-skeleton").getHeight(true);if(e>h){if(this.style=="plain"){var T=Ext.get(this.calx.id+"-alldaygridbodylayout");var w=Ext.get(this.calx.id+"-tableallcontainer");for(var O=1;O<8;O++){Ext.get(this.calx.id+"-weekhdrday-"+O).setWidth(Ext.get(this.calx.id+"-wd"+O).getWidth(false),false);}ancho=T.getWidth(false);if(Ext.isIE||Ext.isIE6){T.setWidth((T.getWidth()-17),false);}else{T.setWidth((ancho-19),false);}}else{var T=Ext.get(this.calx.id+"-alldaygridbodylayout");var w=Ext.get(this.calx.id+"-tableallcontainer");ancho=0;for(var O=1;O<8;O++){ancho+=Ext.get(this.calx.id+"-allday"+O).getWidth(false);}if(Ext.isIE){ancho+=7;}else{ancho+=4;}L.setWidth(ancho,false);ancho=T.getWidth(false);if(Ext.isIE||Ext.isIE6){T.setWidth((T.getWidth()-19),true);L.setWidth(L.getWidth()-19,true);}else{T.setWidth((ancho-18),false);L.setWidth(L.getWidth()-18,false);}}}if(this.style=="plain"){}else{var J=Ext.get("alldaylistbutton");if(L.dom.childNodes[0].childNodes.length==0&&L.dom.childNodes[0].childNodes.length==0){}else{if(L.dom.childNodes.length<this.alldayTasksMaxView){allcounterproc=L.dom.childNodes.length;}else{allcounterproc=this.alldayTasksMaxView;}for(var O=0;O<allcounterproc;O++){alldaytasktmp=Ext.get(L.dom.childNodes[O]);this.formatallDayTask(alldaytasktmp);if(this.task_eventLaunch!=""){alldaytasktmp.addListener(this.task_eventLaunch,this.onDblclick,this);}if(Ext.isOpera){alldaytasktmp.addListener("mousedown",this.operadaybuttons,this);}else{alldaytasktmp.addListener("contextmenu",this.oncontextmenu,this,{stopPropagation:false,normalized:true,preventDefault:true});}}}}this.snapweek=[];for(var O=1;O<8;O++){var d=new Date(H[0].add(Date.DAY,(O-1)));var x=Ext.get(Ext.get(this.calx.id+"-day"+O).dom.childNodes[0]);var D=x.dom.childNodes;tmpcalc=(this.task_width*D);if(tmpcalc>x.getWidth(false)){}if(D.length==1&&D[0].childNodes.length==0){}else{var C=D.length;for(var M=0;M<C;M++){var Q=Ext.get(D[M]);if(Ext.isOpera){Q.addClass("taskondayopera");}else{Q.addClass("taskonday");}checkel=Q.id.indexOf(this.calx.id+"-ecal-daytask",0);if(checkel<0){}else{if(this.task_eventLaunch!=""){Q.addListener(this.task_eventLaunch,this.onDblclickSingleday,this);}if(this.task_clsOver!=""){Q.addClassOnOver(this.task_clsOver);}if(Ext.isOpera){Q.addListener("mousedown",this.operadaybuttons,this);}else{Q.addListener("contextmenu",this.oncontextmenu,this,{stopPropagation:false,normalized:true,preventDefault:true});}this.formatdayTask(d,O,Q,M);}}}}if(this.headerDayClick=="viewday"){var A=Ext.select("td.x-calendar-weekv-header-days",true);A.each(function(U,i,j){if(U.id.indexOf(this.calx.id+"-weekhdrday-")>=0){U.addClassOnOver("overwday");U.addListener("click",this.onWeekHeaderdayClick,this);}},this);}if(this.taskAdd_timer_dblclick){if(Ext.isIE){var S=Ext.select("td.hour-marker_ie",true);}else{var S=Ext.select("td.hour-marker",true);}var u=this.datetohandle;var m=this.calx;S.each(function(U,i,j){if(U.id.indexOf(m.id+"-tdbody-weekv-")+1>=1){U.addListener("dblclick",function(Y,aa,X){if(aa.id.indexOf(m.id+"-tdbody-weekv-")<0){var V=Ext.get(aa).parent().id.replace(m.id+"-tdbody-weekv-","");}else{var V=aa.id.replace(m.id+"-tdbody-weekv-","");}var Z=new Date(V);var W=new Date(u.format("m/d/Y")+" "+Z.format("G:i"));m.fireEvent("taskAdd",W);});}},this);}var q=Ext.get(this.calx.id+"-weekbodydisplay");q.dom.scrollTop=0;if(this.scrolltoHour){var F=0;if(Ext.isIE){var S=Ext.select("td.hour-marker_ie",true);}else{var S=Ext.select("td.hour-marker",true);}S.each(function(V,j,U){if(V.id.indexOf(m.id+"-tdbody-weekv-")+1>=1){var i=this.datetohandle.format("G:i");if(i=="00:00"||i=="0:00"){i=new Date().format("G:1");}if(V.id.indexOf(i)+1>=1){F=Ext.get(V).getY();return false;}}},this);if(F>0){F=F-q.getY();q.dom.scrollTop=F;}}z.setStyle({height:""+(o-styleheaderheight)-B+"px"});for(var O=0;O<7;O++){var h=1;if(O>0){h=2;}else{h=0;}var k=Ext.get(this.calx.id+"-allday"+(O+1));k.setWidth(Ext.get(this.calx.id+"-wd"+(O+1)).getWidth());}},onWeekHeaderdayClick:function(d,f,c){if(f.className.indexOf("x-calendar-weekv-header-days")<0){return false;}var a=Ext.get(f);var e=a.getAttributeNS("tag","dayval");var b=new Date(e);if(this.headerDayClick=="viewday"){if(this.calx.fireEvent("beforeChangeView","day","week",this.calx)==false){return false;}else{this.calx.currentdate=b;this.calx.selector_dateMenu.picker.setValue(this.calx.currentdate);this.calx.currentView="day";this.calx.viewday.render();this.calx.fireEvent("onChangeView","day","week",this);}}else{return false;}},onDblclickSingleday:function(c,e,b){var d=Ext.get(e.id);var a=this.getTaskarray(e);this.calx.fireEvent("taskDblClick",a,this,this.calx,"week");},onDblclick:function(c,e,b){var d=Ext.get(e.id);var a=this.getTaskarray(e);this.calx.fireEvent("taskDblClick",a,this,this.calx,"week");},operabuttons_body:function(b,c,a){if(Ext.isOpera){if(b.button==2){this.oncontextmenu_bodyday(b,c,a);}}},operabuttons:function(b,c,a){if(Ext.isOpera){if(b.button==2){this.oncontextmenu(b,c,a);}}},oncontextmenu_bodyday:function(f,b,g){if(Ext.isOpera){if(f.button!=2){return false;}}if(b.id.indexOf("containeronday")<0){return false;}if(this.ShowMenuItems[0]!=true&&this.ShowMenuItems[1]!=true&&this.ShowMenuItems[2]!=true&&this.ShowMenuItems[3]!=true&&this.ShowMenuItems[4]!=true&&this.ShowMenuItems[5]!=true){return false;}if(Ext.isIE){h=Ext.get(b.parentNode);var c=h.getAttributeNS("tag","iddate");}else{var h=b.parentNode;var c=b.parentNode.attributes[1].nodeValue;}f.stopEvent();var a=Ext.get(b.id);if(this.menu){this.menu.removeAll();}this.menu=new Ext.menu.Menu({shadow:true,items:[{id:"week_ctxbtn_task-add",iconCls:"x-calendar-day-btnmv_add",text:e2cs.cal_locale.contextMenuLabelsDay.taskAdd,scope:this},"-",{id:"week_ctxbtn_task-go-nd",iconCls:"x-calendar-week-btnmv_nextweek",text:e2cs.cal_locale.contextMenuLabelsWeek.next,scope:this},{id:"week_ctxbtn_task-go-pd",iconCls:"x-calendar-week-btnmv_prevweek",text:e2cs.cal_locale.contextMenuLabelsWeek.prev,scope:this},"-",{id:"week_ctxbtn_viewmonth",iconCls:"x-calendar-month-btnmv_viewmonth",text:e2cs.cal_locale.contextMenuLabelsWeek.chgmview,scope:this},{id:"week_ctxbtn_viewday",iconCls:"x-calendar-month-btnmv_viewday",text:e2cs.cal_locale.contextMenuLabelsWeek.chgdview,scope:this},{id:"week_ctxbtn_viewsched",iconCls:"x-calendar-month-btnmv_viewsched",text:e2cs.cal_locale.contextMenuLabelsWeek.chgsview,scope:this}]});var i=this.calx;var e=this;var d=b;this.menu.items.items[0].addListener("click",function(){var q=e.getDatesforWeek(new Date(c));var m=d.parentNode.id.replace(i.id+"-day","");var n=parseInt(m)-1;var o=q[0].add(Date.DAY,n);var k;var j=Ext.get(i.id+"-weekbodydisplay").getY();if(Ext.isIE){var p=Ext.select("td.hour-marker_ie",true);}else{var p=Ext.select("td.hour-marker",true);}p.each(function(r,t,x){if(r.id.indexOf(i.id+"-tdbody-weekv-")+1>=1){var u=Ext.get(r).getY();var y=Ext.get(r).getHeight();var w=f.getPageY();if(w>=u&&w<=(u+y)){if(r.id.indexOf(i.id+"-tdbody-weekv-")<0){var s=Ext.get(r).parent().id.replace(i.id+"-tdbody-weekv-","");}else{var s=r.id.replace(i.id+"-tdbody-weekv-","");}var v=s.toUpperCase();if(e.hourFormat=="H"||e.hourFormat=="G"){v=v.replace("AM","");v=v.replace("PM","");}else{if(e.hourFormat=="h"||e.hourFormat=="g"){var z=11;}}k=new Date(v);return false;}else{return true;}}},this);var l=new Date(o.format("m/d/Y")+" "+k.format("H:i:s"));this.calx.fireEvent("taskAdd",l);},this);this.menu.items.items[2].addListener("click",function(){this.onclicknext_week();},this);this.menu.items.items[3].addListener("click",function(){this.onclickprev_week();},this);this.menu.items.items[5].addListener("click",function(){this.changeCalview(h,this,1);},this);this.menu.items.items[6].addListener("click",function(){this.changeCalview(h,this,2);},this);this.menu.items.items[7].addListener("click",function(){this.changeCalview(h,this,3);},this);if(this.ShowMenuItems[0]!=true){this.menu.items.items[0].hidden=true;this.menu.items.items[1].hidden=true;}if(this.ShowMenuItems[1]!=true&&this.ShowMenuItems[2]!=true&this.ShowMenuItems[3]!=true&&this.ShowMenuItems[4]!=true&&this.ShowMenuItems[5]!=true){this.menu.items.items[1].hidden=true;}if(this.ShowMenuItems[1]!=true){this.menu.items.items[2].hidden=true;}if(this.ShowMenuItems[2]!=true){this.menu.items.items[3].hidden=true;}if(this.ShowMenuItems[1]!=true&&this.ShowMenuItems[2]!=true){this.menu.items.items[4].hidden=true;}if(this.ShowMenuItems[3]!=true){this.menu.items.items[5].hidden=true;}if(this.ShowMenuItems[4]!=true){this.menu.items.items[6].hidden=true;}if(this.ShowMenuItems[5]!=true){this.menu.items.items[7].hidden=true;}if(!this.calx.mview){this.menu.items.items[6].hidden=true;}if(!this.calx.dview){this.menu.items.items[5].hidden=true;}if(!this.calx.sview){this.menu.items.items[7].hidden=true;}this.menu.showAt([f.getPageX(),f.getPageY()]);},changeCalview:function(c,d,b){if(Ext.isIE){var a=c.getAttributeNS("tag","iddate");}else{var a=c.attributes[1].nodeValue;}this.calx.currentdate=new Date(a);this.calx.selector_dateMenu.picker.setValue(this.calx.currentdate);if(b==1){varview="month";}else{if(b==2){varview="day";}else{varview="schedule";}}this.calx.changeView(varview);},oncontextmenu:function(j,d,k){if(Ext.isOpera){if(j.button!=2){return false;}}if(this.task_ShowMenuItems[0]!=true&&this.task_ShowMenuItems[1]!=true&&this.task_ShowMenuItems[2]!=true&&this.task_ShowMenuItems[3]!=true&&this.task_ShowMenuItems[4]!=true&&this.moreMenuItems.length<=0){return false;}j.stopEvent();if(d.id.indexOf(this.calx.id+"-ecal-daytask-")<0){if(d.id.indexOf(this.calx.id+"-ecal-alldaytask-")<0){var a=Ext.get(d.parentNode.id);}else{var a=Ext.get(d.id);}}else{var a=Ext.get(d.id);}var l=this.task_ShowMenuItems;var b=this.moreMenuItems;var f=[];var h=this.getTaskarray(a);var c=this.calx.fireEvent("beforeContextMenuTask","weekview-task",h,l,f);if(c==false){if(f[0]==false){if(f[1]==true){if(f[2]==true){var b=f[3];}var l=f[4];}else{var b=this.moreMenuItems;var l=this.task_ShowMenuItems;}}else{return false;}}else{var b=this.moreMenuItems;}if(this.menu){this.menu.removeAll();}this.menu=new Ext.menu.Menu({shadow:true,items:[{id:"week_ctxbtn_task-add",iconCls:"x-calendar-day-btnmv_add",text:e2cs.cal_locale.contextMenuLabelsDay.taskAdd,scope:this},{id:"week_ctxbtn_task-delete",iconCls:"x-calendar-day-btnmv_delete",text:e2cs.cal_locale.contextMenuLabelsDay.taskDelete,scope:this},"-",{id:"week_ctxbtn_task-edit",iconCls:"x-calendar-day-btnmv_task",text:e2cs.cal_locale.contextMenuLabelsDay.taskEdit+a.getAttributeNS("tag","ec_subject"),scope:this},"-",{id:"week_ctxbtn_task-go-nw",iconCls:"x-calendar-week-btnmv_nextweek",text:e2cs.cal_locale.contextMenuLabelsWeek.next,scope:this},{id:"week_ctxbtn_task-go-pw",iconCls:"x-calendar-week-btnmv_prevweek",text:e2cs.cal_locale.contextMenuLabelsWeek.prev,scope:this}]});if(b.length>0){this.menu.add("-");for(var e=0;e<b.length;e++){b[e].rendered=false;if(b[e].menu==undefined){if(b[e].ctype=="Ext.menu.Item"){b[e].addListener("click",function(m,i){this.onCustomMenuAction(m.id,Ext.get(d),this);},this);}else{}this.menu.add(b[e]);}else{for(var g=0;g<b[e].menu.items.length;g++){b[e].menu.items.items[g].rendered=false;if(b[e].menu.items.items[g].ctype=="Ext.menu.Item"){b[e].menu.items.items[g].addListener("click",function(m,i){this.onCustomMenuAction(m.id,Ext.get(d),this);},this);}else{}}this.menu.add(b[e]);}}}this.menu.items.items[0].addListener("click",function(){this.onActionTask(1,Ext.get(d),this);},this);this.menu.items.items[1].addListener("click",function(){this.onActionTask(2,Ext.get(d),this);},this);this.menu.items.items[3].addListener("click",function(){this.onActionTask(3,Ext.get(d),this);},this);this.menu.items.items[5].addListener("click",function(){this.onclicknext_week();},this);this.menu.items.items[6].addListener("click",function(){this.onclickprev_week();},this);if(l[0]!=true){this.menu.items.items[0].hidden=true;}if(l[1]!=true){this.menu.items.items[1].hidden=true;}if(l[0]!=true&&l[1]!=true){this.menu.items.items[2].hidden=true;}if(l[2]!=true&&l[3]!=true&&l[4]!=true&&b.length<=0){this.menu.items.items[2].hidden=true;}if(l[2]!=true){this.menu.items.items[3].hidden=true;this.menu.items.items[4].hidden=true;}if(l[3]!=true&&l[4]!=true&&b.length<=0){this.menu.items.items[4].hidden=true;}if(l[3]!=true){this.menu.items.items[5].hidden=true;}if(l[4]!=true){this.menu.items.items[6].hidden=true;}if(b.length>0){if(l[3]!=true&&l[4]!=true){this.menu.items.items[7].hidden=true;}}this.menu.on("hide",this.onContextTaskMenu_Hide,this);this.menu.showAt(j.xy);},onContextTaskMenu_Hide:function(){},onCustomMenuAction:function(b,d,c){var a=this.getTaskarray(d);this.calx.fireEvent("customMenuAction",b,"week",a,d,this);this.menu.hide();},onActionTask:function(c,f,e){var b=this.getTaskarray(f);switch(c){case 1:if(f.id.indexOf(this.calx.id+"-ecal-alldaytask")>=0){this.calx.fireEvent("taskAdd",this.calx.currentdate);}else{if(Ext.isIE){testxxx=Ext.get(f.dom.parentNode.parentNode);var d=new Date(testxxx.getAttributeNS("tag","iddate"));}else{var d=new Date(f.dom.parentNode.parentNode.attributes[1].nodeValue);}this.calx.fireEvent("taskAdd",d);}break;case 2:var a=this.calx.fireEvent("beforeTaskDelete",b,this);if(a){if(this.calx.fireEvent("onTaskDelete",b)==true){this.calx.fireEvent("afterTaskDelete",b,true);}else{this.calx.fireEvent("afterTaskDelete",null,false);}}break;case 3:var a=this.calx.fireEvent("beforeTaskEdit",b,this);if(a){if(this.calx.fireEvent("onTaskEdit",b)==true){this.calx.fireEvent("afterTaskEdit",b,true);}else{this.calx.fireEvent("afterTaskEdit",null,false);}}break;default:break;}},getTaskarray:function(a){var c=Ext.get(a);var b=[];b[0]=c.getAttributeNS("tag","id");b[1]=c.getAttributeNS("tag","ec_id");b[2]=c.getAttributeNS("tag","ec_subject");b[3]=c.getAttributeNS("tag","ec_starts");b[4]=c.getAttributeNS("tag","ec_ends");b[5]=c.getAttributeNS("tag","ec_cnt");b[6]=c.getAttributeNS("tag","ec_storeindex");b[7]=c.getAttributeNS("tag","ec_location");b[8]=c.getAttributeNS("tag","ec_allday");b[9]=c.getAttributeNS("tag","ec_isholiday");return b;},getDatesforWeek:function(c){var b=new Date(c).getDay();if(this.startDay==1){b=((b==0)?6:b-1);var d=new Date(c.add(Date.DAY,-b).format("m/d/Y")+" "+this.startTime);var a=new Date(c.add(Date.DAY,-b+6).format("m/d/Y")+" "+this.endTime);}else{if(this.startDay==0){if(b==0){var d=new Date(c.add(Date.DAY,0).format("m/d/Y")+" "+this.startTime);var a=new Date(c.add(Date.DAY,6).format("m/d/Y")+" "+this.endTime);}else{var d=new Date(c.add(Date.DAY,-(b)).format("m/d/Y")+" "+this.startTime);var a=new Date(d.add(Date.DAY,6).format("m/d/Y")+" "+this.endTime);}}else{if(b==6){var d=new Date(c.add(Date.DAY,0).format("m/d/Y")+" "+this.startTime);var a=new Date(c.add(Date.DAY,6).format("m/d/Y")+" "+this.endTime);}else{var d=new Date(c.add(Date.DAY,-(b+1)).format("m/d/Y")+" "+this.startTime);var a=new Date(d.add(Date.DAY,6).format("m/d/Y")+" "+this.endTime);}}}return[d,a];},getWeekTasks:function(m,c){var e=this.getDatesforWeek(this.datetohandle);var b=[];switch(c){case 0:var r=this.calx.store.getCount();var k=0;var p=new Date(m.format("m/d/Y")+" "+this.startTime);var n=new Date(m.format("m/d/Y")+" "+this.endTime);var o=this.calx.dateDiff(p,n,e2cs.dateParts.MINUTE);for(var l=0;l<r;l++){var a=this.calx.store.getAt(l).data;tstdateini=new Date(a[this.calx.fieldsRefer.startdate]);tstdateend=new Date(a[this.calx.fieldsRefer.enddate]);if(a[this.calx.fieldsRefer.alldaytask]){if(tstdateini.between(e[0],e[1])||tstdateend.between(e[0],e[1])){b[k]=a;k+=1;}}else{var j=this.calx.dateDiff(tstdateini,tstdateend,e2cs.dateParts.MINUTE);if(j>=o){if(this.allday24HinsideBody==true&&j==o){if(tstdateini<e[0]&&tstdateend>e[1]){var h=tstdateend.add(Date.SECOND,-1);if(tstdateini.format("m/d/Y")==h.format("m/d/Y")){}else{b[k]=a;k+=1;}}else{if(tstdateini.between(e[0],e[1])||tstdateend.between(e[0],e[1])){var h=tstdateend.add(Date.SECOND,-1);if(tstdateini.format("m/d/Y")==h.format("m/d/Y")){}else{b[k]=a;k+=1;}}}}else{if(tstdateini<e[0]&&tstdateend>e[1]){b[k]=a;k+=1;}else{if(tstdateini.between(e[0],e[1])||tstdateend.between(e[0],e[1])){b[k]=a;k+=1;}}}}else{}}}break;case 1:var q=new Date(m.format("m/d/Y")+" "+this.startTime);var g=new Date(m.format("m/d/Y")+" "+this.endTime);var r=this.calx.store.getCount();var k=0;var o=this.calx.dateDiff(q,g,e2cs.dateParts.MINUTE);for(var l=0;l<r;l++){var a=this.calx.store.getAt(l).data;tstdateini=new Date(a[this.calx.fieldsRefer.startdate]);tstdateend=new Date(a[this.calx.fieldsRefer.enddate]);var j=this.calx.dateDiff(tstdateini,tstdateend,e2cs.dateParts.MINUTE);if(tstdateini<q&&tstdateend>g){}else{if(tstdateini.format("m/d/Y")==q.format("m/d/Y")&&j<o){if(tstdateini.between(q,g)||tstdateend.between(q,g)){if(a[this.calx.fieldsRefer.alldaytask]!=true){b[k]=a;k+=1;}}}else{if(tstdateend.format("m/d/Y")==q.format("m/d/Y")&&j<o){if(tstdateini.between(q,g)||tstdateend.between(q,g)){if(a[this.calx.fieldsRefer.alldaytask]!=true){b[k]=a;k+=1;}}}else{if(tstdateini.format("m/d/Y")==m.format("m/d/Y")){var h=tstdateend.add(Date.SECOND,-1);if(tstdateini.format("m/d/Y")==h.format("m/d/Y")){var f=this.calx.dateDiff(tstdateini,tstdateend,e2cs.dateParts.MINUTE);if(o==f){if(this.allday24HinsideBody==true){b[k]=a;k+=1;}}}}}}}}break;case 2:var q=new Date(m.format("m/d/Y")+" "+this.startTime);var g=new Date(m.format("m/d/Y")+" "+this.endTime);var r=this.calx.store.getCount();var k=0;for(var l=0;l<r;l++){var a=this.calx.store.getAt(l).data;tstdateini=new Date(a[this.calx.fieldsRefer.startdate]);tstdateend=new Date(a[this.calx.fieldsRefer.enddate]);checkdates=this.datetohandle.between(new Date(tstdateini),new Date(tstdateend));chkformat=this.datetohandle.format("m/d/Y");test=new Date(dateinit);if(test.format("m/d/Y")==chkformat){checkdates=true;}test=new Date(dateend);if(test.format("m/d/Y")==chkformat){checkdates=true;}var d=this.calx.dateDiff(tstdateini,tstdateend,e2cs.dateParts.DAY);if(d<1){if(tstdateini.between(q,g)&&tstdateend.between(q,g)){b[k]=a;k+=1;}}else{if(d>=1){if(tstdateini<q&&tstdateend>g){b[k]=a;k+=1;}else{if(tstdateini.between(q,g)||tstdateend.between(q,g)){b[k]=a;k+=1;}}}}}break;default:b=[];break;}return b;},showMoreTasksList:function(){taskstmp=this.getWeekTasks(this.datetohandle,0);showdata=[];for(var b=0;b<taskstmp.length;b++){showdata[b]=[taskstmp[b][this.calx.fieldsRefer.id],taskstmp[b][this.calx.fieldsRefer.subject],taskstmp[b][this.calx.fieldsRefer.description],taskstmp[b][this.calx.fieldsRefer.startdate],taskstmp[b][this.calx.fieldsRefer.enddate],taskstmp[b][this.calx.fieldsRefer.color],taskstmp[b][this.calx.fieldsRefer.location],taskstmp[b][this.calx.fieldsRefer.isHoliday],taskstmp[b][this.calx.fieldsRefer.alldaytask]];}if(this.alldayTaksMore=="event"){this.fireEvent("launchEventList",showdata[b]);return false;}else{if(this.alldayTaksMore=="window"){var a=new Ext.data.ArrayReader({},[{name:this.calx.fieldsRefer.id,type:"int"},{name:this.calx.fieldsRefer.subject,type:"string"},{name:this.calx.fieldsRefer.description,type:"string"},{name:this.calx.fieldsRefer.startdate,type:"string"},{name:this.calx.fieldsRefer.enddate,type:"string"},{name:this.calx.fieldsRefer.color,type:"string"},{name:this.calx.fieldsRefer.location,type:"string"},{name:this.calx.fieldsRefer.isHoliday,type:"boolean"},{name:this.calx.fieldsRefer.alldaytask,type:"boolean"}]);tmpstore=new Ext.data.Store({reader:a,data:showdata});tmppanel=new Ext.Panel({id:"ecal-more-task-panel",header:false,autoDestroy:true,autoScroll:true,monitorResize:true,border:false,autoWidth:false,autoHeight:false,items:new Ext.DataView({loadingText:e2cs.cal_locale.win_tasks_loading,store:tmpstore,tpl:this.alldayTaskTPL,autoWidth:true,autoHeight:true,overClass:"",itemSelector:"",emptyText:e2cs.cal_locale.win_tasks_empty})});var c=new Ext.Window({id:"ecal-win-moretasks",name:"ecal-win-moretasks",title:e2cs.cal_locale.win_week_zoomlabel,width:450,height:300,closeAction:"close",resizable:true,resizeHandles:"all",hideBorders:true,maximizable:true,plain:true,modal:true,layout:"fit",iconCls:"x-calendar-more-tasks-win",items:[tmppanel]});c.show();}}},formatdayTask:function(k,m,d,o){if(this.style=="plain"){var j=this.getWeekTasks(k,2);}else{var j=this.getWeekTasks(k,1);}var q=j.length;var b=Ext.get(this.calx.id+"-day"+m);var e=k.format("m/d/Y ")+this.startTime;var c=k.format("m/d/Y ")+this.endTime;this.totalhours=this.calx.dateDiff(new Date(e),new Date(c),e2cs.dateParts.HOUR);var i=this.checkTasktime(d.getAttributeNS("tag","ec_starts"));var a=this.checkTasktime(d.getAttributeNS("tag","ec_ends"));var p=this.calx.dateDiff(new Date(e),new Date(i),e2cs.dateParts.MINUTE);if(p<0){initpos=0;flagstarttasttext=e2cs.cal_locale.task_LessDaysFromTask;}else{initpos=p;flagstarttasttext="";}var g=this.calx.dateDiff(new Date(c),new Date(a),e2cs.dateParts.MINUTE);if(g>0){endpos=(this.totalhours+1)*60;endpos=Math.abs(initpos-endpos);flagendtasttext=e2cs.cal_locale.task_MoreDaysFromTask;}else{var n=new Date(i);var l=new Date(k.format("m/d/Y")+" "+this.startTime);if(n<l){endpos=this.calx.dateDiff(new Date(e),new Date(a),e2cs.dateParts.MINUTE);}else{endpos=this.calx.dateDiff(new Date(i),new Date(a),e2cs.dateParts.MINUTE);}if(endpos==(this.totalhours*60)){endpos=endpos;}else{if(endpos>(this.totalhours*60)){endpos=(this.totalhours*60);}}flagendtasttext="";}d.setHeight(endpos,false);if(this.forceTaskFit){var f=98/q;d.setStyle({width:""+f+"%"});d.setStyle({left:""+(f*o)+"%"});}else{d.setWidth(this.task_width,false);if(Ext.isOpera){var h=(o+1)*this.task_width;if(((o+1)*this.task_width)>b.getWidth(false)){d.setStyle("display","none");}if((o+1)>1){d.setLeft("0px");}}else{d.setLeft(""+(o*this.task_width)+"px");}}if(Ext.isOpera){d.setY(b.getY()+initpos);d.setStyle({top:""+initpos+"px"});d.setStyle("float","left");}else{d.setY(b.getY()+initpos);}if(Ext.isIE){d.setStyle("z-index","2000");}else{d.setStyle("z-index","auto");}},checkTasktime:function(a){if(a instanceof Date){var b=a.format("m/d/Y G:i");}else{var b=a;}var c=b.indexOf(":",0);if(c<=0){taskvaluefix=b+" "+this.startTime;}else{taskvaluefix=b;}return taskvaluefix;},getstartdayelements:function(c,b){var a=0;for(var d=0;d<7;d++){var e=c[0].add(Date.DAY,d);if(e.format("m/d/Y")==b.format("m/d/Y")){a=d;break;}}a+=1;return a;},formatallDayTask:function(c){var b=this.getDatesforWeek(this.datetohandle);var a=new Date(c.getAttributeNS("tag","ec_starts"));var d=new Date(c.getAttributeNS("tag","ec_ends"));var j=this.calx.dateDiff(a,d,e2cs.dateParts.DAY);if(j>7){j=7;}var e=new Date(a.format("m/d/Y ")+this.startTime);initdaystart=this.calx.dateDiff(b[0],e,e2cs.dateParts.DAY);if(initdaystart<0){j=this.calx.dateDiff(b[0],d,e2cs.dateParts.DAY);if(j>7){j=7;}initdaystart=0;}var f=Ext.get(this.calx.id+"-alldaycontainer");newposx=0;var m=this.getstartdayelements(b,a);initdaystart+=m;for(var g=1;g<m;g++){if(g>7){break;}newposx+=Ext.get(this.calx.id+"-allday"+(g+1)).getWidth(true);}if(Ext.isIE){c.setX(f.getX()+newposx);}else{c.setX(Ext.get(this.calx.id+"-allday"+m).getX());}ancho=0;if(d>b[1]){var n=0;var h=this.getAnchoalldaytoUse(a,d);var m=this.getstartdayelements(b,a);h+=m;for(var g=m;g<h;g++){if(g>7){break;}ancho+=Ext.get(this.calx.id+"-allday"+(g)).getWidth(false);n+=1;}if(Ext.isIE){n=-1;}c.setWidth(ancho+(n-1),false);}else{var n=0;if(j<=1){var l=new Date(a.format("m/d/Y G:i:s"));var k=new Date(d.format("m/d/Y G:i:s"));var o=new Date(k).add(Date.SECOND,-1);if(a.format("m/d/Y")==o.format("m/d/Y")){ancho+=Ext.get(this.calx.id+"-allday1").getWidth(false);}else{if(a.format("m/d/Y")!=d.format("m/d/Y")){var h=this.getAnchoalldaytoUse(a,d);var m=this.getstartdayelements(b,a);h+=m;for(var g=m;g<h;g++){if(g>7){break;}ancho+=Ext.get(this.calx.id+"-allday"+(g)).getWidth(false);n+=1;}}}}else{var h=this.getAnchoalldaytoUse(a,d);var m=this.getstartdayelements(b,a);h+=m;var n=0;for(var g=m;g<h;g++){if(g>7){break;}ancho+=Ext.get(this.calx.id+"-allday"+(g)).getWidth(false);n+=1;}}if(Ext.isIE){n=n*-1-1;}c.setWidth(ancho+(n-1),false);}},getAnchoalldaytoUse:function(f,e){var d=this.getDatesforWeek(this.datetohandle);count=0;countxx=0;var c=e.format("m/d/Y");if(f<=d[0]){var b=d[0];}else{var b=f;}while(countxx<99999){testdata=new Date(b).add(Date.DAY,count);varprueba=testdata.format("m/d/Y");var a=c;count+=1;if(varprueba==a){break;}countxx+=1;}return count;},onclickprev_week:function(){var b=this.datetohandle.add(Date.DAY,+(-7));var a=this.fireEvent("beforeWeekChange",this.datetohandle,b);if(a){this.datetohandle=b;this.calx.currentdate=b;this.render();this.fireEvent("afterWeekChange",b);}},onclicknext_week:function(){var b=this.datetohandle.add(Date.DAY,+(+7));var a=this.fireEvent("beforeWeekChange",this.datetohandle,b);if(a){this.datetohandle=b;this.calx.currentdate=b;this.render();this.fireEvent("afterWeekChange",b);}},genDaysHeader:function(a){var c="";c='<div id="'+this.calx.id+'-allday_w_task" class="allday_w_task">';c+='<div id="'+this.calx.id+'-alldaygridbodylayout" class="alldaygridbody">';c+='<table width="100%" border="1" cellpadding="0" cellspacing="1" bordercolor="#004E9B" bgcolor="#004E9B"><tr>';c+='<td width="50"><table width="50" border="0" align="center" cellpadding="0" cellspacing="0">';c+='<tr><td width="50" class="allday-marker" id="alldayrefer" ><div class="taskallday-layoutbase">&nbsp;</div>';c+="</td></tr></table></td>";for(var b=0;b<7;b++){var e=a.add(Date.DAY,b).format(this.dayformatLabel);var d=a.add(Date.DAY,b).format("m/d/Y");c+='<td valign="top"  class="x-calendar-weekv-header-days" dayval="'+d+'" id="'+this.calx.id+"-weekhdrday-"+(b+1)+'">'+e+"</td>";}c+="</tr></table></div></div>";return c;},genAlldayContainer:function(m){var k="";k+='<div id="'+this.calx.id+'-alldaycontainer" class="allday-container">';var b=this.getWeekTasks(this.datetohandle,0);if(b.length==0){k+="&nbsp;";}else{if(b.length<=this.alldayTasksMaxView){tasktoshow=b.length;}else{tasktoshow=this.alldayTasksMaxView;}for(var e=0;e<tasktoshow;e++){var o=new Date(b[e][this.calx.fieldsRefer.startdate]);var p=new Date(b[e][this.calx.fieldsRefer.enddate]);var n=b[e][this.calx.fieldsRefer.description];if(n.length>this.calx.tipmaxLength){var l=n.substring(0,this.calx.tipmaxLength)+"...";}else{var l=n;}var d={starxl:e2cs.cal_locale.task_qtip_starts,startval:o.format(this.task_format),endxl:e2cs.cal_locale.task_qtip_ends,endval:p.format(this.task_format),details:l,location:b[e][this.calx.fieldsRefer.location],alldaytask:b[e][this.calx.fieldsRefer.alldaytask],isHoliday:b[e][this.calx.fieldsRefer.isHoliday]};var h=this.calx.tplTaskTip.apply(d);k+='<div id="'+this.calx.id+"-ecal-alldaytask-"+e+'" class="taskallday-taskbase"  style="background-color:'+b[e][this.calx.fieldsRefer.color]+'"';k+='ext:qtitle="'+b[e][this.calx.fieldsRefer.subject]+'" ext:qtip="'+h+'"';k+='ec_id="'+b[e][this.calx.fieldsRefer.id]+'" ec_starts="'+b[e][this.calx.fieldsRefer.startdate]+'"';k+='ec_ends="'+b[e][this.calx.fieldsRefer.enddate]+'" ec_subject="'+b[e][this.calx.fieldsRefer.subject]+'"';k+='ec_cnt="'+b[e][this.calx.fieldsRefer.description]+'" ec_storeindex="'+e+'" ';k+='ec_location="'+b[e][this.calx.fieldsRefer.location]+'" ';k+='ec_allday="'+b[e][this.calx.fieldsRefer.alldaytask]+'" ';k+='ec_isholiday="'+b[e][this.calx.fieldsRefer.isHoliday]+'">';k+=b[e][this.calx.fieldsRefer.subject]+"</div>";}}k+="</div>";k+='<div id="'+this.calx.id+'-allday_w_task" class="allday_w_task">';k+='<div id="'+this.calx.id+'-alldaygridbodylayout" class="alldaygridbody">';k+='<table id="'+this.calx.id+'-tableallcontainer" width="100%" border="0" ';k+='cellpadding="0" cellspacing="1" bordercolor="#004E9B" bgcolor="#004E9B"><tr>';if(Ext.isIE){var c="51";}else{var c="51";}k+='<td class="" width="50">&nbsp;</td>';for(var f=0;f<7;f++){var g=m.add(Date.DAY,f).format(this.dayformatLabel);var a=m.add(Date.DAY,f).format("m/d/Y");k+='<td valign="top"  class="x-calendar-weekv-header-days" dayval="'+a+'" id="'+this.calx.id+"-weekhdrday-"+(f+1)+'">'+g+"</td>";}k+="</tr><tr><td>";k+='<table width="'+c+'" border="0" align="center" cellpadding="0" cellspacing="0">';k+='<tr><td width="50" class="allday-marker" id="alldayrefer" >';if(b.length){if(b.length<=this.alldayTasksMaxView){tasktoshow=b.length;}else{tasktoshow=this.alldayTasksMaxView;}for(var f=0;f<tasktoshow;f++){k+='<div class="taskallday-layoutbase">&nbsp;</div>';}}else{k+='<div class="taskallday-layoutbase">&nbsp;</div>';k+='<div class="taskallday-layoutbase">&nbsp;</div>';}k+="</td></tr></table></td>";for(var f=0;f<7;f++){todaytmp=new Date();gendatetd=m.add(Date.DAY,f);var g=gendatetd.format(this.dayformatLabel);if(f==0){k+='<td width="14%" bgcolor="#FFFFFF" valign="top" class="weekstartday" id="'+this.calx.id+"-allday"+(f+1)+'"><div>&nbsp;</div></td>';}else{if(f==6){k+='<td width="14%" bgcolor="#FFFFFF" valign="top" class="weekendday" id="'+this.calx.id+"-allday"+(f+1)+'"><div>&nbsp;</div></td>';}else{k+='<td width="14%" bgcolor="#FFFFFF" valign="top" class="weekmidday" id="'+this.calx.id+"-allday"+(f+1)+'"><div>&nbsp;</div></td>';}}}k+="</tr></table></div></div>";k+='<div id="alldaylistbutton" class="x-calendar-weekv-header-alldaylist">';k+=e2cs.cal_locale.alldayTasksMaxLabel+" </div>";return k;},genBody:function(c){var p=new Date(c);var b=new Date(p.format("m/d/Y")+" "+this.startTime);var x=new Date(p.format("m/d/Y")+" "+this.endTime);this.diffhrs=this.calx.dateDiff(b,x,e2cs.dateParts.HOUR);var w='<div id="'+this.calx.id+'-weekbodydisplay" class="weekbodydisplay">';var v="";if(Ext.isIE||Ext.isIE6){mydatacomp=' style="position:relative;" ';v="97";}else{mydatacomp="";v="100";}v="100";w+='<div id="'+this.calx.id+'-tableweek-layout">';w+='<table id="'+this.calx.id+'-week-skeleton" width="'+v+'%" border="0" cellspacing="1" cellpadding="0"'+mydatacomp+">";w+='<tr><td width="50"><table width="50" border="0" align="center" cellpadding="0" cellspacing="0">';for(var t=0;t<this.diffhrs;t++){tmpdatetohandleontd=p.format("m/d/Y");tmpdatetohandleontd+=" "+b.add(Date.HOUR,(t)).format("G");tmpdatetohandleontd+=":"+b.add(Date.HOUR,(t)).format("i");if(Ext.isIE){var n="hour-marker_ie";}else{var n="hour-marker";}w+='<tr><td id="'+this.calx.id+"-tdbody-weekv-"+tmpdatetohandleontd+'" class="'+n+'">';w+="<span>"+b.add(Date.HOUR,(t)).format(this.hourFormat)+"</span></td></tr>";}w+="</table></td>";for(var t=0;t<7;t++){gendatetddiv=c.add(Date.DAY,t);if(t==0){w+='<td width="14%" valign="top" class="weekstartday" id="'+this.calx.id+"-wd"+(t+1)+'">';}else{if(t==6){w+='<td width="14%" valign="top" class="weekendday" id="'+this.calx.id+"-wd"+(t+1)+'">';}else{w+='<td width="14%" valign="top" class="weekmidday" id="'+this.calx.id+"-wd"+(t+1)+'">';}}var f=new Date();if(gendatetddiv.format("m/d/Y")==f.format("m/d/Y")){w+='<div id="'+this.calx.id+"-day"+(t+1)+'" iddate="'+gendatetddiv.format("m/d/Y")+'" class="currentday"'+mydatacomp+">";}else{w+='<div id="'+this.calx.id+"-day"+(t+1)+'" iddate="'+gendatetddiv.format("m/d/Y")+'" class="basegridweek"'+mydatacomp+">";}if(this.style=="plain"){var e=this.getWeekTasks(gendatetddiv,2);}else{var e=this.getWeekTasks(gendatetddiv,1);}if(e.length==0){w+='<div id="containeronday" class="containeronday"'+mydatacomp+">";w+="&nbsp;";w+="</div>";}else{w+='<div id="containeronday" class="containeronday"'+mydatacomp+">";for(var s=0;s<e.length;s++){var k=new Date(e[s][this.calx.fieldsRefer.startdate]);var h=new Date(e[s][this.calx.fieldsRefer.enddate]);var u="";if(this.task_showqtip){var a=e[s][this.calx.fieldsRefer.description];if(a.length>this.calx.tipmaxLength){var q=a.substring(0,this.calx.tipmaxLength)+"...";}else{var q=a;}var m={starxl:e2cs.cal_locale.task_qtip_starts,startval:k.format(this.task_format),endxl:e2cs.cal_locale.task_qtip_ends,endval:h.format(this.task_format),details:q,location:e[s][this.calx.fieldsRefer.location],alldaytask:e[s][this.calx.fieldsRefer.alldaytask],isHoliday:e[s][this.calx.fieldsRefer.isHoliday]};var o=this.calx.tplTaskTip.apply(m);u='ext:qtitle="'+e[s][this.calx.fieldsRefer.subject]+'" ext:qtip="'+o+'"';}var l="";if(e[s][this.calx.fieldsRefer.color]){l=e[s][this.calx.fieldsRefer.color];}else{l=this.task_bgcolor_base;}if(this.calx.fieldsRefer.html!=""){var g=e[s][this.calx.fieldsRefer.html];if(g==null||g==undefined){var r="";var d="";}else{if(this.customHTMLinpos=="before"){var r=g+" ";var d="";}else{if(this.customHTMLinpos=="after"){var r="";var d=g+" ";}else{var r="";var d="";}}}}else{var r="";var d="";}w+='<div id="'+this.calx.id+"-ecal-daytask-"+this.taskelements+'" style="background-color:'+l+'" ';w+=u;w+='ec_id="'+e[s][this.calx.fieldsRefer.id]+'" ec_starts="'+e[s][this.calx.fieldsRefer.startdate]+'"';w+='ec_ends="'+e[s][this.calx.fieldsRefer.enddate]+'" ec_subject="'+e[s][this.calx.fieldsRefer.subject]+'"';w+='ec_cnt="'+e[s][this.calx.fieldsRefer.description]+'" ec_storeindex="'+s+'" ';w+='ec_location="'+e[s][this.calx.fieldsRefer.location]+'" ';w+='ec_allday="'+e[s][this.calx.fieldsRefer.alldaytask]+'" ';w+='ec_isholiday="'+e[s][this.calx.fieldsRefer.isHoliday]+'">';w+=r+e[s][this.calx.fieldsRefer.subject]+d+"</div>";this.taskelements+=1;}w+="</div>";}w+="</div></td>";}w+="</tr></table></div></div>";return w;}});