// JavaScript Document
function loadMainMap(objID,mapBox,long,lat,z) {
		mapInit(objID);
		standardControls();
		map.setCenter(new GLatLng(lat,long), z);
		if ( places.length > 0 ) {
			processLocs(places);
			//rebound();
		}
}

function loadShowcaseMap(objID,mapBox,long,lat,z) {
	mapInit(objID);
	standardControls();
	vpoint = new GLatLng(long,lat);
	map.setCenter(vpoint, 11);
	if ( places.length > 0 ) {
		processAddressList(places);
	}
}

/*ORIGINAL FUNCTION
function loadDetailPageMap(objID,mapBox,long,lat,z) {
	mapInit(objID);
	standardControls();
	map.setCenter(new GLatLng(lat,long), 15);
	if ( places.length > 0 ) {
		processAddress(places);
	}
}*/

function loadDetailPageMap(objID,mapBox,long,lat,z) {
	
	if(mapExists) {
		mapInit(objID);
		standardControls();
		map.setCenter(new GLatLng(lat,long), 15);
		if ( places.length > 0 ) {
			processAddress2(places,mapViewLat,mapViewLong);
		}
		streetView(mapViewLat,mapViewLong);
		
	} else {
		mapInit(objID);
		standardControls();
		map.setCenter(new GLatLng(lat,long), 15);
		if(cenCity.indexOf('central') == -1){
			if ( places.length > 0 ) {
				processAddress(places);
			}			
		} else {
			alert('Could not pin point the exact location of the listing.');	
		}
		
		if (places2.length > 0) {
			streetView2(places2);
		}
	}
}