function loadTask(b,a){$.ajax({url:getContext()+"/RAjaxProjectManagerServlet/dummy",data:{Action:"loadTask",TaskId:b,ComponentId:a},success:function(c){displayTask(b,c);collapseTreeNodeDisplay(b);updateNumbering();highlightResponsible()},error:function(){$("#ajaxLoadError").dialog()},dataType:"json"})}function displayTask(b,c){var a=c.tasks.length-1;$.each(c.tasks,function(g,m){var k="taskRow"+m.id;var e="";var f="";switch(m.status){case 0:e="in_progress";f=$("#hiddenInProgressId").val();break;case 1:e="frozen";f=$("#hiddenFrozenId").val();break;case 2:e="lost";f=$("#hiddenCancelId").val();break;case 3:e="done";f=$("#hiddenDoneId").val();break;case 4:e="warning";f=$("#hiddenWarningId").val();break;case 5:default:e="not_started";f=$("#hiddenNotStartedId").val();break}if(m.level>1){e+=" under_task level"+(m.level-1);if(g==a){e+=" last_child"}}else{e+=" task_row"}var h='<tr id="'+k+'" class="'+e+'" title="childOf_">';h+='<td class="numerotation"></td>';h+='<td class="task_wording"><div>';if(m.containsSubTask==1){h+="<a href=\"javascript:loadTask('"+m.id+"', '"+c.componentId+'\');" class="linkSee"  id="taskLink'+m.id+'">';h+='<img border="0" alt="+" src="'+$("#hiddenExpandTreeImgId").val()+'" id="taskLinkImg'+m.id+'"></img>&#160;</a>'}h+='<a title="'+$("#hiddenResponsibleId").val()+" : "+m.manager+'" href="ViewTask?Id='+m.id+'" class="">'+m.name+"</a></div></td>";h+='<td class="state"><p>'+f+"</p></td>";h+='<td class="percentage"><p>'+m.percentage+" %</p></td>";var j=m.startDate;var d=m.endDate;$("#emptyDays td").each(function(i){var p=false;var n=$(this).text();var o=$(this).attr("class");if(n==j&&n==d){o+=" lenght_oneDay task_start";p=true}else{if(n==j){o+=" task_start";p=true}else{if(n==d){o+=" task_end";p=true}else{if(n>j&&n<d){o+=" task";p=true}}}}if(p){for(keyVar in listHolidays){if(listHolidays[keyVar]==n){o+=" day_unworked";break}}}h+='<td class="'+o+'">';if(p){h+="<div>&nbsp;<div><span>x</span></div></div>"}h+="</td>"});h+="</tr>";var l=$(""+h);$("#taskRow"+b).after(l);b=m.id})}function updateNumbering(){$("td .numerotation").each(function(a){$(this).text((a+1)+".")})}function collapseTreeNodeDisplay(a){$("#taskLink"+a).attr("href","javascript:collapseTask('"+a+"','"+$("#hiddenComponentId").val()+"');");$("#taskLinkImg"+a).attr("src",$("#hiddenCollapseTreeImgId").val());$("#taskLinkImg"+a).attr("alt","-")}function collapseTask(b,a){$.ajax({url:getContext()+"/RAjaxProjectManagerServlet/dummy",data:{Action:"collapseTask",TaskId:b,ComponentId:a},success:function(c){removeTask(c);expandTreeNodeDisplay(b)},error:function(){$("#ajaxLoadError").dialog()},dataType:"json"})}function expandTreeNodeDisplay(a){$("#taskLink"+a).attr("href","javascript:loadTask('"+a+"','"+$("#hiddenComponentId").val()+"');");$("#taskLinkImg"+a).attr("src",$("#hiddenExpandTreeImgId").val());$("#taskLinkImg"+a).attr("alt","+")}function removeTask(a){$.each(a.tasks,function(b,c){$("#taskRow"+c.id).remove()})};