
geocoder = null;
function onair_init() {
  	if (google.maps.BrowserIsCompatible()) {
		map = new google.maps.Map2($("#OnAirMap").get(0));
		map.setCenter(new google.maps.LatLng(37.923933, -95.416617), 4);

		map.enableScrollWheelZoom();

		for (var i = 0; i < affiliate_list.length; i++) {
			this_affiliate = new google.maps.LatLng(affiliate_list[i].Lat, affiliate_list[i].Lng);
	        showAddress(this_affiliate, affiliate_list[i].Info);
		}

	}
}

function showAddress(point, info) {
    if (!point) {
        //alert(address + ' not found');
    } else {
        var marker = new createMarker(point, info);
        map.addOverlay(marker);
    }

}

function createMarker(point,html) {
	var marker = new google.maps.Marker(point);
	google.maps.Event.addListener(marker, "click", function() {
	 	marker.openInfoWindowHtml(html);
	});
	return marker;
}


google.setOnLoadCallback(onair_init);

