var map;

function initialize() {
	var mapDiv = document.getElementById('map-canvas');
	map = new google.maps.Map(mapDiv, {
		center: new google.maps.LatLng(36.0625,-95.677068),
		zoom: 6,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	});
	
	styleMap();
	google.maps.event.addListenerOnce(map, 'tilesloaded', addMarkers);
}

function addMarkers() {
	var pointA = new google.maps.LatLng(37.0625,-95.677068);
    var pointB = new google.maps.LatLng(35.326851,-94.365374);
    var markerA = new google.maps.Marker({
		position: pointA,
		map: map
    });
    var markerB = new google.maps.Marker({
		position: pointB,
		map: map
    });
	
	 var infoWindowA = new google.maps.InfoWindow({
		position: pointA,
		content: "<div style='font-size: 12px;'><b>Springdale</b><br />725 South 48th St<br />Springdale, AR 72762 <br /><a href='http://maps.google.com/maps?f=d&source=s_q&hl=en&q=6121+S+Zero+St,+Fort+Smith,+Sebastian,+Arkansas+72903&sll=37.0625,-95.677068&sspn=38.365962,73.125&ie=UTF8&geocode=%3BCRxdWsSLsAHOFYMLGwIdQhlg-ilpiY7CkbLLhzFh5ql5Hfv3OQ&split=0&hq=&hnear=6121+Zero+St,+Fort+Smith,+Sebastian,+Arkansas+72903&z=14&iwloc=A&daddr=6121+Zero+St,+Fort+Smith,+AR+72903'>Directions</a></div>"
	});
	
	var infoWindowB = new google.maps.InfoWindow({
		position: pointB,
		content: "<div style='font-size: 12px;'><b>Fort Smith</b><br />6121 South Zero<br />Ft. Smith, AR 72903<br /><a href='http://maps.google.com/maps?f=d&source=s_q&hl=en&q=725+S+48th+St,+Springdale,+Washington,+Arkansas+72762&sll=35.327311,-94.365993&sspn=0.009664,0.017853&ie=UTF8&geocode=%3BCYNnHYSLgDrcFb4QKAIdO-Zi-ikLTUTjz2zJhzHvxQbC8GLvyA&split=0&hq=&hnear=725+S+48th+St,+Springdale,+Washington,+Arkansas+72762&z=14&iwloc=A&daddr=725+S+48th+St,+Springdale,+AR+72762'>Directions</a></div>"
	});
	
	google.maps.event.addListener(markerA, "click", function() {
		infoWindowA.open(map);
	});
	
	google.maps.event.addListener(markerB, "click", function() {
		infoWindowB.open(map);
	});
}

function styleMap() {
	var burtonOptions = {
		name: "Burton Pools"
	};
	
	var burtonStyles = [
	  {
	    featureType: "road.highway",
	    elementType: "all",
	    stylers: [
	      { visibility: "on" },
	      { hue: "#e4651e" }
	    ]
	  },{
	    featureType: "road.arterial",
	    elementType: "all",
	    stylers: [
	      { visibility: "on" },
	      { hue: "#e4651e" }
	    ]
	  },{
	    featureType: "road.local",
	    elementType: "all",
	    stylers: [
	      { visibility: "off" }
	    ]
	  },{
	    featureType: "water",
	    elementType: "all",
	    stylers: [
	      { visibility: "on" },
	      { hue: "#1592be" }
	    ]
	  },{
	    featureType: "transit",
	    elementType: "all",
	    stylers: [
	      { visibility: "off" }
	    ]
	  },{
	    featureType: "poi",
	    elementType: "all",
	    stylers: [
	      { visibility: "off" }
	    ]
	  },{
	    featureType: "landscape",
	    elementType: "all",
	    stylers: [
	      { visibility: "off" }
	    ]
	  },{
	    featureType: "all",
	    elementType: "all",
	    stylers: [
	
	    ]
	  }
	];
	var burtonMap = new google.maps.StyledMapType(burtonStyles, burtonOptions);
	
	map.mapTypes.set('burtonMap', burtonMap);
	map.setMapTypeId('burtonMap');
}

google.maps.event.addDomListener(window, 'load', initialize);
