// Google Map API 3

// Code below replaces adding code to body tag - <body onLoad="initialize(), showMap()">
window.onload=function(){
 initialize();
 showMap();
}
// end of code

var geocoder;
	 var map; 
	 
	 function initialize() {
	 geocoder = new google.maps.Geocoder();
	 var myOptions = {
	 zoom: 15,
	 // mapTypeId: google.maps.MapTypeId.ROADMAP
	 mapTypeId: google.maps.MapTypeId.HYBRID
	 }
	 map = new google.maps.Map(document.getElementById("mapCanvas"), myOptions);
	 }
	  
	 function showMap() {
	 var address = document.getElementById("address").value;
	 geocoder.geocode({ 'address': address }, function(results, status) {
	 if (status == google.maps.GeocoderStatus.OK) {
	 map.setCenter(results[0].geometry.location);
	 var marker = new google.maps.Marker({
	 map: map,
     position: results[0].geometry.location,
     //display title tag & custom marker
	 title:"Carolann Clynes Featured Property 908-522-3003",  
     icon: 'http://www.njfinehome.com/images/home-icon.png' 
    // End code
	
	
	 });
	 } else {
	 alert("Geocode was not successful for the following reason: " + status);
	 }
 });
 }

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
