// JavaScript Document
var busaddress=Array();
var busaddress1=Array();
var buscity=Array();
var map;
var address; 
var address1; 

function initialize(){    
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map_canvas"));        
		map.addControl(new GSmallMapControl());
		map.addControl(new GOverviewMapControl());
		map.addControl(new GMapTypeControl());
		map.setCenter(new GLatLng(41.183480, -74.061240), 13);
		geocoder = new GClientGeocoder();
		var baseIcon = new GIcon();
		baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
		baseIcon.iconSize = new GSize(20, 34);
		baseIcon.shadowSize = new GSize(37, 34);
		baseIcon.iconAnchor = new GPoint(9, 34);
		baseIcon.infoWindowAnchor = new GPoint(9, 2);
		baseIcon.infoShadowAnchor = new GPoint(18, 25);
		//alert(busaddress);
		for(i=0;i<busaddress.length;i++){
			//showaddress(busaddress[i],busaddress1[i],buscity[i]);
			showaddress(busaddress[i]);
		}	
	}
}

//function showaddress(address,address1,city){
function showaddress(address){
	//alert(address)
	if (geocoder){
		geocoder.getLatLng(
			address,function(point){
				if (!point){
				}else{
					map.setCenter(point, 15);							
					var marker = new GMarker(point);
					map.addOverlay(marker);	
					/*GEvent.addListener(
						marker, 
						"mouseover", 
						function() {
							marker.openInfoWindowHtml(address1);
						}
					);*/
				}
			}
		);
	}
}