anchor.diff:                  }
               });
           }
  +        function computeTotalDistance(result) {
  +            var total = 0;
  +            var myroute = result.routes[0];
  +            for (var i = 0; i < myroute.legs.length; i++) {
  +                total += myroute.legs[i].distance.value;
  +            }
  +            total = total / 1000.0;
  +            document.getElementById('total').innerHTML = total + ' km';
  +        }
   
  +        google.maps.event.addDomListener(window, 'load', initialize);
       </script>
   
   
  
positive.code:     <b>Mode of Travel: </b>
      <input id="address" type="textbox" value="Lviv">
      <input type="button" value="Geocode" onclick="codeAddress()">
  
      <select id="mode" onchange="calcRoute();">
          <option value="DRIVING">Driving</option>
          <option value="WALKING">Walking</option>
          <option value="BICYCLING">Bicycling</option>
          <option value="TRANSIT">Transit</option>
      </select>
  </div>
  <div id="map-canvas"></div>
  </body>
  </html>
negative.code:         }
  
          #panel {
              position: relative;
              top: 5px;
              left: 50%;
              margin-left: -400px;
              z-index: 5;
              background-color: #fff;
              padding: 5px;
              border: 1px solid #999;
          }
  
          #directions-panel {
              height: 100%;
              float: right;
              width: 390px;
              overflow: auto;
          }
  
          #map-canvas {
              margin-right: 400px;
          }
  
          #control {
              background: #fff;
              padding: 5px;
              font-size: 14px;
              font-family: Arial;
              border: 1px solid #ccc;
              box-shadow: 0 2px 2px rgba(33, 33, 33, 0.4);
              display: none;
          }
  
          @media print {
              #map-canvas {
                  height: 500px;
                  margin: 0;
              }
  
              #directions-panel {
                  float: none;
                  width: auto;
              }
          }
      </style>
      <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
  