Index: jsgantt/jsgantt.js
===================================================================
RCS file: /cvs/drupal/contributions/modules/views_jsgantt/jsgantt/jsgantt.js,v
retrieving revision 1.1
diff -u -r1.1 jsgantt.js
--- jsgantt/jsgantt.js	25 Aug 2010 16:35:53 -0000	1.1
+++ jsgantt/jsgantt.js	13 Jan 2011 09:27:25 -0000
@@ -43,7 +43,7 @@
 		return true;
 	else
 		return false;
-}
+};
 
 
 JSGantt.TaskItem = function(pID, pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption)
@@ -75,16 +75,16 @@
          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.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 '&nbsp';  };
+      this.getResource = function(){ if(vRes) return vRes; else return '&nbsp'; };
       this.getCompVal  = function(){ if(vComp) return vComp; else return 0; };
       this.getCompStr  = function(){ if(vComp) return vComp+'%'; else return ''; };
 
@@ -132,25 +132,25 @@
          //   if(tmpPer == 1) vDuration = '1 Qtr';
          //   else            vDuration = tmpPer + ' Qtrs'; 
          //}
-         return( vDuration )
+         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.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; };
@@ -158,7 +158,7 @@
       this.setOpen     = function(pOpen) {vOpen = pOpen; };
       this.setVisible  = function(pVisible) {vVisible = pVisible; };
 
-  }
+  };
 
 	
   // function that loads the main gantt chart properties and functions
@@ -203,20 +203,20 @@
       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.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.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();
@@ -238,14 +238,14 @@
                vList[i].setEndY( vParDiv.offsetTop+vBarDiv.offsetTop+6 );
             }
          }
-      }
+      };
 
       this.AddTaskItem = function(value)
       {
          vTaskList.push(value);
-      }
+      };
 
-      this.getList   = function() { return vTaskList };
+      this.getList   = function() { return vTaskList; };
 
       this.clearDependencies = function()
       {
@@ -257,7 +257,7 @@
             if (depLine) { parent.removeChild(depLine); }
          }
          vDepId = 1;
-      }
+      };
 
 
       // sLine: Draw a straight line (colored one-pixel wide DIV), need to parameterize doc item
@@ -293,7 +293,7 @@
 	
 	 vDoc.appendChild(oDiv);
 
-      }
+      };
 
 
       // dLine: Draw a diaganol line (calc line x,y paisrs and draw multiple one-by-one sLines)
@@ -316,7 +316,7 @@
             y += dy;
          }
 
-      }
+      };
 
       this.drawDependency =function(x1,y1,x2,y2)
       {
@@ -342,7 +342,7 @@
             this.dLine(x2-1,y2,x2-3,y2-2);
             this.dLine(x2-1,y2,x2-3,y2+2);
          }
-      }
+      };
 
       this.DrawDependencies = function () {
 
@@ -366,11 +366,11 @@
                   var vTask = this.getArrayLocationByID(vDepList[k]);
 
                   if(vList[vTask].getVisible()==1)
-                     this.drawDependency(vList[vTask].getEndX(),vList[vTask].getEndY(),vList[i].getStartX()-1,vList[i].getStartY())
-               }
-  	    }
+                     this.drawDependency(vList[vTask].getEndX(),vList[vTask].getEndY(),vList[i].getStartX()-1,vList[i].getStartY());
+               };
+  	        }
          }
-      }
+      };
 
 
       this.getArrayLocationByID = function(pId)  {
@@ -381,7 +381,7 @@
             if(vList[i].getID()==pId)
                return i;
          }
-      }
+      };
 
 
    this.Draw = function()
@@ -863,7 +863,7 @@
                vDateRowStr = JSGantt.formatDateStr(vTaskStart,vDateDisplayFormat);
 
                vTaskLeft = (Date.parse(vTaskList[i].getStart()) - Date.parse(vMinDate)) / (24 * 60 * 60 * 1000);
-               vTaskRight = 1
+               vTaskRight = 1;
 
   	            vRightTable +=
                   '<div id=bardiv_' + vID + ' style="position:absolute; top:0px; left:' + Math.ceil((vTaskLeft * (vDayWidth) + 1)) + 'px; height: 18px; width:160px; overflow:hidden;">' +
@@ -892,7 +892,7 @@
             } else {
 
                // Build date string for Title
-               vDateRowStr = JSGantt.formatDateStr(vTaskStart,vDateDisplayFormat) + ' - ' + JSGantt.formatDateStr(vTaskEnd,vDateDisplayFormat)
+               vDateRowStr = JSGantt.formatDateStr(vTaskStart,vDateDisplayFormat) + ' - ' + JSGantt.formatDateStr(vTaskEnd,vDateDisplayFormat);
 
                 if (vFormat=='minute')
                 {
@@ -913,7 +913,7 @@
                         var tTime=new Date();
                         tTime.setTime(Date.parse(vTaskList[i].getStart()));
                         if (tTime.getMinutes() > 29)
-                            vTaskLeft+=.5
+                            vTaskLeft+=.5;
                     }
                 }
 
@@ -995,7 +995,7 @@
 
       }
 
-   } //this.draw
+   }; //this.draw
 
    this.mouseOver = function( pObj, pID, pPos, pType ) {
       if( pPos == 'right' )  vID = 'child_' + pID;
@@ -1004,7 +1004,7 @@
       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;
@@ -1021,9 +1021,9 @@
             vRowObj.bgColor = "#ffffff";
          }
       }
-   }
+   };
 
-} //GanttChart		
+}; //GanttChart		
 
 // Recursively process task tree ... set min, max dates of parent tasks and identfy task level.
 JSGantt.processRows = function(pList, pID, pRow, pLevel, pOpen)
@@ -1077,7 +1077,7 @@
       pList[pRow].setCompVal(Math.ceil(vCompSum/vNumKid));
    }
 
-}
+};
 
 
 // Used to determine the minimum date of all tasks and set lower bound based on format
@@ -1149,7 +1149,7 @@
 
          return(vDate);
 
-      }
+      };
 
 
 
@@ -1238,7 +1238,7 @@
 
          return(vDate);
 
-      }
+      };
 
 
 
@@ -1290,7 +1290,7 @@
 
          return foundObj;
 
-      }
+      };
 
 
 
@@ -1316,7 +1316,7 @@
 
 
 
-      }
+      };
 
 
 
@@ -1356,7 +1356,7 @@
 
       }
    }
-}
+};
 
 JSGantt.hide=     function (pID,ganttObj) {
    var vList = ganttObj.getList();
@@ -1374,7 +1374,7 @@
       }
 
    }
-}
+};
 
 // Function to show children of specified task
 JSGantt.show =  function (pID, pTop, ganttObj) {
@@ -1428,7 +1428,7 @@
 
       }
    }
-}
+};
 
 
   
@@ -1446,7 +1446,7 @@
     // Prevent forced opening of new window/tab
     // var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth); 
     var OpenWindow=window.location.href=pRef;
-  }
+  };
 
 JSGantt.parseDateStr = function(pDateStr,pFormatStr) {
    var vDate =new Date();	
@@ -1470,7 +1470,7 @@
 
     return(vDate);
     
-}
+};
 
 JSGantt.formatDateStr = function(pDate,pFormatStr) {
        vYear4Str = pDate.getFullYear() + '';
@@ -1499,7 +1499,7 @@
                return( vDayStr + '/' + vMonthStr );
       }		 
 	  
-}
+};
 
 JSGantt.parseXML = function(ThisFile,pGanttVar){
 	var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;   // Is this Chrome 
@@ -1520,7 +1520,7 @@
 	if (is_chrome==false) { 	// can't use xmlDoc.load in chrome at the moment
 		xmlDoc.async=false;
 		xmlDoc.load(ThisFile);		// we can use  loadxml
-		JSGantt.AddXMLTask(pGanttVar)
+		JSGantt.AddXMLTask(pGanttVar);
 		xmlDoc=null;			// a little tidying
 		Task = null;
 	}
@@ -1528,7 +1528,7 @@
 		JSGantt.ChromeLoadXML(ThisFile,pGanttVar);	
 		ta=null;	// a little tidying	
 	}
-}
+};
 
 JSGantt.AddXMLTask = function(pGanttVar){
 
@@ -1586,7 +1586,7 @@
 			try { pDepend = Task[i].getElementsByTagName("pDepend")[0].childNodes[0].nodeValue;
 			} catch (error) { pDepend =0;}
 			//pDepend *= 1;
-			if (pDepend.length==0){pDepend=''} // need this to draw the dependency lines
+			if (pDepend.length==0){pDepend='';} // need this to draw the dependency lines
 			
 			try { pCaption = Task[i].getElementsByTagName("pCaption")[0].childNodes[0].nodeValue;
 			} catch (error) { pCaption ="";}
@@ -1596,7 +1596,7 @@
 			pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID , pName, pStart, pEnd, pColor,  pLink, pMile, pRes,  pComp, pGroup, pParent, pOpen, pDepend,pCaption));
 		}
 	}
-}
+};
 
 JSGantt.ChromeLoadXML = function(ThisFile,pGanttVar){
 // Thanks to vodobas at mindlence,com for the initial pointers here.
@@ -1606,7 +1606,7 @@
 	};
 	XMLLoader.open("GET", ThisFile, false);
 	XMLLoader.send(null);
-}
+};
 
 JSGantt.ChromeXMLParse = function (pGanttVar){
 // Manually parse the file as it is loads quicker
@@ -1615,68 +1615,68 @@
 
 		var n = ta.length;	// the number of tasks. 
 		for(var i=1;i<n;i++) {
-			Task = ta[i].replace(/<[/]p/g, '<p');	
-			var te = Task.split(/<pid>/i)
+			Task = ta[i].replace(/<\/p/g, '<p');	
+			var te = Task.split(/<pid>/i);
 	
 			if(te.length> 2){var pID=te[1];} else {var pID = 0;}
 			pID *= 1;
 	
-			var te = Task.split(/<pName>/i)
+			var te = Task.split(/<pName>/i);
 			if(te.length> 2){var pName=te[1];} else {var pName = "No Task Name";}
 	
-			var te = Task.split(/<pstart>/i)
+			var te = Task.split(/<pstart>/i);
 			if(te.length> 2){var pStart=te[1];} else {var pStart = "";}
 	
-			var te = Task.split(/<pEnd>/i)
+			var te = Task.split(/<pEnd>/i);
 			if(te.length> 2){var pEnd=te[1];} else {var pEnd = "";}
 	
-			var te = Task.split(/<pColor>/i)
+			var te = Task.split(/<pColor>/i);
 			if(te.length> 2){var pColor=te[1];} else {var pColor = '0000ff';}
 
-			var te = Task.split(/<pLink>/i)
+			var te = Task.split(/<pLink>/i);
 			if(te.length> 2){var pLink=te[1];} else {var pLink = "";}
 	
-			var te = Task.split(/<pMile>/i)
+			var te = Task.split(/<pMile>/i);
 			if(te.length> 2){var pMile=te[1];} else {var pMile = 0;}
 			pMile  *= 1;
 	
-			var te = Task.split(/<pRes>/i)
+			var te = Task.split(/<pRes>/i);
 			if(te.length> 2){var pRes=te[1];} else {var pRes = "";}	
 	
-			var te = Task.split(/<pComp>/i)
+			var te = Task.split(/<pComp>/i);
 			if(te.length> 2){var pComp=te[1];} else {var pComp = 0;}	
 			pComp  *= 1;
 	
-			var te = Task.split(/<pGroup>/i)
+			var te = Task.split(/<pGroup>/i);
 			if(te.length> 2){var pGroup=te[1];} else {var pGroup = 0;}	
 			pGroup *= 1;
 
-			var te = Task.split(/<pParent>/i)
+			var te = Task.split(/<pParent>/i);
 			if(te.length> 2){var pParent=te[1];} else {var pParent = 0;}	
 			pParent *= 1;
 	
-			var te = Task.split(/<pOpen>/i)
+			var te = Task.split(/<pOpen>/i);
 			if(te.length> 2){var pOpen=te[1];} else {var pOpen = 1;}
 			pOpen *= 1;
 	
-			var te = Task.split(/<pDepend>/i)
+			var te = Task.split(/<pDepend>/i);
 			if(te.length> 2){var pDepend=te[1];} else {var pDepend = "";}	
 			//pDepend *= 1;
-			if (pDepend.length==0){pDepend=''} // need this to draw the dependency lines
+			if (pDepend.length==0){pDepend='';} // need this to draw the dependency lines
 			
-			var te = Task.split(/<pCaption>/i)
+			var te = Task.split(/<pCaption>/i);
 			if(te.length> 2){var pCaption=te[1];} else {var pCaption = "";}
 			
 			// Finally add the task
 			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();
-}
+};
 
