var JSGantt;if(!JSGantt)JSGantt={};var vTimeout=0;var vBenchTime=new Date().getTime();JSGantt.TaskItem=function(pID,pName,pStart,pEnd,pColor,pLink,pMile,pRes,pComp,pGroup,pParent,pOpen,pDepend,pCaption){var vID=pID;var vName=pName;var vStart=new Date();var vEnd=new Date();var vColor=pColor;var vLink=pLink;var vMile=pMile;var vRes=pRes;var vComp=pComp;var vGroup=pGroup;var vParent=pParent;var vOpen=pOpen;var vDepend=pDepend;var vCaption=pCaption;var vDuration='';var vLevel=0;var vNumKid=0;var vVisible=1;var x1,y1,x2,y2;if(vGroup!=1){vStart=JSGantt.parseDateStr(pStart,g.getDateInputFormat());vEnd=JSGantt.parseDateStr(pEnd,g.getDateInputFormat())}this.getID=function(){return vID};this.getName=function(){return vName};this.getStart=function(){return vStart};this.getEnd=function(){return vEnd};this.getColor=function(){return vColor};this.getLink=function(){return vLink};this.getMile=function(){return vMile};this.getDepend=function(){if(vDepend)return vDepend;else return null};this.getCaption=function(){if(vCaption)return vCaption;else return''};this.getResource=function(){if(vRes)return vRes;else return' '};this.getCompVal=function(){if(vComp)return vComp;else return 0};this.getCompStr=function(){if(vComp)return vComp+'%';else return''};this.getDuration=function(vFormat){if(vMile)vDuration='-';else if(vFormat=='hour'){tmpPer=Math.ceil((this.getEnd()-this.getStart())/(60*60*1000));if(tmpPer==1)vDuration='1 Hour';else vDuration=tmpPer+' Hours'}else if(vFormat=='minute'){tmpPer=Math.ceil((this.getEnd()-this.getStart())/(60*1000));if(tmpPer==1)vDuration='1 Minute';else vDuration=tmpPer+' Minutes'}else{tmpPer=Math.ceil((this.getEnd()-this.getStart())/(24*60*60*1000)+1);if(tmpPer==1)vDuration='1 Day';else vDuration=tmpPer+' Days'}return(vDuration)};this.getParent=function(){return vParent};this.getGroup=function(){return vGroup};this.getOpen=function(){return vOpen};this.getLevel=function(){return vLevel};this.getNumKids=function(){return vNumKid};this.getStartX=function(){return x1};this.getStartY=function(){return y1};this.getEndX=function(){return x2};this.getEndY=function(){return y2};this.getVisible=function(){return vVisible};this.setDepend=function(pDepend){vDepend=pDepend};this.setStart=function(pStart){vStart=pStart};this.setEnd=function(pEnd){vEnd=pEnd};this.setLevel=function(pLevel){vLevel=pLevel};this.setNumKid=function(pNumKid){vNumKid=pNumKid};this.setCompVal=function(pCompVal){vComp=pCompVal};this.setStartX=function(pX){x1=pX};this.setStartY=function(pY){y1=pY};this.setEndX=function(pX){x2=pX};this.setEndY=function(pY){y2=pY};this.setOpen=function(pOpen){vOpen=pOpen};this.setVisible=function(pVisible){vVisible=pVisible}};JSGantt.GanttChart=function(pGanttVar,pDiv,pFormat){var vGanttVar=pGanttVar;var vDiv=pDiv;var vFormat=pFormat;var vShowRes=1;var vShowDur=1;var vShowComp=1;var vShowStartDate=1;var vShowEndDate=1;var vDateInputFormat="mm/dd/yyyy";var vDateDisplayFormat="mm/dd/yy";var vNumUnits=0;var vCaptionType;var vDepId=1;var vTaskList=new Array();var vFormatArr=new Array("day","week","month","quarter");var vQuarterArr=new Array(1,1,1,2,2,2,3,3,3,4,4,4);var vMonthDaysArr=new Array(31,28,31,30,31,30,31,31,30,31,30,31);var vMonthArr=new Array("January","February","March","April","May","June","July","August","September","October","November","December");this.setFormatArr=function(){vFormatArr=new Array();for(var i=0;i4){vFormatArr.length=4}};this.setShowRes=function(pShow){vShowRes=pShow};this.setShowDur=function(pShow){vShowDur=pShow};this.setShowComp=function(pShow){vShowComp=pShow};this.setShowStartDate=function(pShow){vShowStartDate=pShow};this.setShowEndDate=function(pShow){vShowEndDate=pShow};this.setDateInputFormat=function(pShow){vDateInputFormat=pShow};this.setDateDisplayFormat=function(pShow){vDateDisplayFormat=pShow};this.setCaptionType=function(pType){vCaptionType=pType};this.setFormat=function(pFormat){vFormat=pFormat;this.Draw()};this.getShowRes=function(){return vShowRes};this.getShowDur=function(){return vShowDur};this.getShowComp=function(){return vShowComp};this.getShowStartDate=function(){return vShowStartDate};this.getShowEndDate=function(){return vShowEndDate};this.getDateInputFormat=function(){return vDateInputFormat};this.getDateDisplayFormat=function(){return vDateDisplayFormat};this.getCaptionType=function(){return vCaptionType};this.CalcTaskXY=function(){var vList=this.getList();var vTaskDiv;var vParDiv;var vLeft,vTop,vHeight,vWidth;for(i=0;i0){JSGantt.processRows(vTaskList,0,-1,1,1);vMinDate=JSGantt.getMinDate(vTaskList,vFormat);vMaxDate=JSGantt.getMaxDate(vTaskList,vFormat);if(vFormat=='day'){vColWidth=18;vColUnit=1}else if(vFormat=='week'){vColWidth=37;vColUnit=7}else if(vFormat=='month'){vColWidth=37;vColUnit=30}else if(vFormat=='quarter'){vColWidth=60;vColUnit=90}else if(vFormat=='hour'){vColWidth=18;vColUnit=1}else if(vFormat=='minute'){vColWidth=18;vColUnit=1}vNumDays=(Date.parse(vMaxDate)-Date.parse(vMinDate))/(24*60*60*1000);vNumUnits=vNumDays/vColUnit;vChartWidth=vNumUnits*vColWidth+1;vDayWidth=(vColWidth/vColUnit)+(1/vColUnit);vMainTable=''+'';vMainTable+=vLeftTable;vRightTable='
';if(vShowRes!=1)vNameWidth+=vStatusWidth;if(vShowDur!=1)vNameWidth+=vStatusWidth;if(vShowComp!=1)vNameWidth+=vStatusWidth;if(vShowStartDate!=1)vNameWidth+=vStatusWidth;if(vShowEndDate!=1)vNameWidth+=vStatusWidth;vLeftTable='
'+''+' '+' ';if(vShowRes==1)vLeftTable+=' ';if(vShowDur==1)vLeftTable+=' ';if(vShowComp==1)vLeftTable+=' ';if(vShowStartDate==1)vLeftTable+=' ';if(vShowEndDate==1)vLeftTable+=' ';vLeftTable+=''+' '+' ';if(vShowRes==1)vLeftTable+=' ';if(vShowDur==1)vLeftTable+=' ';if(vShowComp==1)vLeftTable+=' ';if(vShowStartDate==1)vLeftTable+=' ';if(vShowEndDate==1)vLeftTable+=' ';vLeftTable+='';for(i=0;i';vLeftTable+=' '+' ';if(vShowRes==1)vLeftTable+=' ';if(vShowDur==1)vLeftTable+=' ';if(vShowComp==1)vLeftTable+=' ';if(vShowStartDate==1)vLeftTable+=' ';if(vShowEndDate==1)vLeftTable+=' ';vLeftTable+=''}vLeftTable+=''+'
ResourceDuration% Comp.Start DateEnd Date
 ';for(j=1;j';if(vTaskList[i].getGroup()){if(vTaskList[i].getOpen()==1)vLeftTable+=' ';else vLeftTable+='+ '}else{vLeftTable+='   '}vLeftTable+=' '+vTaskList[i].getName()+''+vTaskList[i].getResource()+''+vTaskList[i].getDuration(vFormat)+''+vTaskList[i].getCompStr()+''+JSGantt.formatDateStr(vTaskList[i].getStart(),vDateDisplayFormat)+''+JSGantt.formatDateStr(vTaskList[i].getEnd(),vDateDisplayFormat)+'
  Powered by jsGantt      Format:';if(vFormatArr.join().indexOf("minute")!=-1){if(vFormat=='minute')vLeftTable+='Minute';else vLeftTable+='Minute'}if(vFormatArr.join().indexOf("hour")!=-1){if(vFormat=='hour')vLeftTable+='Hour';else vLeftTable+='Hour'}if(vFormatArr.join().indexOf("day")!=-1){if(vFormat=='day')vLeftTable+='Day';else vLeftTable+='Day'}if(vFormatArr.join().indexOf("week")!=-1){if(vFormat=='week')vLeftTable+='Week';else vLeftTable+='Week'}if(vFormatArr.join().indexOf("month")!=-1){if(vFormat=='month')vLeftTable+='Month';else vLeftTable+='Month'}if(vFormatArr.join().indexOf("quarter")!=-1){if(vFormat=='quarter')vLeftTable+='Quarter';else vLeftTable+='Quarter'}vLeftTable+='
'+'
'+''+'';vTmpDate.setFullYear(vMinDate.getFullYear(),vMinDate.getMonth(),vMinDate.getDate());vTmpDate.setHours(0);vTmpDate.setMinutes(0);while(Date.parse(vTmpDate)<=Date.parse(vMaxDate)){vStr=vTmpDate.getFullYear()+'';vStr=vStr.substring(2,4);if(vFormat=='minute'){vRightTable+='';vTmpDate.setHours(vTmpDate.getHours()+1)}if(vFormat=='hour'){vRightTable+='';vTmpDate.setDate(vTmpDate.getDate()+1)}if(vFormat=='day'){vRightTable+='';vTmpDate.setDate(vTmpDate.getDate()+1)}else if(vFormat=='week'){vRightTable+='';vTmpDate.setDate(vTmpDate.getDate()+7)}else if(vFormat=='month'){vRightTable+='';vTmpDate.setDate(vTmpDate.getDate()+1);while(vTmpDate.getDate()>1){vTmpDate.setDate(vTmpDate.getDate()+1)}}else if(vFormat=='quarter'){vRightTable+='';vTmpDate.setDate(vTmpDate.getDate()+81);while(vTmpDate.getDate()>1){vTmpDate.setDate(vTmpDate.getDate()+1)}}}vRightTable+='';vTmpDate.setFullYear(vMinDate.getFullYear(),vMinDate.getMonth(),vMinDate.getDate());vNxtDate.setFullYear(vMinDate.getFullYear(),vMinDate.getMonth(),vMinDate.getDate());vNumCols=0;while(Date.parse(vTmpDate)<=Date.parse(vMaxDate)){if(vFormat=='minute'){if(vTmpDate.getMinutes()==0)vWeekdayColor="ccccff";else vWeekdayColor="ffffff";vDateRowStr+='';vItemRowStr+='';vTmpDate.setMinutes(vTmpDate.getMinutes()+1)}else if(vFormat=='hour'){if(vTmpDate.getHours()==0)vWeekdayColor="ccccff";else vWeekdayColor="ffffff";vDateRowStr+='';vItemRowStr+='';vTmpDate.setHours(vTmpDate.getHours()+1)}else if(vFormat=='day'){if(JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy')==JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy')){vWeekdayColor="ccccff";vWeekendColor="9999ff";vWeekdayGColor="bbbbff";vWeekendGColor="8888ff"}else{vWeekdayColor="ffffff";vWeekendColor="cfcfcf";vWeekdayGColor="f3f3f3";vWeekendGColor="c3c3c3"}if(vTmpDate.getDay()%6==0){vDateRowStr+='';vItemRowStr+=''}else{vDateRowStr+='';if(JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy')==JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy'))vItemRowStr+='';else vItemRowStr+=''}vTmpDate.setDate(vTmpDate.getDate()+1)}else if(vFormat=='week'){vNxtDate.setDate(vNxtDate.getDate()+7);if(vCurrDate>=vTmpDate&&vCurrDate
'+(vTmpDate.getMonth()+1)+'/'+vTmpDate.getDate()+'
';if(vCurrDate>=vTmpDate&&vCurrDate
  
';else vItemRowStr+='
'}else{vDateRowStr+='';if(vCurrDate>=vTmpDate&&vCurrDate
  
';else vItemRowStr+='
'}vTmpDate.setDate(vTmpDate.getDate()+7)}else if(vFormat=='month'){vNxtDate.setFullYear(vTmpDate.getFullYear(),vTmpDate.getMonth(),vMonthDaysArr[vTmpDate.getMonth()]);if(vCurrDate>=vTmpDate&&vCurrDate
'+vMonthArr[vTmpDate.getMonth()].substr(0,3)+'
';if(vCurrDate>=vTmpDate&&vCurrDate
  
';else vItemRowStr+='
'}else{vDateRowStr+='';if(vCurrDate>=vTmpDate&&vCurrDate
  
';else vItemRowStr+='
'}vTmpDate.setDate(vTmpDate.getDate()+1);while(vTmpDate.getDate()>1){vTmpDate.setDate(vTmpDate.getDate()+1)}}else if(vFormat=='quarter'){vNxtDate.setDate(vNxtDate.getDate()+122);if(vTmpDate.getMonth()==0||vTmpDate.getMonth()==1||vTmpDate.getMonth()==2)vNxtDate.setFullYear(vTmpDate.getFullYear(),2,31);else if(vTmpDate.getMonth()==3||vTmpDate.getMonth()==4||vTmpDate.getMonth()==5)vNxtDate.setFullYear(vTmpDate.getFullYear(),5,30);else if(vTmpDate.getMonth()==6||vTmpDate.getMonth()==7||vTmpDate.getMonth()==8)vNxtDate.setFullYear(vTmpDate.getFullYear(),8,30);else if(vTmpDate.getMonth()==9||vTmpDate.getMonth()==10||vTmpDate.getMonth()==11)vNxtDate.setFullYear(vTmpDate.getFullYear(),11,31);if(vCurrDate>=vTmpDate&&vCurrDate
Qtr. '+vQuarterArr[vTmpDate.getMonth()]+'
';if(vCurrDate>=vTmpDate&&vCurrDate
  
';else vItemRowStr+='
'}else{vDateRowStr+='';if(vCurrDate>=vTmpDate&&vCurrDate
  
';else vItemRowStr+='
'}vTmpDate.setDate(vTmpDate.getDate()+81);while(vTmpDate.getDate()>1){vTmpDate.setDate(vTmpDate.getDate()+1)}}}vRightTable+=vDateRowStr+'';vRightTable+='
';vRightTable+=JSGantt.formatDateStr(vTmpDate,vDateDisplayFormat)+' '+vTmpDate.getHours()+':00 -'+vTmpDate.getHours()+':59 ';vRightTable+=JSGantt.formatDateStr(vTmpDate,vDateDisplayFormat)+''+JSGantt.formatDateStr(vTmpDate,vDateDisplayFormat.substring(0,5))+' - ';vTmpDate.setDate(vTmpDate.getDate()+6);vRightTable+=JSGantt.formatDateStr(vTmpDate,vDateDisplayFormat)+'`'+vStr+'`'+vStr+'`'+vStr+'
'+vTmpDate.getMinutes()+'
  
'+vTmpDate.getHours()+'
  
'+vTmpDate.getDate()+'
 
'+vTmpDate.getDate()+'
  
  
  
'+(vTmpDate.getMonth()+1)+'/'+vTmpDate.getDate()+'
  
  
'+vMonthArr[vTmpDate.getMonth()].substr(0,3)+'
  
  
Qtr. '+vQuarterArr[vTmpDate.getMonth()]+'
  
';for(i=0;i
'}vMainTable+=vRightTable+'
';vDiv.innerHTML=vMainTable}};this.mouseOver=function(pObj,pID,pPos,pType){if(pPos=='right')vID='child_'+pID;else vID='childrow_'+pID;pObj.bgColor="#ffffaa";vRowObj=JSGantt.findObj(vID);if(vRowObj)vRowObj.bgColor="#ffffaa"};this.mouseOut=function(pObj,pID,pPos,pType){if(pPos=='right')vID='child_'+pID;else vID='childrow_'+pID;pObj.bgColor="#ffffff";vRowObj=JSGantt.findObj(vID);if(vRowObj){if(pType=="group"){pObj.bgColor="#f3f3f3";vRowObj.bgColor="#f3f3f3"}else{pObj.bgColor="#ffffff";vRowObj.bgColor="#ffffff"}}}};JSGantt.isIE=function(){if(typeof document.all!='undefined'){return true}else{return false}};JSGantt.processRows=function(pList,pID,pRow,pLevel,pOpen){var vMinDate=new Date();var vMaxDate=new Date();var vMinSet=0;var vMaxSet=0;var vList=pList;var vLevel=pLevel;var i=0;var vNumKid=0;var vCompSum=0;var vVisible=pOpen;for(i=0;ivMaxDate){vMaxDate=pList[i].getEnd();vMaxSet=1};vCompSum+=pList[i].getCompVal()}}if(pRow>=0){pList[pRow].setStart(vMinDate);pList[pRow].setEnd(vMaxDate);pList[pRow].setNumKid(vNumKid);pList[pRow].setCompVal(Math.ceil(vCompSum/vNumKid))}};JSGantt.getMinDate=function getMinDate(pList,pFormat){var vDate=new Date();vDate.setFullYear(pList[0].getStart().getFullYear(),pList[0].getStart().getMonth(),pList[0].getStart().getDate());for(i=0;i0){vDate.setDate(vDate.getDate()-1)}}else if(pFormat=='week'){vDate.setDate(vDate.getDate()-7);while(vDate.getDay()%7>0){vDate.setDate(vDate.getDate()-1)}}else if(pFormat=='month'){while(vDate.getDate()>1){vDate.setDate(vDate.getDate()-1)}}else if(pFormat=='quarter'){if(vDate.getMonth()==0||vDate.getMonth()==1||vDate.getMonth()==2){vDate.setFullYear(vDate.getFullYear(),0,1)}else if(vDate.getMonth()==3||vDate.getMonth()==4||vDate.getMonth()==5){vDate.setFullYear(vDate.getFullYear(),3,1)}else if(vDate.getMonth()==6||vDate.getMonth()==7||vDate.getMonth()==8){vDate.setFullYear(vDate.getFullYear(),6,1)}else if(vDate.getMonth()==9||vDate.getMonth()==10||vDate.getMonth()==11){vDate.setFullYear(vDate.getFullYear(),9,1)}};return(vDate)};JSGantt.getMaxDate=function(pList,pFormat){var vDate=new Date();vDate.setFullYear(pList[0].getEnd().getFullYear(),pList[0].getEnd().getMonth(),pList[0].getEnd().getDate());for(i=0;iDate.parse(vDate)){vDate.setTime(Date.parse(pList[i].getEnd()))}}if(pFormat=='minute'){vDate.setHours(vDate.getHours()+1);vDate.setMinutes(59)}if(pFormat=='hour'){vDate.setHours(vDate.getHours()+2)}if(pFormat=='day'){vDate.setDate(vDate.getDate()+1);while(vDate.getDay()%6>0){vDate.setDate(vDate.getDate()+1)}}if(pFormat=='week'){vDate.setDate(vDate.getDate()+11);while(vDate.getDay()%6>0){vDate.setDate(vDate.getDate()+1)}}if(pFormat=='month'){while(vDate.getDay()>1){vDate.setDate(vDate.getDate()+1)}vDate.setDate(vDate.getDate()-1)}if(pFormat=='quarter'){if(vDate.getMonth()==0||vDate.getMonth()==1||vDate.getMonth()==2)vDate.setFullYear(vDate.getFullYear(),2,31);else if(vDate.getMonth()==3||vDate.getMonth()==4||vDate.getMonth()==5)vDate.setFullYear(vDate.getFullYear(),5,30);else if(vDate.getMonth()==6||vDate.getMonth()==7||vDate.getMonth()==8)vDate.setFullYear(vDate.getFullYear(),8,30);else if(vDate.getMonth()==9||vDate.getMonth()==10||vDate.getMonth()==11)vDate.setFullYear(vDate.getFullYear(),11,31)}return(vDate)};JSGantt.findObj=function(theObj,theDoc){var p,i,foundObj;if(!theDoc){theDoc=document}if((p=theObj.indexOf("?"))>0&&parent.frames.length){theDoc=parent.frames[theObj.substring(p+1)].document;theObj=theObj.substring(0,p)}if(!(foundObj=theDoc[theObj])&&theDoc.all){foundObj=theDoc.all[theObj]}for(i=0;!foundObj&&i-1;try{xmlDoc=new ActiveXObject("Microsoft.XMLDOM")}catch(e){try{if(is_chrome==false){xmlDoc=document.implementation.createDocument("","",null)}}catch(e){alert(e.message);return}}if(is_chrome==false){xmlDoc.async=false;xmlDoc.load(ThisFile);JSGantt.AddXMLTask(pGanttVar);xmlDoc=null;Task=null}else{JSGantt.ChromeLoadXML(ThisFile,pGanttVar);ta=null}};JSGantt.AddXMLTask=function(pGanttVar){Task=xmlDoc.getElementsByTagName("task");var n=xmlDoc.documentElement.childNodes.length;for(var i=0;i/gi);var n=ta.length;for(var i=1;i/i);if(te.length>2){var pID=te[1]}else{var pID=0}pID*=1;var te=Task.split(//i);if(te.length>2){var pName=te[1]}else{var pName="No Task Name"}var te=Task.split(//i);if(te.length>2){var pStart=te[1]}else{var pStart=""}var te=Task.split(//i);if(te.length>2){var pEnd=te[1]}else{var pEnd=""}var te=Task.split(//i);if(te.length>2){var pColor=te[1]}else{var pColor='0000ff'}var te=Task.split(//i);if(te.length>2){var pLink=te[1]}else{var pLink=""}var te=Task.split(//i);if(te.length>2){var pMile=te[1]}else{var pMile=0}pMile*=1;var te=Task.split(//i);if(te.length>2){var pRes=te[1]}else{var pRes=""}var te=Task.split(//i);if(te.length>2){var pComp=te[1]}else{var pComp=0}pComp*=1;var te=Task.split(//i);if(te.length>2){var pGroup=te[1]}else{var pGroup=0}pGroup*=1;var te=Task.split(//i);if(te.length>2){var pParent=te[1]}else{var pParent=0}pParent*=1;var te=Task.split(//i);if(te.length>2){var pOpen=te[1]}else{var pOpen=1}pOpen*=1;var te=Task.split(//i);if(te.length>2){var pDepend=te[1]}else{var pDepend=""}if(pDepend.length==0){pDepend=''}var te=Task.split(//i);if(te.length>2){var pCaption=te[1]}else{var pCaption=""}pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID,pName,pStart,pEnd,pColor,pLink,pMile,pRes,pComp,pGroup,pParent,pOpen,pDepend,pCaption))}}};JSGantt.benchMark=function(pItem){var vEndTime=new Date().getTime();alert(pItem+': Elapsed time: '+((vEndTime-vBenchTime)/1000)+' seconds.');vBenchTime=new Date().getTime()};