//<![CDATA[
var map;

function loadMap(){

	// Create a base icon for all of our markers that specifies the
	// shadow, icon dimensions, etc.
	var baseIcon = new GIcon();
	baseIcon.shadow = "http://www.google.com/mapfiles/dmapbug_40x23_shadow.gif";
	baseIcon.iconSize = new GSize(25, 40);
	baseIcon.shadowSize = new GSize(25, 40);
	baseIcon.iconAnchor = new GPoint(9, 34);
	baseIcon.infoWindowAnchor = new GPoint(9, 2);
	baseIcon.infoShadowAnchor = new GPoint(18, 25);


	map = new GMap(document.getElementById("map"));
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.centerAndZoom(new GPoint(-118.597233, 34.17625), 4);
	//map.openInfoWindow(map.getCenterLatLng(), document.createTextNode("Hello, world"));	
	

	
	// Create a marker whose info window displays the letter corresponding
	// to the given index.
	function createMarker(point, index, html) {
	//alert("got here");
	// Create a lettered icon for this point using our icon class from above
		var letter = String.fromCharCode("A".charCodeAt(0) + index);
		var icon = new GIcon(baseIcon);
		icon.image = "/images/mapbug_nmmc.png";
		
		// FF 1.5 fix
    html = '<div style="white-space:nowrap; padding:10px;">' + html + '</div>';
		
		var marker = new GMarker(point, icon);
		
		
		// Show this marker's index in the info window when it is clicked.		
		GEvent.addListener(marker, 'click', function() {marker.openInfoWindowHtml(html);} );
		
		//alert(marker);
		
		return marker; 
		
	}

			
		var point = new GPoint(-118.597233, 34.17625);
 		var marker = createMarker(point, 0,'<div style="text-align:left">5850 Canoga Avenue, Suite 650t<br />Woodland Hills, CA 91367<br />Phone 818-710-6100 Fax 818-710-6116</div><br />');
		
		/*
		var pfulladdress = paddress + ', ' + pcity + ', ' + pstate + ' ' + pzipcode;
        var html = '<b>' + pname + '</b><br />' + paddress + '<br />' + pcity + ', ' + pstate + ' ' + pzipcode + '<br /><br />';
        html += '<form action="http://maps.google.com/maps" method="get" target="_blank">';
        html += '<i>Your address</i>: <br /><input type="text" name="saddr" value="" size=20><br />';
        html += '<input type="hidden" name="daddr" value="' + pfulladdress + '" />';
        html += '<input type="submit" value="Directions"/></form>'; 
		*/		
		map.addOverlay(marker);	
	

}
		
//]]>
