var map = null;
var latitude = "46.8198071" // current location coordinates
var longitude = "-100.7079442" // current location coordinates
var markers = [[latitude, longitude,'<h3>Where are we now?</h3><p>Bismarck, ND</p>']];

function initialize() {
    
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map-canvas"));
    
    map.setCenter(new GLatLng(latitude, longitude), 10, G_PHYSICAL_MAP);
    
    // add controls
    map.addControl(new GSmallZoomControl());
	var overview = new GOverviewMapControl(new GSize(125,125));
	map.addControl(overview);
	overview.hide(true);
	
	//set custom icons
	function getIcon() {
		var faut_icon = new GIcon();
        faut_icon.shadow = "http://www.google.com/mapfiles/shadow50.png";
        faut_icon.iconSize = new GSize(20, 34);
        faut_icon.shadowSize = new GSize(37, 34);
        faut_icon.iconAnchor = new GPoint(9, 34);
        faut_icon.infoWindowAnchor = new GPoint(9, 2);
        faut_icon.infoShadowAnchor = new GPoint(18, 25);
		faut_icon.image = "http://fautrever.com/wp/wp-content/themes/rv-blog/images/map-paw-white.png";
		return faut_icon;
	}
	 
    function createMarker(point, html) {
    	var marker = new GMarker(point, {icon: getIcon()});
        GEvent.addListener(marker, 'click', function() {
	        marker.openInfoWindowHtml(html);
	    });
		return marker;
	}
       
    //add markers for each location   
    for (var i = 0; i < markers.length; i++) {
    	var mrkr = markers[i];
    	var latlng = new GLatLng(mrkr[0],mrkr[1]);
    	var htmlContent = mrkr[2];
        var marker = new createMarker(latlng, htmlContent);
        map.addOverlay(marker);
    }

  }
  
}

addLoadEvent(initialize);