// JavaScript Document

  google.load("jquery", "1.4.2");
  google.load("jqueryui", "1.8.0");

if(window.location=="http://www.northattleboropolice.com/directions.php")
window.onload = initialize();

 
//google.setOnLoadCallback();
<!--

var popUpWin=0;

function popUpWindow(URLStr, left, top, width, height)

{

  if(popUpWin)

  {

    if(!popUpWin.closed) popUpWin.close();

  }

  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}

function titleFunction()
{

	if (document.title == "Welcome to NAPD")
	{ 
		document.title = "The Official North Attleboro Police Website";
	}
	else if (document.title != "The Official North Attleboro Police Website")
	{	
		document.title = "Welcome to NAPD";
	}
	
}

//Globals for the map

function initialize()
{
var str = document.getElementById("street");
var city = document.getElementById("city");
var st = document.getElementById("state");
var zip = document.getElementById("zip");

if (GBrowserIsCompatible())
   {
 var map = new GMap2(document.getElementById("map_canvas"));
      map.setCenter(new GLatLng(41.978673, -71.334021), 13);
      
    
// Set up our GMarkerOptions object
       var blueIcon = new GIcon(G_DEFAULT_ICON);
       markerOptions = { icon:blueIcon };
       var marker = new GMarker(new GLatLng(41.978673, -71.334021), markerOptions);
       map.addOverlay(marker);
       var directionsPanel = document.getElementById("route");
       var directions = new GDirections(map, directionsPanel);
 
       if((city.value != null) && (city.value != " "))
        {
          var addr = str.value + ", " + city.value + ", " + st.value + " " + zip.value;
          directions.load("from: " + addr + " to: 102 South Washington St, North Attleboro, MA 02760");
        }
   }

}
//END OF INITIALIZE

function checkPageLoad()
{
   if(document.title=="Directions")
     {
     initialize();
     }    
}
//END OF CHECKPAGELOAD

function checkPageUnLoad()
{
   if(document.title=="Directions")
     {
     GUnload();
     }
}


//-->
