diff -urpN trackhead/INSTALL.txt track/INSTALL.txt
--- trackhead/INSTALL.txt	2009-02-16 06:39:47.000000000 -0600
+++ track/INSTALL.txt	2009-02-16 07:20:19.000000000 -0600
@@ -3,3 +3,8 @@
 - Install the GMAP module
 - Put all files inside your module directory
 - Activate the module and change create tracks auth.
+
+Note:  Does not work correctly with Drupal 5.x caching
+for the main track list.  For now, disable caching until
+somebody figures out a better way to turn off caching of
+links under http://mysite/track/...
Binary files trackhead/.INSTALL.txt.swp and track/.INSTALL.txt.swp differ
diff -urpN trackhead/misc/map.inc.js track/misc/map.inc.js
--- trackhead/misc/map.inc.js	2009-02-16 06:42:14.000000000 -0600
+++ track/misc/map.inc.js	2009-02-16 07:30:38.000000000 -0600
@@ -71,7 +71,7 @@ function MapClass()
  function processXMLnode(marker) {
 
      if (marker.getAttribute("type") == "alert") {
-        alert(marker.getAttribute("alert"));
+   //     alert(marker.getAttribute("alert"));
      }
      if (marker.getAttribute("type") == "point") {
      	addMarker(marker);
@@ -94,8 +94,9 @@ function MapClass()
          map.clearOverlays();
      }
      if (marker.getAttribute("type") == "clearlasttrace") {
-//         FIXME Causes NULL reference
-//         map.removeOverlay(lasttrace);
+         if (lasttrace != null) {
+            map.removeOverlay(lasttrace);
+         }
      }
      if (marker.getAttribute("type") == "move") {
          map.setCenter(new GLatLng(parseFloat(marker.getAttribute("y")), parseFloat(marker.getAttribute("x"))), 17 - parseFloat(marker.getAttribute("zl")));
@@ -106,11 +107,13 @@ function MapClass()
  }
 
  function processxmlDoc(xmlDoc) {
-      var markers = xmlDoc.documentElement.getElementsByTagName("data");
-      markerstoadd = [];
-
-      for (var i = 0; i < markers.length; i++) { // er"<"erg<>
-        processXMLnode(markers[i]);
+      if (xmlDoc.documentElement != null) {
+       var markers = xmlDoc.documentElement.getElementsByTagName("data");
+       markerstoadd = [];
+
+       for (var i = 0; i < markers.length; i++) { // er"<"erg<>
+         processXMLnode(markers[i]);
+       }
       }
  }
 
@@ -122,7 +125,7 @@ function MapClass()
      if (async) {
       request.onreadystatechange = function() {
         if (request.readyState == 4) {
-//          alert(request.responseText);
+//      alert(request.responseText);
           processxmlDoc(request.responseXML);
         }
       }
@@ -138,6 +141,7 @@ function MapClass()
 
  function modified(actionmade, async) {
     var xmlfile = trackbackurl+'?action='+actionmade+'&'+geturlproperties();
+
     processrequest(xmlfile, async);
  }
 
@@ -153,9 +157,6 @@ function MapClass()
 
   trackbackurl = trackback;
 
-//  alert("DBG: TrackBack: "+trackback+" DivId: "+divid);
-//  alert(document.getElementById(divid));
-
   map = new GMap2(document.getElementById(divid));
 
   baseIcon = new GIcon();
@@ -193,7 +194,6 @@ function MapClass()
 
   modified('initsync', false);
   modified('initasync', true);
-//  alert("initmap complete!");
 
  }
 
Binary files trackhead/misc/.map.inc.js.swo and track/misc/.map.inc.js.swo differ
Binary files trackhead/misc/.map.inc.js.swp and track/misc/.map.inc.js.swp differ
diff -urpN trackhead/track.gpx.inc track/track.gpx.inc
--- trackhead/track.gpx.inc	2009-02-16 06:44:25.000000000 -0600
+++ track/track.gpx.inc	2009-01-10 09:54:37.000000000 -0600
@@ -331,35 +331,182 @@ class GPX_file {
      for ($i=0; $i<10; $i++) {
         $tot += $datay[$i];
      }
-     echo "<set name='".t("Grosse descente")."' value='".$tot."' />";   //<-10%
+//     $tot = (100 * $tot) / $l;
+     echo "<set name='".t("Steep descent")."' value='".$tot."' />";   //<-10%
 
      $tot = 0;
      for ($i=10; $i<19; $i++) {
         $tot += $datay[$i];
      }
-     echo "<set name='".t("Descente")."' value='".$tot."' />"; //(entre -10% et -2%)
+//     $tot = (100 * $tot) / $l;
+     echo "<set name='".t("Descent")."' value='".$tot."' />"; //(entre -10% et -2%)
 
      $tot = 0;
      for ($i=19; $i<22; $i++) {
         $tot += $datay[$i];
      }
-     echo "<set name='".t("Plat")."' value='".$tot."' />"; // (entre -2% et 2%)
+//     $tot = (100 * $tot) / $l;
+     echo "<set name='".t("Flat")."' value='".$tot."' />"; // (entre -2% et 2%)
 
      $tot = 0;
      for ($i=22; $i<31; $i++) {
         $tot += $datay[$i];
      }
-     echo "<set name='".t("Montée")."' value='".$tot."' />"; //(entre 2% et 10%)
+//     $tot = (100 * $tot) / $l;
+     echo "<set name='".t("Ascent")."' value='".$tot."' />"; //(entre 2% et 10%)
 
      $tot = 0;
      for ($i=31; $i<41; $i++) {
         $tot += $datay[$i];
      }
-     echo "<set name='".t("Grosse montée")."' value='".$tot."' />"; //(>10%)
+//     $tot = (100 * $tot) / $l;
+     echo "<set name='".t("Steep ascent")."' value='".$tot."' />"; //(>10%)
 
      echo "</graph>";
+
+
+
+/*
+     echo "<graph caption='Repartition' xaxisname='Pentes' yaxisname='Distance' ";
+     echo "showAreaBorder='0' lineThickness='1' numdivlines='10' numVDivLines='21' showgridbg='1' showhovercap='1' ";
+     echo "showVerLines='0' hoverCapSepChar=' ' anchorScale='0' showNames='1' showValues='0' animation='0'>\n";
+
+     $datax = $this->Pentes();
+     $datay = $this->RepartitionPentes();
+
+     for ($i=0; $i<count($datax); $i++) {
+      $pente = $i - 20;
+      if (fmod($i, 5) == 0)
+       $sn = 1;
+      else
+       $sn = 0;
+      echo "<set name='".$pente."%' value='".$datay[$i]."' showName='".$sn."' />";
+     }
+
+     echo "</graph>";
+*/
   }
 
+  /*
+ function ShowRepartition() {
+  include ("jpgraph/jpgraph.php");
+  include ("jpgraph/jpgraph_line.php");
+//  include ("jpgraph/jpgraph_log.php");
+
+  $datax = $this->Pentes();
+  $datay = $this->RepartitionPentes();
+
+  $n = count($datax);
+  
+  // Setup the basic graph
+  $graph = new Graph(665,443);
+  $graph->SetColor("white");
+  $graph->SetMarginColor("white");
+  $graph->SetMargin(40,10,10,10);
+  $graph->SetFrame(false);
+  $graph->title->Set($this->GPXfile);
+  $graph->SetAlphaBlending();
+  
+  // Setup a manual x-scale (We leave the sentinels for the
+  // Y-axis at 0 which will then autoscale the Y-axis.)
+  // We could also use autoscaling for the x-axis but then it
+  // probably will start a little bit earlier than the first value
+  // to make the first value an even number as it sees the timestamp
+  // as an normal integer value.
+  $graph->SetScale("intlin",0,$this->getZMax(),-21,21);
+  
+  $coef = 99.99 / $this->Longueur();
+
+  // Create the line
+  $cumul = array();
+  $cumul[0] = $datay[0] * $coef;
+  for ($i=1; $i<41; $i++) {
+     $cumul[$i] = $cumul[$i - 1] + ($datay[$i] * $coef);
+  }
+
+  $p1 = new LinePlot($cumul,$datax);
+  $p1->SetColor("red");
+  // Add lineplot to the graph
+  $graph->Add($p1);
+
+  /*
+  $cumul2 = array();
+  $cumul2[20] = $datay[20] * $coef;
+  for ($i=1; $i<21; $i++) {
+     $cumul[$i] = $cumul[19 - $i] + ($datay[$i] * $coef);
+  }
+
+  /*
+  // Create the line
+  $p2 = new LinePlot($datay,$datax);
+  $p2->SetColor("green");
+  // Add lineplot to the graph
+  $graph->Add($p2);
+  */
+   /*
+  $coef = 99.99 / $datay[20];
+
+  for ($i=0; $i<41; $i++) {
+     $datay[$i] = $datay[$i] * $coef;
+  }
+
+  // Create the line
+  $p3 = new LinePlot($datay,$datax);
+  $p3->SetColor("blue");
+  // Set the fill color partly transparent
+  $p3->SetFillColor("blue@0.4");
+  // Add lineplot to the graph
+  $graph->Add($p3);
+
+  // Output line
+  $graph->Stroke();
+ }
+
+ function ShowProfile() {
+  include ("modules/jpgraph/jpgraph.php");
+  include ("modules/jpgraph/jpgraph_line.php");
+
+  $datax = $this->XArray();
+  $datay = $this->ZArray();
+
+  $n = count($datax);
+
+  // Setup the basic graph
+  $graph = new Graph(300,200);
+//  $graph = new Graph(100, 100);
+
+  $graph->SetColor("white");
+  $graph->SetMarginColor("white");
+  $graph->SetMargin(40,10,10,10);
+  $graph->SetFrame(false);
+  $graph->title->Set($this->GPXfile);
+  $graph->SetAlphaBlending();
+
+  // Setup a manual x-scale (We leave the sentinels for the
+  // Y-axis at 0 which will then autoscale the Y-axis.)
+  // We could also use autoscaling for the x-axis but then it
+  // probably will start a little bit earlier than the first value
+  // to make the first value an even number as it sees the timestamp
+  // as an normal integer value.
+  $graph->SetScale("intlin",0,$this->getZMax(),$now,$datax[$n-1]);
+  // Create the line
+
+
+  $p1 = new LinePlot($datay,$datax);
+  $p1->SetColor("blue");
+
+  // Set the fill color partly transparent
+  $p1->SetFillColor("blue@0.4");
+
+  // Add lineplot to the graph
+  $graph->Add($p1);
+
+
+  // Output line
+  $graph->Stroke();
+ }
+ */
+
  function htmlentities2unicodeentities ($input) {
   $htmlEntities = array_values (get_html_translation_table (HTML_ENTITIES, ENT_QUOTES));
   $entitiesDecoded = array_keys  (get_html_translation_table (HTML_ENTITIES, ENT_QUOTES));
@@ -393,7 +540,7 @@ class GPX_file {
 ?>
 <kml xmlns="http://earth.google.com/kml/2.1">
 <Document>
-  <name><? echo $this->GPXfile; ?></name>
+  <name>QuadSquad <? echo $this->GPXfile; ?></name>
   <open>1</open>
   <Style id="lineStyle">
 	<LineStyle>
@@ -401,6 +548,15 @@ class GPX_file {
 		<width>4</width>
 	</LineStyle>
   </Style>
+  <ScreenOverlay>
+	<name>Quad Squad logo</name>
+		<Icon>
+		    <href>http://www.quadsquad.ca/images/QuadSquadLogo.png</href>
+   		</Icon>
+   	<overlayXY x="0" y="1" xunits="fraction" yunits="fraction"/>
+   	<screenXY x="0" y="1" xunits="fraction" yunits="fraction"/>
+   	<size x="0" y="0" xunits="pixels" yunits="pixels"/>
+  </ScreenOverlay>
   <Folder>
     <open>1</open>
     <name><? echo $this->GPXfile; ?></name>
diff -urpN trackhead/track.module track/track.module
--- trackhead/track.module	2009-02-16 06:46:11.000000000 -0600
+++ track/track.module	2009-02-16 06:23:18.000000000 -0600
@@ -5,9 +5,11 @@
  * @file
  * GPX-handling and displaying.
  */
+define('TRACK_PATH', drupal_get_path('module', 'track'));
 
-include_once("modules/track/track.gpx.inc");
-include_once("modules/track/track.tile.inc");
+include_once TRACK_PATH .'/track.gpx.inc';
+include_once TRACK_PATH .'/track.tile.inc';
+include_once TRACK_PATH .'/track.google.map.inc';
 
 $phptrackback = "";
 
@@ -25,6 +27,7 @@ function track_add() {
  * Implementation of hook_menu.
  */
 function track_menu($may_cache) {
+
   $items = array();
   if ($may_cache) {
     $items[] = array('path' => 'track', 'callback' => 'list_trk', 'title' =>  t('Track list'), 'access' => true);
@@ -110,13 +113,13 @@ function get_icon($diff) {
  header("Content-type: image/png");
 
  if ($diff == "S") {
-  $image_name = "modules/track/misc/pushpins/058.png";
+  $image_name = TRACK_PATH .'/misc/pushpins/058.png';
  } elseif ($diff == "M") {
-  $image_name = "modules/track/misc/pushpins/150.png";
+  $image_name = TRACK_PATH .'/misc/pushpins/150.png';
  } elseif ($diff == "L") {
-  $image_name = "modules/track/misc/pushpins/011.png";
+  $image_name = TRACK_PATH .'/misc/pushpins/011.png';
  } else {
-  $image_name = "modules/track/misc/pushpins/007.png";
+  $image_name = TRACK_PATH .'/misc/pushpins/007.png';
  }
 
  $im = imagecreatefrompng($image_name);
@@ -124,6 +127,7 @@ function get_icon($diff) {
  imageSaveAlpha($im, true);
 
  if ($diff == "XL") {
+//  $black = imagecolorallocate($im, 255, 255, 255);
   $black = imagecolorallocate($im, 0, 0, 0);
  } else {
   $black = imagecolorallocate($im, 0, 0, 0);
@@ -145,7 +149,6 @@ function get_icon($diff) {
 }
 
 function trackback_detail($nid) {
-  include_once("modules/track/track.google.map.inc");
   // create interface object with map
   $aMap = new GoogleMap();
   // init all values
@@ -199,6 +202,7 @@ function trackback_detail($nid) {
 
     $track = node_load($nid);
     $desc = theme('info_window_html', $track);
+//    $aMap->AddTrace($points, "#ff3333", 2, 0.8);
     $aMap->AddTrace($points, "#ff0000", 3, 0.8);
     
     $intensite = $track->file->dzplus / ($track->file->length / 4);
@@ -226,7 +230,6 @@ function trackback_detail($nid) {
 }
 
 function trackback_all() {
-  include_once("modules/track/track.google.map.inc");
   // create interface object with map
   $aMap = new GoogleMap();
   // init all values
@@ -335,8 +338,9 @@ function theme_info_details($track) {
 
 function prepare_google_maps() {
   $key = variable_get('googlemap_api_key', 'AAAAAAAAAAA');
+//  drupal_set_html_head('<style type="text/css"> v\:*{behavior:url(#default#VML);} </style>');
   $basepath = $GLOBALS['base_path'];
-  drupal_add_js('modules/track/misc/map.inc.js');
+  drupal_add_js(TRACK_PATH.'/misc/map.inc.js');
   $GLOBALS['base_path'] = "";
   drupal_set_html_head('<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key='.$key.'"type="text/javascript"></script>');
   $GLOBALS['base_path'] = $basepath;
@@ -346,6 +350,11 @@ function track_footer($main = 0) {
   global $phptrackback;
 
   if ($phptrackback != "") {
+//    global $conf;
+//    $conf['cache'] = CACHE_DISABLED;
+  // Caching tracks causes big problems for anonymous users
+   cache_clear_all('track', 'cache', TRUE); 
+
    prepare_google_maps();
    $content = '';
    $content .= "<script type=\"text/javascript\">";
@@ -474,6 +483,7 @@ function track_help($section) {
  * Implementation of hook_node_info.
  */
 function track_node_info() {
+/*  return array('track' => array('name' => t('track'), 'base' => 'track')); */
   return array(
     'track' => array(
       'name' => t('Track'),
@@ -505,9 +515,9 @@ function track_flash_chart($width, $heig
   $output .= '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
   $output .= 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
   $output .= 'WIDTH="'.$width.'" HEIGHT="'.$height.'" id="FC2Area3D" ALIGN="">';
-  $output .= '<PARAM NAME=movie VALUE="'.base_path().'modules/track/misc/'.$swf.'?dataUrl=/track/'.$type.'/'.$nid.'">';
+  $output .= '<PARAM NAME=movie VALUE="'.TRACK_PATH.'/misc/'.$swf.'?dataUrl=/track/'.$type.'/'.$nid.'">';
   $output .= '<PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF>';
-  $output .= '<EMBED src="'.base_path().'modules/track/misc/'.$swf.'?dataUrl=/track/'.$type.'/'.$nid.'" quality=high ';
+  $output .= '<EMBED src="'.TRACK_PATH.'/misc/'.$swf.'?dataUrl=/track/'.$type.'/'.$nid.'" quality=high ';
   $output .= 'bgcolor=#FFFFFF WIDTH="'.$width.'" HEIGHT="'.$height.'" NAME="FC2Area3D" ';
   $output .= 'ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
   $output .= '</OBJECT>';
@@ -530,6 +540,7 @@ function track_view(&$node, $teaser = FA
   return $node;
 }
 
+//function theme_track_files($node, $teaser) {
 function theme_track_files($node) {
   //theme_node_example_order_info
   $output = "";
