docs: function(node) {
          var style = {};
          
          var types = ["LineStyle", "PolyStyle", "IconStyle", "BalloonStyle", 
                       "LabelStyle"];
          var type, styleTypeNode, nodeList, geometry, parser;
          for(var i=0, len=types.length; i<len; ++i) {
              type = types[i];
              styleTypeNode = this.getElementsByTagNameNS(node, "*", type)[0];
              if(!styleTypeNode) { 
                  continue;
              }
  
              // only deal with first geometry of this type
              switch (type.toLowerCase()) {
                  case "linestyle":
                      var kmlColor = this.parseProperty(styleTypeNode, "*", "color");
                      var color = this.parseKmlColor(kmlColor);
                      if (color) {
                          style["strokeColor"] = color.color;
                          style["strokeOpacity"] = color.opacity;
                      }
                      
                      var width = this.parseProperty(styleTypeNode, "*", "width");
                      if (width) {
                          style["strokeWidth"] = width;
                      }
                      break;
  
                  case "polystyle":
                      var kmlColor = this.parseProperty(styleTypeNode, "*", "color");
                      var color = this.parseKmlColor(kmlColor);
                      if (color) {
                          style["fillOpacity"] = color.opacity;
                          style["fillColor"] = color.color;
                      }
                      // Check if fill is disabled
                      var fill = this.parseProperty(styleTypeNode, "*", "fill");
                      if (fill == "0") {
                          style["fillColor"] = "none";
                      }
                      // Check if outline is disabled
                      var outline = this.parseProperty(styleTypeNode, "*", "outline");
                      if (outline == "0") {
                          style["strokeWidth"] = "0";
                      }
                     
                      break;
  
                  case "iconstyle":
                      // set scale
                      var scale = parseFloat(this.parseProperty(styleTypeNode, 
                                                            "*", "scale") || 1);
    
                      // set default width and height of icon
                      var width = 32 * scale;
                      var height = 32 * scale;
  
                      var iconNode = this.getElementsByTagNameNS(styleTypeNode, 
                                                 "*", 
                                                 "Icon")[0];
                      if (iconNode) {
                          var href = this.parseProperty(iconNode, "*", "href");
                          if (href) {                                                   
  
                              var w = this.parseProperty(iconNode, "*", "w");
                              var h = this.parseProperty(iconNode, "*", "h");
  
                              // Settings for Google specific icons that are 64x64
                              // We set the width and height to 64 and halve the
                              // scale to prevent icons from being too big
                              var google = "http://maps.google.com/mapfiles/kml";
                              if (OpenLayers.String.startsWith(
                                                   href, google) && !w && !h) {
                                  w = 64;
                                  h = 64;
                                  scale = scale / 2;
                              }
                                  
                              // if only dimension is defined, make sure the
                              // other one has the same value
                              w = w || h;
                              h = h || w;
  
                              if (w) {
                                  width = parseInt(w) * scale;
                              }
  
                              if (h) {
                                  height = parseInt(h) * scale;
                              }
  
                              // support for internal icons 
                              //    (/root://icons/palette-x.png)
                              // x and y tell the position on the palette:
                              // - in pixels
                              // - starting from the left bottom
                              // We translate that to a position in the list 
                              // and request the appropriate icon from the 
                              // google maps website
                              var matches = href.match(this.regExes.kmlIconPalette);
                              if (matches)  {
                                  var palette = matches[1];
                                  var file_extension = matches[2];
  
                                  var x = this.parseProperty(iconNode, "*", "x");
                                  var y = this.parseProperty(iconNode, "*", "y");
  
                                  var posX = x ? x/32 : 0;
                                  var posY = y ? (7 - y/32) : 7;
  
                                  var pos = posY * 8 + posX;
                                  href = "http://maps.google.com/mapfiles/kml/pal" 
                                       + palette + "/icon" + pos + file_extension;
                              }
  
                              style["graphicOpacity"] = 1; // fully opaque
                              style["externalGraphic"] = href;
                          }
  
                      }
  
  
                      // hotSpots define the offset for an Icon
                      var hotSpotNode = this.getElementsByTagNameNS(styleTypeNode, 
                                                 "*", 
                                                 "hotSpot")[0];
                      if (hotSpotNode) {
                          var x = parseFloat(hotSpotNode.getAttribute("x"));
                          var y = parseFloat(hotSpotNode.getAttribute("y"));
  
                          var xUnits = hotSpotNode.getAttribute("xunits");
                          if (xUnits == "pixels") {
                              style["graphicXOffset"] = -x * scale;
                          }
                          else if (xUnits == "insetPixels") {
                              style["graphicXOffset"] = -width + (x * scale);
                          }
                          else if (xUnits == "fraction") {
                              style["graphicXOffset"] = -width * x;
                          }
  
                          var yUnits = hotSpotNode.getAttribute("yunits");
                          if (yUnits == "pixels") {
                              style["graphicYOffset"] = -height + (y * scale) + 1;
                          }
                          else if (yUnits == "insetPixels") {
                              style["graphicYOffset"] = -(y * scale) + 1;
                          }
                          else if (yUnits == "fraction") {
                              style["graphicYOffset"] =  -height * (1 - y) + 1;
                          }
                      }
  
                      style["graphicWidth"] = width;
                      style["graphicHeight"] = height;
                      break;
  
                  case "balloonstyle":
                      var balloonStyle = OpenLayers.Util.getXmlNodeValue(
                                              styleTypeNode);
                      if (balloonStyle) {
                          style["balloonStyle"] = balloonStyle.replace(
                                         this.regExes.straightBracket, "${$1}");
                      }
                      break;
                  case "labelstyle":
                      var kmlColor = this.parseProperty(styleTypeNode, "*", "color");
                      var color = this.parseKmlColor(kmlColor);
                      if (color) {
                          style["fontColor"] = color.color;
                          style["fontOpacity"] = color.opacity;
                      }
                      break;
  
                  default:
              }
          }
  
          // Some polygons have no line color, so we use the fillColor for that
          if (!style["strokeColor"] && style["fillColor"]) {
              style["strokeColor"] = style["fillColor"];
          }
  
          var id = node.getAttribute("id");
          if (id && style) {
              style.id = id;
          }
  
          return style;
      }