var adjustGanttTable=function(){function Z(){this.current=this.end=this.head=null;this.size=0}function S(b,a,c){return b.split(a).join(c)}function oa(b){var a=1;b!=Math.abs(b)&&(a=-1);return a}function H(b,a){if(null==b||null==a||8!=b.length||8!=a.length)return 0;var c=b.substring(0,4),f=b.substring(4,6);b=b.substring(6,8);var g=a.substring(0,4),p=a.substring(4,6);a=a.substring(6,8);return(new Date(c,f-1,b)-new Date(g,p-1,a))/864E5}function F(b){var a=b.substring(0,2);b=b.substring(2,4);a=parseInt(a,
10)+parseInt(b,10)/60;return Math.round(100*a)/100}function pa(b,a,c){var f=b.substring(0,4),g=b.substring(4,6);b.substring(6);b=1;0==c&&(b=0);var p=Math.floor((Number(g)+Number(a)-Number(b))/12);g=(Number(g)+Number(a)-Number(b))%12;f=Number(f)+Number(p);a=new Date(f,g,c);return a.getFullYear()+("00"+(a.getMonth()+1)).slice(-2)+("00"+a.getDate()).slice(-2)}function G(b,a,c){var f=b.substring(0,4),g=b.substring(4,6),p=b.substring(6,8);f=new Date(f,g-1,p);g=f.getTime();b=b.substring(0,8);var d=H(b,
E);p=b=0;if("1"!=c||"true"!=T||13>=parseInt(l,10)||40<=parseInt(l,10)&&49>=parseInt(l,10)||isNaN(l))p=a;else if(0<a){for(c=d;b<=a;c++)null!=I[c]&&"0"!=I[c]||b++,p++;p--}else if(0>a){for(c=d;b>=a;c--)null!=I[c]&&"0"!=I[c]||b--,p--;p++}f.setTime(g+864E5*p);return f.getFullYear()+("00"+(f.getMonth()+1)).slice(-2)+("00"+f.getDate()).slice(-2)}function aa(b,a){var c=b.substring(0,8);(b=b.substring(8,12))||(b=w);b>z?b=z:b<w&&(b=w);b=F(b)+a;b>=F(z)?(a=Math.floor((b-F(z))/L)+1,b=(b-F(z))%L+F(w)):b<F(w)?(a=
Math.floor((b-F(w))/L),b=0==(b-F(w))%L?F(w):F(z)+(b-F(w))%L):a=0;c=G(c,a,"1");a=("00"+Math.floor(b).toString()).slice(-2);b=("00"+Math.floor(60*(b-Math.floor(b))).toString()).slice(-2);return c+(a+b)}function ba(b){if(null==b)return 0;b=H(b,E);return 13>=parseInt(l,10)||40<=parseInt(l,10)&&49>=parseInt(l,10)||isNaN(l)?Math.floor(b/P[l]):b}function Ia(b){b=ba(b);return"1"==I[b]?"true":"false"}function U(b,a,c){Q=document.getElementById(h.getAttribute("startDateInput"));switch(h.getAttribute("type")){case "0":Q.value=
G(h.getAttribute("startDT"),a,c);break;case "1":switch(V=document.getElementById(h.getAttribute("endDateInput")),b){case 1:Q.value=G(h.getAttribute("startDT"),a,c);break;case 3:V.value=G(h.getAttribute("endDT"),a,c);break;case 2:Q.value=G(h.getAttribute("startDT"),a,c),V.value=G(h.getAttribute("endDT"),a,c)}}}function za(b){b.preventDefault();ha=!0;h=b.target;if(null!=h){var a=h.offsetWidth;qa=Math.min(Math.max(a/3,2),20);switch(h.getAttribute("type")){case "0":K=2;h.style.cursor="move";break;case "1":b.offsetX<=
qa?(K=1,h.style.cursor="E-resize"):b.offsetX>a-qa?(K=3,h.style.cursor="E-resize"):(K=2,h.style.cursor="move")}h.setCapture&&h.setCapture();Aa=b.screenX;ia=h.parentNode.offsetLeft;ra=h.width;sa=h.parentNode.style.pixelLeft}}function Ba(b){if(ha&&(ha=!1,null!=h)){h.style.cursor="auto";h.releaseCapture&&h.releaseCapture();b=h.getAttribute("refid");var a=null;b&&(a=document.getElementById(b));Q&&(h.setAttribute("startDT",Q.value),a&&a.setAttribute("start",Q.value));V&&(h.setAttribute("endDT",V.value),
a&&a.setAttribute("end",V.value));M&&(h.setAttribute("startDT",h.startDT.substring(0,8)+M.value),a&&a.setAttribute("start",h.startDT.substring(0,8)+M.value));W&&(h.setAttribute("endDT",h.endDT.substring(0,8)+W.value),a&&a.setAttribute("end",h.endDT.substring(0,8)+W.value));K=0;if(h.getAttribute("chboxid")&&""!=h.getAttribute("chboxid")&&(b=h.getAttribute("chboxid"),a=document.getElementsByName(b),null!=a))for(b=0;b<a.length;b++){var c=a[b];"INPUT"!=c.tagName||"checkbox"!=c.type&&"radio"!=c.type||
(c.checked=!0)}}}function Ca(b){if(ha){b.preventDefault();var a=b.screenX-Aa;(1==K||2==K)&&0>sa+a&&(a=-sa);if((1==window.event.buttons||1==b.buttons||1==b.button)&&null!=h){if(13>=parseInt(l,10)||40<=parseInt(l,10)&&49>=parseInt(l,10)||isNaN(l))a=oa(a)*Math.ceil(Math.abs(a)/h.getAttribute("pixelPreSpan"))*h.getAttribute("pixelPreSpan");if(20<=parseInt(l,10)&&31>=parseInt(l,10))switch(h.getAttribute("moveStep")){case "1":a=oa(a)*Math.ceil(Math.abs(a)/(h.getAttribute("pixelPreSpan")*L))*h.getAttribute("pixelPreSpan")*
L;break;case "2":a=oa(a)*Math.ceil(Math.abs(a)/h.getAttribute("pixelPreSpan"))*h.getAttribute("pixelPreSpan")}switch(h.getAttribute("type")){case "0":switch(K){case 2:h.parentNode.style.left=parseInt(ia,10)+a+"px"}break;case "1":switch(K){case 1:h.parentNode.style.left=parseInt(ia,10)+a+"px";h.style.width=ra-a+"px";break;case 3:h.style.width=ra+a+"px";break;case 2:h.parentNode.style.left=parseInt(ia,10)+a+"px"}}try{if(13>=parseInt(l,10)||40<=parseInt(l,10)&&49>=parseInt(l,10)||isNaN(l))U(K,a/h.getAttribute("pixelPreSpan"),
"1");else if(null!=h.getAttribute("startTimeInput")&&12!=h.getAttribute("startDT").length)alert("Please set time by the format of the YYYYMMDDHH24MM. ("+h.getAttribute("startDT")+")");else{var c=a/h.getAttribute("pixelPreSpan");M=document.getElementById(h.getAttribute("startTimeInput"));switch(h.type){case "0":var f=aa(h.getAttribute("startDT"),c),g=f.substring(0,8),p=f.substring(8,12),d=H(g,h.getAttribute("startDT").substring(0,8));U(1,d,"0");M&&(M.value=p);break;case "1":switch(W=document.getElementById(h.getAttribute("endTimeInput")),
K){case 1:f=aa(h.getAttribute("startDT"),c);g=f.substring(0,8);p=f.substring(8,12);d=H(g,h.getAttribute("startDT").substring(0,8));U(1,d,"0");M.value=p;break;case 3:f=aa(h.getAttribute("endDT"),c);g=f.substring(0,8);p=f.substring(8,12);d=H(g,h.getAttribute("endDT").substring(0,8));U(3,d,"0");W.value=p;break;case 2:f=aa(h.getAttribute("startDT"),c),g=f.substring(0,8),p=f.substring(8,12),d=H(g,h.getAttribute("startDT").substring(0,8)),U(1,d,"0"),M.value=p,f=aa(h.getAttribute("endDT"),c),g=f.substring(0,
8),p=f.substring(8,12),d=H(g,h.getAttribute("endDT").substring(0,8)),U(3,d,"0"),W.value=p}}}}catch(n){}}}}function Ja(b,a,c,f,g){if(null!=document.getElementById("stack_"+b)&&null!=a&&null!=c&&null!=f&&null!=g){var p=ba(c),d=ba(f),n,e=0,q=H(f,c);if(0==q)return!1;if("false"==ca){var r=ba(c),t=ba(G(f,-1,0)),x=0;for(i=r;i<=t;i++)"1"==I[i]&&x++;q-=x}for(i=p;i<=d;i++)try{if("false"!=ca||"1"!=I[i])if(n=document.getElementById("stack_"+b+"_"+i))if(stackStart=n.startdate,stackEnd=n.enddate,!(f<stackStart||
stackEnd<c)){if(null==n.getAttribute("costList"))var u=Array(100);else if(u=n.getAttribute("costList"),!document.all){if(null==u)continue;u=u.split(",")}e=g*H(f<stackEnd?f:stackEnd,c>stackStart?c:stackStart)/q;u[a]=null!=u[a]?Number(u[a])+Number(e):Number(e);n.setAttribute("costList",u)}}catch(k){}}}function Da(b,a,c){if(null==b)return!1;iDiv=document.createElement("div");b.appendChild(iDiv);iDiv.style.position="relative";iDiv.style.height=c-2+"px";iDiv.style.width="100%";iDiv.style.fontSize="0";
for(i=0;i<a.length;i++){var f=document.createElement("div");f.className="stackDiv";f.style.position="absolute";f.style.width=N[l]+"px";f.style.height=c+"px";f.defHeight=c;f.style.left=i*N[l]+"px";f.style.top="0px";f.id="stack_"+b.getAttribute("stackrow")+"_"+i;"MONTH"!=l&&"42"!=l?(f.startdate=G(E,P[l]*i),f.enddate=G(E,P[l]*(i+1))):(f.startdate=pa(E,i,1),f.enddate=pa(E,i+1,1));iDiv.appendChild(f)}}function Ea(b,a,c){if(null==b||null==a)return!1;var f=N[l]/P[l];iDiv=document.createElement("div");b.appendChild(iDiv);
iDiv.style.position="relative";iDiv.style.height=c-2+"px";iDiv.style.width="100%";iDiv.style.left="-1px";iDiv.style.fontSize="0";for(var g=10,p=(c-10)/2-10;a.hasnext();){var d=a.next(),n=document.createElement("div");n.style.position="absolute";n.style.top=p+"px";n.setAttribute("stackrow",b.getAttribute("stackrow"));n.setAttribute("ganttrow",d.getAttribute("ganttrow"));var e=null!=d.getAttribute("start")&&0<d.getAttribute("start").length?S(S(S(d.getAttribute("start"),"/","")," ",""),":","").substring(0,
12):"0",q=null!=d.getAttribute("end")&&0<d.getAttribute("end").length?S(S(S(d.getAttribute("end"),"/","")," ",""),":","").substring(0,12):"0",r=e.substring(0,8),t=e.substring(8,12),x=q.substring(0,8),u=q.substring(8,12);if(null==t||0==t.length)t="0000";if(null==u||0==u.length)u="2400";"0"==e&&(r=x,t=u);d.getAttribute("end")||d.setAttribute("end",pa(r,0,0)+""+t);if("2400"<z){var k=parseInt(z,10)-2400,v=parseInt(t,10),A=parseInt(u,10);v<k&&(t=v+2400+"",r=G(r,-1));A<k&&(u=A+2400+"",x=G(x,-1))}try{switch(k=
null,d.getAttribute("type")){case "0":if(8==r.length)if(r>=O)r=O;else if(r<E)r=E,t=w;else{t<w&&(t=w);t>z&&(t=z);var D=H(r,E);if(13>=parseInt(l,10)||40<=parseInt(l,10)&&49>=parseInt(l,10)||isNaN(l)){var y=D*f;"0"==e&&(y+=f)}else{var C=0;if("true"==T){for(var B=C=0;B<D;B++)0<I[B]&&C++;D-=C}y=D*Math.ceil(ja/P[l])*N[l]+(parseInt(t.substring(0,2),10)-parseInt(w.substring(0,2),10)+(parseInt(t.substring(2),10)-parseInt(w.substring(2),10))/60)*f*("true"==T&&"true"==Ia(r)?0:1)}n.style.left=y+"px";k=document.createElement("img");
k.src=d.getAttribute("src");13>=parseInt(l,10)||40<=parseInt(l,10)&&49>=parseInt(l,10)||isNaN(l)?k.title=k.alt=r.substring(0,4)+"/"+r.substring(4,6)+"/"+r.substring(6,8):k.title=k.alt=r.substring(0,4)+"/"+r.substring(4,6)+"/"+r.substring(6,8)+" "+t.substring(0,2)+":"+t.substring(2,4);if(document.getElementById(d.getAttribute("startDateInput"))&&null!=d.getAttribute("startDateInput")||document.getElementById(d.getAttribute("startTimeInput"))&&null!=d.getAttribute("startTimeInput"))k.setAttribute("type",
d.getAttribute("type")),k.setAttribute("startDT",e),document.getElementById(d.getAttribute("startDateInput"))&&k.setAttribute("startDateInput",d.getAttribute("startDateInput")),document.getElementById(d.getAttribute("startTimeInput"))&&k.setAttribute("startTimeInput",d.getAttribute("startTimeInput")),k.setAttribute("pixelPreSpan",f),k.setAttribute("chboxid ",d.getAttribute("chboxid")),k.setAttribute("refid",d.getAttribute("id")),$(k).on("mousedown",function(J){za(J)}),$(k.ownerDocument).on("mousemove",
function(J){Ca(J)}),$(k.ownerDocument).on("mouseup",function(J){Ba(J)});n.appendChild(k);n.style.top=1*p+3+"px"}break;case "1":if(g="true"==ka?-5==g?5:-5:0,p=(c-10)/4+g,n.style.top=p+"px",v=x,!(r>x||r>O||x<E)){x=G(x,1);r<E&&(r=E,t=w);x>O&&(x=13>=parseInt(l,10)||40<=parseInt(l,10)&&49>=parseInt(l,10)||isNaN(l)?G(O,1,null):O,u=z);t<w&&(t=w);t>z&&(t=z);u>z&&(u=z);u<w&&(u=w);D=H(r,E);var da=H(x,E);if(13>=parseInt(l,10)||40<=parseInt(l,10)&&49>=parseInt(l,10)||isNaN(l)){y=D*f;var ta=da*f}else{C=0;if("true"==
T){for(B=C=0;B<D;B++)0<I[B]&&C++;D-=C;for(B=C=0;B<da;B++)0<I[B]&&C++;da-=C}y=D*Math.ceil(ja/P[l])*N[l]+(parseInt(t.substring(0,2),10)-parseInt(w.substring(0,2),10)+(parseInt(t.substring(2),10)-parseInt(w.substring(2),10))/60)*f;ta=(da-1)*Math.ceil(ja/P[l])*N[l]+(parseInt(u.substring(0,2),10)-parseInt(w.substring(0,2),10)+(parseInt(u.substring(2),10)-parseInt(w.substring(2),10))/60)*f}if(!(y>ta)&&(n.style.left=y+"px","true"==ea)){k=document.createElement("img");var la=d.getAttribute("color");if(la)0==
la.indexOf("src:")?k.src=la.substring(4)+".png":k.src="../image/W_"+la.toLowerCase()+".png";else{var fa=d.getAttribute("colorNo");if(fa){var ma=ua[fa];ma||(fa=parseInt(fa,10)%ua.length,ma=ua[fa]);k.src=ma?"../image/W_"+ma+".png":"../image/W_blue.png"}else k.src="../image/empty.png"}A=ta-y;0<X&&X<A&&(k.style.paddingLeft=X+"px",A-=X);0<Y&&Y<A&&(k.style.paddingRigth=Y+"px",A-=Y);k.style.width=A+"px";k.style.height="10px";13>=parseInt(l,10)||40<=parseInt(l,10)&&49>=parseInt(l,10)||isNaN(l)?k.title=k.alt=
r.substring(0,4)+"/"+r.substring(4,6)+"/"+r.substring(6,8)+"-"+v.substring(0,4)+"/"+v.substring(4,6)+"/"+v.substring(6,8):k.title=k.alt=r.substring(0,4)+"/"+r.substring(4,6)+"/"+r.substring(6,8)+" "+t.substring(0,2)+":"+t.substring(2,4)+"-"+v.substring(0,4)+"/"+v.substring(4,6)+"/"+v.substring(6,8)+" "+u.substring(0,2)+":"+u.substring(2,4);n.appendChild(k);if(document.getElementById(d.getAttribute("startDateInput"))&&null!=d.getAttribute("startDateInput")&&document.getElementById(d.getAttribute("endDateInput"))&&
null!=d.getAttribute("endDateInput")||document.getElementById(d.getAttribute("startTimeInput"))&&null!=d.getAttribute("startTimeInput")&&document.getElementById(d.getAttribute("endTimeInput"))&&null!=d.getAttribute("endTimeInput"))k.setAttribute("type",d.getAttribute("type")),k.setAttribute("startDT",e),k.setAttribute("endDT",q),document.getElementById(d.getAttribute("startDateInput"))&&k.setAttribute("startDateInput",d.getAttribute("startDateInput")),document.getElementById(d.getAttribute("startTimeInput"))&&
k.setAttribute("startTimeInput",d.getAttribute("startTimeInput")),document.getElementById(d.getAttribute("endDateInput"))&&k.setAttribute("endDateInput",d.getAttribute("endDateInput")),document.getElementById(d.getAttribute("endTimeInput"))&&k.setAttribute("endTimeInput",d.getAttribute("endTimeInput")),k.setAttribute("moveStep",d.getAttribute("moveStep")),k.setAttribute("pixelPreSpan",f),k.setAttribute("chboxid",d.getAttribute("chboxid")),k.setAttribute("refid",d.getAttribute("id")),$(k).on("mousedown",
function(J){za(J)}),$(k.ownerDocument).on("mousemove",function(J){Ca(J)}),$(k.ownerDocument).on("mouseup",function(J){Ba(J)});var Ka=document.createElement("br");n.appendChild(Ka)}}}}catch(J){}n.style.fontSize="12px";k&&(d.getAttribute("href")?d.getAttribute("barLink")?(n.appendChild(document.createTextNode(d.getAttribute("text"))),_target=d.getAttribute("target")?d.getAttribute("target"):"CONTENTS",$(n).html('<a href="'+d.getAttribute("href")+'" target="'+_target+'">'+$(n).html()+"</a>")):(e=document.createElement("a"),
e.href=d.getAttribute("href"),e.target=d.getAttribute("target")?d.getAttribute("target"):"CONTENTS",q=document.createTextNode(d.getAttribute("text")),e.appendChild(q),n.appendChild(e)):$(n).append(d.getAttribute("text")));iDiv.appendChild(n);"1"==d.getAttribute("type")&&d.getAttribute("cost")&&Ja(n.getAttribute("stackrow"),n.getAttribute("ganttrow"),r,x,d.getAttribute("cost"))}}function La(){var b=document.getElementById("viewTable");if(null==b)return!1;var a=document.getElementById("ganttHeaderData");
if(null==a)return!1;var c=document.getElementsByTagName("iGantt");if(null==c||0==c.length)return!1;$(".breaktime").hide();var f=a.getAttribute("calDB");if(null==f||0==f.length)return!1;l=a.getAttribute("zoom");E=a.getAttribute("startDate");O=a.getAttribute("endDate");na=a.getAttribute("daySpan");T=a.getAttribute("skipHoliday");ea=c[0].getAttribute("viewGantt")?c[0].getAttribute("viewGantt"):ea;va=c[0].getAttribute("viewMode")?c[0].getAttribute("viewMode"):va;ca=c[0].getAttribute("stackHoliday")?c[0].getAttribute("stackHoliday"):
ca;Fa=c[0].getAttribute("margeRows");ka=null!=c[0].getAttribute("verticalShift")?c[0].getAttribute("verticalShift"):ka;X=null!=c[0].getAttribute("paddingLeft")?c[0].getAttribute("paddingLeft"):X;Y=null!=c[0].getAttribute("paddingRigth")?c[0].getAttribute("paddingRigth"):Y;R=c[0].getAttribute("fixedCols");wa=null!=c[0].getAttribute("useBgColor")?c[0].getAttribute("useBgColor"):wa;viewNumberType=c[0].getAttribute("viewNumberType");if(null==l||null==E||null==O||null==na||!"0 1 2 3 4 5 6 7 8 9 10 13 20 21 22 23 24 25 26 27 28 29 30 31 DAY WEEK MONTH 40 41 42".split(" ").contains(l))return!1;
w=na.split("-")[0];z=na.split("-")[1];L=F(z)-F(w);ja=z>w?parseInt(z.substring(0,2),10)-parseInt(w.substring(0,2),10)+(parseInt(z.substring(2),10)-parseInt(w.substring(2),10))/60:24+parseInt(w.substring(0,2),10)-parseInt(z.substring(0,2),10)+(parseInt(w.substring(2),10)-parseInt(z.substring(2),10))/60;if("true"==T||"false"==ca)for(xa=f.length,I=Array(xa),a=0;a<xa;a++)I[a]=f.substr(a,1);var g=$(b).find("THEAD");$(g[0]).find("TR");var p=0;c=b.all?b.all.tags("TBODY"):$(b).find("TBODY");var d=c.length;
$(c[0]).find("TR");var n=$(c[0]).find("TD").length,e=c[0].offsetHeight;"true"==ka?40>e&&(e=40):30>e&&(e=30);var q=new Z,r=Array(n),t=Array(n),x=null;for(a=0;a<d;a++){var u=new Z;var k=$(c[a]).find("TD");for(var v=null,A=c[a].getAttribute("stackline"),D=c[a].getAttribute("stackrow"),y=0;y<n;y++)if(3>y&&"delete"!=viewNumberType)t[y]="";else if(k[y].firstChild&&"IGANTTBAR"==k[y].firstChild.tagName){v=k[y].childNodes;for(var C=0;C<v.length;C++)v[C].setAttribute("ganttrow",a),u.add(v[C]),v[C].getAttribute("capacity")&&
0<parseFloat(v[C].getAttribute("capacity"))&&document.getElementById("stack_"+c[a].getAttribute("stackrow")).setAttribute("capacity",v[C].getAttribute("capacity"));t[y]="";v=k[y];v.setAttribute("stackrow",D)}else t[y]=k[y].innerHTML;if(0==a)if(r=t.clone(),"true"==A)Da(v,f,e),q.head=null,q.size=0;else for(x=v;u.hasnext();)q.add(u.next());else{if("true"==Fa)for(y=k=0;y<n;y++){if(r[y]!=t[y]){r=t.clone();k=1;break}}else k=1;if(1==k)if(p+=e+2,"true"==A)Da(v,f,e),q.head=null,q.size=0;else for(Ea(x,q,e),
q.head=null,q.size=0,x=v;u.hasnext();)q.add(u.next());else{for(;u.hasnext();)q.add(u.next());c[a].parentNode.removeChild(c[a]);"function"==typeof c.splice&&c.splice(a,1);c.length<d&&(a--,d--)}}}d=c.length;if("true"==wa)for(a=0;a<d;a++)c[a].className="row_"+a%2;if("delete"!=viewNumberType)for(a=0;a<d;a++)$($(c[a]).find("TD")[2]).text(a+1);p+=e+2;Ea(x,q,e);"false"==ea?$("tbody[stackline=false]").hide():"expand"==ea&&$("tbody[stackline=false]").hide();q.head=null;q.size=0;d=$(g[0]).find("SPAN");for(a=
c=0;a<d.length;a++)"breaktime"==d[a].className&&c++;d=$(b).find("SPAN");f=0;if(null!=d)for(a=0;a<d.length;a++)"breaktime"==d[a].className&&(f++,d[a].style.height=f<=c?p+"px":"0px");c=$(b).find("TBODY");d=c.length;for(a=0;a<d;a++)if("true"==c[a].getAttribute("stackline")){f=c[a];b=$(f).find(".stackDiv");p=b[0].defHeight;f=f.getAttribute("capacity")?f.getAttribute("capacity"):1;g=Array(b.length);for(i=n=0;i<b.length;i++){g[i]=0;e=b[i].getAttribute("costList");if(!document.all){if(null==e)continue;e=
e.split(",")}for(j in e)null!=e[j]&&isFinite(e[j])&&(g[i]+=Number(e[j]));g[i]>n&&(n=Number(g[i]))}for(i=0;i<b.length;i++)try{e=1.5*f;q=0;0<n&&(q="1"==va?Math.round(g[i]/n*p):Math.round(g[i]/f*p*2/3));q>p&&(q=p);b[i].style.height=q+"px";b[i].style.top=p-q+"px";var B=$(b[i]);B.removeClass("stdcost");B.removeClass("uppercost");B.removeClass("lowercost");g[i]>e?B.addClass("errorcost"):g[i]<=f?B.addClass("stdcost"):B.addClass("warncost");0!=g[i]&&B.html('<span style="width;'+B.css("width")+'; text-align: center; bottom:0px; font-size: x-small; position: absolute;">'+
g[i].toFixed(2)+"</span>")}catch(da){}}0<R&&ya("viewTable",R);$(".breaktime").show();$("#viewTable").css("visibility","visible")}function Ga(b,a){"undefined"!=typeof b.checked?a.checked=b.checked:"undefined"!=typeof b.selected?a.selected=b.selected:"textarea"==b.type&&(a.value=b.value);try{for(var c=0;c<b.childNodes.length;c++){var f=b.childNodes.item(c);var g=a.childNodes.item(c);Ga(f,g)}}catch(p){}}function Ha(b,a){this.row=b;this.col=a}function ya(b,a){a=parseInt(a||"0",10);colWidths=[];ourterDiv=
document.createElement("DIV");fixedHeaderDiv=ourterDiv.cloneNode(!1);scrollHeaderBaseDiv=ourterDiv.cloneNode(!1);scrollHeaderDiv=ourterDiv.cloneNode(!1);fixBodyBaseDiv=ourterDiv.cloneNode(!1);fixBodyDiv=ourterDiv.cloneNode(!1);scrollBodyDiv=ourterDiv.cloneNode(!1);scrollBodyTable=document.getElementById(b);if(null==scrollBodyTable)return!1;var c=scrollBodyTable.offsetWidth,f=scrollBodyTable.offsetHeight,g=scrollBodyTable.tHead;b=g?g.offsetHeight:scrollBodyTable.tBody[0].offsetHeight;if(null==scrollBodyTable||
0>=a)return!0;ourterDiv.id="ourterDiv";fixedHeaderDiv.id="fixedHeaderDiv";scrollHeaderBaseDiv.id="scrollHeaderBaseDiv";scrollHeaderDiv.id="scrollHeaderDiv";fixBodyBaseDiv.id="fixBodyBaseDiv";fixBodyDiv.id="fixBodyDiv";scrollBodyDiv.id="scrollBodyDiv";colGroupStyle=document.createElement("COLGROUP");var p=getClientWidth(),d=scrollBodyTable.offsetTop,n=getClientHeight();for(e=scrollBodyTable.getElementsByTagName("COLGROUP").length-1;0<=e;e--)scrollBodyTable.removeChild(scrollBodyTable.getElementsByTagName("COLGROUP")[e]);
sParent=scrollBodyTable.parentNode;sParentHeight=sParent.offsetHeight;sParentWidth=sParent.offsetWidth;var e,q;scrollHeaderTable=scrollBodyTable.cloneNode(!1);scrollHeaderTable.id="scrollHeaderTable";g?scrollHeaderTable.appendChild(g.cloneNode(!0)):(e=scrollBodyTable.tBodies[0],scrollHeaderTable.appendChild(e.cloneNode(!0)));scrollHeaderDiv.appendChild(scrollHeaderTable);fixedHeaderTable=scrollHeaderTable.cloneNode(!0);fixedHeaderTable.id="fixedHeaderTable";fixedHeaderDiv.appendChild(fixedHeaderTable);
fixedBodyTable=scrollBodyTable.cloneNode(!0);Ga(scrollBodyTable,fixedBodyTable);fixedBodyTable.id="fixedBodyTable";fixBodyDiv.appendChild(fixedBodyTable);var r=scrollBodyTable.tBodies[0].rows,t=r.length,x=0,u=0,k=0,v=r[0].cells.length;for(e=0;e<v;e++)k+=r[0].cells[e].colSpan;var A=Array(t),D=Array(t);for(rowId=0;rowId<t+1;rowId++)A[rowId]=Array(k),D[rowId]=0;for(rowId=0;rowId<t;rowId++)for(v=r[rowId].cells.length,colId=0;colId<v;colId++)for(u=r[rowId].cells[colId].rowSpan,x=r[rowId].cells[colId].colSpan,
q=0;q<x;q++){for(e=0;e<u;e++){for(m=0;m<k;m++)null!=A[rowId+e]&&null!=A[rowId+e][D[rowId]]&&D[rowId]++;A[rowId+e][D[rowId]]=new Ha(rowId,colId)}D[rowId]++}u=[];for(q=v=0;q<k;q++)for(e=0;e<t;e++)if(x=r[A[e][q].row].cells[A[e][q].col].colSpan,1==x){u[v]=new Ha(A[e][q].row,A[e][q].col);v++;break}for(e=0;e<k;e++)colWidths[e]=r[u[e].row].cells[u[e].col].offsetWidth;for(e=v=t=q=0;e<k;e++)0<colWidths[e]?colWidths[e]-=0:(e<a&&(q+=0),t+=0),e+=g.rows[0].cells[v++].colSpan-1;a=r[u[a].row].cells[u[a].col].offsetLeft+
q;e=0;for(q=colWidths.length;e<q;e++)colGroupStyle.appendChild(document.createElement("COL")),colGroupStyle.lastChild.setAttribute("width",colWidths[e]+"px"),$(colGroupStyle.lastChild).css("width",colWidths[e]);scrollBodyTable.insertBefore(colGroupStyle.cloneNode(!0),scrollBodyTable.firstChild);$(scrollBodyTable).css("width",c+"px");scrollHeaderTable.insertBefore(colGroupStyle.cloneNode(!0),scrollHeaderTable.firstChild);$(scrollHeaderTable).css("width",c+"px");fixedBodyTable.insertBefore(colGroupStyle.cloneNode(!0),
fixedBodyTable.firstChild);$(fixedBodyTable).css("width",c+"px");fixedHeaderTable.insertBefore(colGroupStyle.cloneNode(!0),fixedHeaderTable.firstChild);$(fixedHeaderTable).css("width",c+"px");sParent.insertBefore(ourterDiv,scrollBodyTable);ourterDiv.appendChild(fixedHeaderDiv);scrollHeaderBaseDiv.appendChild(scrollHeaderDiv);ourterDiv.appendChild(scrollHeaderBaseDiv);ourterDiv.appendChild(fixBodyBaseDiv);fixBodyBaseDiv.appendChild(fixBodyDiv);ourterDiv.appendChild(scrollBodyDiv);scrollBodyDiv.appendChild(scrollBodyTable);
e=scrollBodyTable.getElementsByTagName("input");for(g=e.length;0<=--g;)e[g].setAttribute("disabled","true"),e[g].setAttribute("name",""),e[g].setAttribute("id","");e=scrollBodyTable.getElementsByTagName("select");for(g=e.length;0<=--g;)e[g].setAttribute("disabled","true");fixedHeaderDiv.style.width=a+"px";c+=t;c=c+16>p?p:c+16;d=f+20>n-d?n-d:f+20;ourterDiv.style.width=c+"px";ourterDiv.style.height=d+"px";f="margin-top: "+-1*b+"px;margin-left: "+(-1*a+"px;table-layout: fixed;");f+="visibility:visible;";
b="margin-top: "+b+"px;height: "+(d-b+"px;margin-left: ")+(a+"px;width: ")+(c-a+"px;");scrollBodyDiv.style.cssText=b;scrollBodyTable.style.cssText=f;scrollBodyDiv.onscroll=function(){scrollHeaderDiv.style.right=scrollBodyDiv.scrollLeft+"px";fixBodyDiv.style.top=-1*scrollBodyDiv.scrollTop+"px"};return!0}function Ma(){var b=document.getElementsByTagName("iTask");if(null==b||0==b.length)return!1;var a=document.getElementById("viewTable");if(null==a)return!1;var c=document.getElementById("ganttHeaderData");
if(null==c)return!1;l=c.getAttribute("zoom");a=$(a).find("TBODY")[0].offsetHeight;30>a&&(a=30);c=$(".stackDivParent");var f=c.length;for(i=0;i<f;i++){var g=c[i].childNodes,p=c[i].parentNode,d=parseFloat(c[i].getAttribute("capacity"));p.style.cssText="text-align:left;background-image: url('../image/stackBG"+l+".gif')";c[i].style.height=a+"px";c[i].style.overflow="hidden";c[i].style.top="0px";p=g.length;for(j=0;j<p;j++)if("stackDiv"==g[j].className){g[j].style.left=j*N[l]-1+"px";g[j].style.width=N[l]+
"px";var n=parseFloat(g[j].getAttribute("stackedCost")),e=0;n<=d?($(g[j]).addClass("stdcost"),e=n*a/d*1.5):n<=1.5*d?($(g[j]).addClass("warncost"),e=n*a/d*1.5):n>1.5*d&&($(g[j]).addClass("errorcost"),e=a);g[j].style.height=e+"px";g[j].style.top=a-e+"px";0<n&&$(g[j]).html('<span style="text-align: center; bottom:0px; font-size: x-small; position: absolute;">'+n.toFixed(2)+"</span>")}}R=parseInt(b[0].getAttribute("fixedCols")||"0",10);ya("viewTable",R)}var l,E,O,na,T,I,ka="true",X=0,Y=0,Fa="false",R=
0,wa="true",ea="true",va="1",ca="true",ja,w,z,L,h=null,Aa,ia,ra,sa,Q=null,V=null,M=null,W=null,xa=0,qa=2,K,ha=!1,N={0:48,1:24,2:12,3:56,4:56,5:90,6:60,7:90,8:90,9:60,10:24,13:16,20:48,21:24,22:48,23:24,24:48,25:24,26:48,27:24,28:48,29:24,30:48,31:24,DAY:48,WEEK:48,MONTH:90,40:48,41:48,42:90},P={0:1,1:1,2:1,3:7,4:14,5:30,6:30,7:90,8:180,9:180,10:7,13:1,20:1,21:1,22:2,23:2,24:4,25:4,26:6,27:6,28:8,29:8,30:12,31:12,DAY:1,WEEK:7,MONTH:30,40:1,41:7,42:30},ua={0:"blue",1:"black",2:"brown",3:"green",4:"lightblue",
5:"lightgreen",6:"orange",7:"pink",8:"purple",9:"red",10:"yellow",11:"navy",12:"teal",13:"gray",14:"indigo",15:"slategray",16:"chocolate",17:"darkgreen",18:"violet",19:"darkslategray",20:"lime",21:"aqua",22:"maroon",23:"olive",24:"silver",25:"fuchsia",BK:"black2",WT:"white2",BL:"blue2",RD:"red2",YL:"yellow2",length:26};Z.prototype.add=function(b){b={obj:b,next:null};this.head?this.end=this.end.next=b:this.current=this.end=this.head=b;this.size++};Z.prototype.next=function(){var b=null;this.current&&
(b=this.current.obj,this.current=this.current.next);return b};Z.prototype.hasnext=function(){return null!=this.current?!0:!1};Array.prototype.clone=function(){return Array.apply(null,this)};Array.prototype.contains=function(b){for(var a=0;a<this.length;a++)if(this[a]===b)return!0;return!1};return function(b){addBrowserClass();"adjustTable"==b?(b=document.getElementsByTagName("iTable"),null!=b&&0!=b.length&&(R=parseInt(b[0].getAttribute("fixedCols")||"0",10),ya("viewTable",R))):"adjustGantt"==b?La():
"adjustTask"==b&&Ma()}}();function adjustTable(){0==$("body").width()||100==$("body").width()?setTimeout(function(){adjustTable()},1):adjustGanttTable("adjustTable")}function adjustGantt(){0==$("body").width()||100==$("body").width()?setTimeout(function(){adjustGantt()},1):adjustGanttTable("adjustGantt")}function adjustTask(){0==$("body").width()||100==$("body").width()?setTimeout(function(){adjustTask()},1):adjustGanttTable("adjustTask")};
