﻿function getDirections() {
  var url = "http://maps.google.com/maps?f=d&source=s_d&saddr={0}{1}{2}{3}&daddr=2030+Rowlett+Road+Garland+TX+75043&hl=en";
  var addr = $get("addr").value.replace(/\s+/g, "+"), city = $get("city").value.replace(/\s+/g, "+"),
  state = $get("state").value.replace(/\s+/g, "+"), zip = $get("zip").value;

  window.open(String.Format(url, !String.IsNullOrEmpty(addr) ? addr : "", !String.IsNullOrEmpty(city) ? "+" + city : "",
    !String.IsNullOrEmpty(state) ? "+" + state : "", !String.IsNullOrEmpty(zip) ? "+" + zip : ""));
};
