diff --git a/js/views_gantt.js b/js/views_gantt.js
index 937df21..243540e 100644
--- a/js/views_gantt.js
+++ b/js/views_gantt.js
@@ -53,6 +53,13 @@
       gantt.attachEvent("onBeforeLinkAdd", function(id,item){
         item.id = item.source + '_' + item.target;
       });
+
+      // This function auto-scrolls the chart to today's date minus the offset.
+      gantt.attachEvent("onGanttRender", function(){
+        var dateX = gantt.posFromDate(new Date());
+        var scrollX = Math.max(Math.round(dateX - gantt.config.task_scroll_offset), 0);
+        gantt.scrollTo(scrollX, 0);
+      });
     }
   }
 
diff --git a/views_gantt_plugin_style_gantt.inc b/views_gantt_plugin_style_gantt.inc
index f6000d1..d9c5068 100644
--- a/views_gantt_plugin_style_gantt.inc
+++ b/views_gantt_plugin_style_gantt.inc
@@ -163,9 +163,10 @@ class views_gantt_plugin_style_gantt extends views_plugin_style_list {
 
     $this->options_fields();
     $this->options_node();
+    $this->project = array();
 
-    // Get project data.
-    if (!$this->get_project()) return;
+    // Get project data (deprecated for functionality below).
+    // if (!$this->get_project()) return;
 
     // Get array of tasks.
     foreach ($this->view->result as $key => $row) {
@@ -177,6 +178,19 @@ class views_gantt_plugin_style_gantt extends views_plugin_style_list {
       $this->load_missing_values($key);
     }
 
+    // Projects are being handled here.  This allows for multiple projects in
+    // the gantt view.
+    foreach ($this->tasks as $key => $task) {
+        $parent = $task['parent_id'];
+        $project = $task['project_id'];
+        if ($parent != '') {
+            array_push($this->tasks[$parent]['childtasks'], $key);
+        }
+        if ($parent == $project) {
+            array_push($this->project[$project]['childtasks'], $key);
+        }
+    }
+
     // Allow to alter tasks array before next modifications.
     drupal_alter('views_gantt_tasks_prerender', $this->tasks);
     
@@ -207,23 +221,53 @@ class views_gantt_plugin_style_gantt extends views_plugin_style_list {
     return parent::render();
   }
 
-  function build_tree($tasks, $parent_id = '', $level = 0) {
+  /**
+   * build_tree() has been changed to build children for each project.  Projects
+   * are built in the render() function, rather than using the get_project()
+   * function.  This allows multiple projects to be viewed in the gantt chart,
+   * and removes the assumption that all tasks are children of a single project.
+   */
+
+  function build_tree($tasks, $child_id = '', $level = 0) {
     $branch = array();
-    foreach ($tasks as $key => $task) {
-      if (!$task['parent_id'] && $key != $this->project['id']) {
-        $task['parent_id'] = $this->project['id'];
-      }
-      if ($task['parent_id'] == $parent_id) {
-        $task['id'] = $key;
+
+    if ($level == 0) {
+        foreach ($this->project as $key => $project) {
+            $project_id = $project['id'];
+            $project['id'] = $key;
+            $project['level'] = $level;
+            if ($tasks[$project_id]['childtasks']) {
+                $children = array();
+                foreach ($tasks[$project_id]['childtasks'] as $project_child) {
+                    $child = $this->build_tree($tasks, $project_child, $level + 1);
+                    $children[$project_child] = $child;
+                }
+            }
+            if (isset($children)) {
+                $project['children'] = $children;
+            } else {
+                $project['children'] = NULL;
+            }
+            $branch[$key] = $project;
+        }
+    } else {
+        $task = $tasks[$child_id];
+        $task['id'] = $child_id;
         $task['level'] = $level;
-        $children = $this->build_tree($tasks, $key, $level + 1);
-        if ($children) {
-          $task['children'] = $children;
+        if ($task['childtasks']) {
+            $children = array();
+            foreach ($task['childtasks'] as $task_child) {
+                $child = $this->build_tree($tasks, $task_child, $level + 1);
+                $children[$task_child] = $child;
+            }
         }
-        $branch[$key] = $task;
-      }
+        if (isset($children)) {
+            $task['children'] = $children;
+        } else {
+            $task['children'] = NULL;
+        }
+        $branch = $task;
     }
-
     return $branch;
   }
 
@@ -235,7 +279,32 @@ class views_gantt_plugin_style_gantt extends views_plugin_style_list {
     }
 
     $time = $this->get_time($this->tasks[$task['id']]['est']);
-    $project_time = $this->get_time($this->project['est']);
+    $end_time = $this->get_time($this->tasks[$task['id']]['end_date']);
+    $project_time = $this->get_time($this->project[$task['project_id']]['est']);
+    $project_end_time = $this->get_time($this->project[$task['project_id']]['end_date']);
+
+    if ($parent_id) {
+      $parent_time = $this->get_time($this->tasks[$parent_id]['est']);
+      $parent_end_time = $this->get_time($this->tasks[$parent_id]['end_date']);
+
+      if ($time && $time < $parent_time) {
+        $this->tasks[$parent_id]['est'] = date('Y,n,j', $time);
+        //$this->tasks[$parent_id]['est_modified'] = TRUE;
+      }
+
+      if ($parent_end_time && $end_time > $parent_end_time) {
+        $this->tasks[$parent_id]['end_date'] = date('Y,n,j', $end_time);
+        //$this->tasks[$parent_id]['duration_modified'] = TRUE;
+      }
+    }
+
+    if ($time < $project_time) {
+      $this->project[$task['project_id']]['est'] = date('Y,n,j', $time);
+    }
+
+    if ($end_time > $project_end_time) {
+      $this->project[$task['project_id']]['end_date'] = date('Y,n,j', $end_time);
+    }
   }
 
   function check_duration($task, $parent_id = '') {
@@ -347,6 +416,9 @@ class views_gantt_plugin_style_gantt extends views_plugin_style_list {
         elseif (isset($field_value[0]['raw']['value'])) {
           $field_value = $field_value[0]['raw']['value'];
         }
+        elseif (isset($field_value[0]['raw']['target_id'])) {
+          $field_value = $field_value[0]['raw']['target_id'];
+        }
         elseif (isset($field_value[0]['rendered']['#markup'])) {
           $field_value = $field_value[0]['rendered']['#markup'];
         }
@@ -454,36 +526,45 @@ class views_gantt_plugin_style_gantt extends views_plugin_style_list {
     }
   }
 
-  function get_project() {
-    $project_id = $this->views_gantt_get_field_value($this->view->result[0], 'project_id_field');
-    $node = node_load($project_id);
-    if (!$node) {
-      $this->project = NULL;
-    } else {
-      $project_date = $this->views_gantt_get_field_value($this->view->result[0], 'project_date_field');
-      $project_end_date = $this->views_gantt_get_field_value($this->view->result[0], 'project_end_date_field');
-
-      $id = $this->add_task($node, 'node');
-      $this->project = array('id' => $id) + $this->tasks[$id];
-
-      if (!$project_date) {
-        $this->project['est'] = $this->project_date('start');
-        $this->tasks[$id]['est'] = $this->project['est'];
-      }
+  /**
+   * Please note: get_projects() is being deprecated in this patch since the
+   * projects are being handled in the render() function.
+   */
 
-      if (!$project_end_date) {
-        $this->project['end_date'] = $this->project_date('end');
-        $this->tasks[$id]['end_date'] = $this->project['end_date'];
+  /*  function get_projects() {
+      $results = $this->view;
+      foreach($results as $task) {
+        $project_id = $this->views_gantt_get_field_value($this->view->result[0], 'project_id_field');
       }
 
-      if (!$this->project['est'] || !$this->project['end_date']) {
-        drupal_set_message(t('Gantt Chart requires filled project date.'), 'warning');
+      $node = node_load($project_id);
+      if (!$node) {
         $this->project = NULL;
-      }      
-    }
+      } else {
+        $project_date = $this->views_gantt_get_field_value($this->view->result[0], 'project_date_field');
+        $project_end_date = $this->views_gantt_get_field_value($this->view->result[0], 'project_end_date_field');
 
-    return $this->project;
-  }
+        $id = $this->add_task($node, 'node');
+        $this->project = array('id' => $id) + $this->tasks[$id];
+
+        if (!$project_date) {
+          $this->project['est'] = $this->project_date('start');
+          $this->tasks[$id]['est'] = $this->project['est'];
+        }
+
+        if (!$project_end_date) {
+          $this->project['end_date'] = $this->project_date('end');
+          $this->tasks[$id]['end_date'] = $this->project['end_date'];
+        }
+
+        if (!$this->project['est'] || !$this->project['end_date']) {
+          drupal_set_message(t('Gantt Chart requires filled project date.'), 'warning');
+          $this->project = NULL;
+        }
+      }
+
+      return $this->project;
+    } */
 
   function project_date($type = 'start') {
     $date = time();
@@ -609,6 +690,7 @@ class views_gantt_plugin_style_gantt extends views_plugin_style_list {
       'percentcompleted' => 'progress_field',
       'predecessortasks' => 'predecessor_id_field',
       'parent_id' => 'parent_id_field',
+      'project_id' => 'project_id_field',
     );
     
     $task = array(
@@ -644,6 +726,11 @@ class views_gantt_plugin_style_gantt extends views_plugin_style_list {
       'childtasks' => array(),
     );
 
+    if (isset($this->tasks[$task_id]['project_id']) && ($this->tasks[$task_id]['parent_id'] == '')) {
+        $project = array('id' => $task_id) + $this->tasks[$task_id];
+        $this->project[$task_id] = $project;
+    }
+
     return $task_id;
   }   
 
@@ -686,6 +773,8 @@ class views_gantt_plugin_style_gantt extends views_plugin_style_list {
         'project_id' => $this->project['id'],
         'exposed_input' => isset($this->view->exposed_input) ? $this->view->exposed_input : NULL,
         'fullscreen_button' => '<a class="gantt-fullscreen">Fullscreen</a>',
+        'pred' => $this->options['predecessor_id_field'],
+        'tasks' => $this->tasks,
         'columns' => $this->columns,
       ),
     );
