google.maps.Marker.prototype.attachInfoWindow=function(options){var map_=this.getMap();map_.bubble_=map_.bubble_||new google.maps.InfoWindow();google.maps.event.addListener(this,'mouseover',function(){map_.bubble_.setOptions(options);map_.bubble_.open(map_,this);});map_.infoWindowClickShutter=map_.infoWindowClickShutter||google.maps.event.addListener(map_,'mouseover',function(){map_.bubble_.close();});}
google.maps.Map.prototype.accessInfoWindow=function(){this.bubble_=this.bubble_||new google.maps.InfoWindow();return this.bubble_;}
var geocoder;var map;function initialize(){geocoder=new google.maps.Geocoder();var latlng=new google.maps.LatLng(51.061303,-114.058256);var myOptions={zoom:14,center:latlng,mapTypeId:google.maps.MapTypeId.ROADMAP}
map=new google.maps.Map(document.getElementById("map_canvas"),myOptions);}
function codeAddress(){var address=document.getElementById("address").value;if(geocoder){geocoder.geocode({'address':address},function(results,status){if(status==google.maps.GeocoderStatus.OK){if(status!=google.maps.GeocoderStatus.ZERO_RESULTS){map.setCenter(results[0].geometry.location);var marker=new google.maps.Marker({map:map,position:results[0].geometry.location});marker.attachInfoWindow({content:'<strong>Viewpoint Medical Assessment Services</strong><br><br><font size="1" face="Verdana">'+address+'</font>'});}
else{alert("No results found");}}else{alert("Geocode was not successful for the following reason: "+status);}});}}
