var $map;			// glabal var
jq(function() { properties() }); 		// calling all properties

// generic map interface
// init is called from properties
// override methods for specific map implementations
//		properties():  properties to plot on map. json object or list of json objects
// 		map_center():  google map latlng for center of map
// 		map_markers(): maps property markers onto map
// 		new_options(): overrides default options with any map specific options
// 		directions():  get directions to property
function init(props) {
	var	center = map_center(props),
  		default_options = {
		    zoom: 15,
		    center: center,
		    mapTypeId: google.maps.MapTypeId.ROADMAP
		  };
		
	if ( typeof map_options == 'function' )
		jq.extend(default_options, map_options());
		
	$map = new google.maps.Map(jq('#map')[0], default_options);
	map_markers(props);
		
	if ( typeof directions == 'function' )
		directions(center);
}
