/* need to include this on the page that includes this file
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> 

need to set the following on the page to place map.

// ['Address','City','State','Zip','phone','latitude','longitute']
// geocoder http://www.geocoder.us

var locations = [
	['Location Name','925 Royal Oaks Drive','Lewisville','TX','75067','972-983-3536','33.012097','-97.006963'],
	['Location Name','13101 Preston Rd, Suite 100','Dallas','TX','75240','972-983-3536','32.925525','-96.803379']
];

*/



(function() {
				window.onload = function(){
					var options = {
					  zoom: 8,
					  center: new google.maps.LatLng(locations[0][6],locations[0][7]),
					  mapTypeId: google.maps.MapTypeId.ROADMAP,
					  streetViewControl:false
					}; 
					
					var map = new google.maps.Map(document.getElementById('map'), options);

			var infowindow = new google.maps.InfoWindow();		
			var marker, i,contentString;		
				for(i = 0; i<locations.length; i++){
				
					marker = new google.maps.Marker({
     							 position: new google.maps.LatLng(locations[i][6],locations[i][7]), 
     							 map: map,
     							 animation: google.maps.Animation.DROP, 
      							 title:name
  						}); 
	  						
  		var addressgo = locations[i][1]+'+'+locations[i][2]+' '+locations[i][3]+' '+locations[i][4];				

  				

  google.maps.event.addListener(marker, 'click', (function(marker, i) {

var  contentString = '<div id="mapcontent">'+locations[i][0]+' <br /> '+locations[i][1]+'<br />'+locations[i][2]+','+locations[i][3]+' '+locations[i][4]+'<br><a href="http://maps.google.com/maps?saddr=&daddr='+addressgo+'" target="_blank">get directions</a></div>'; 
  
        return function() {
          infowindow.setContent(contentString);
          infowindow.open(map, marker);
        }
      })(marker, i));

				}}
			})();

