/**
	This file handles all the property listings on the screen.  This
	will allow us to remove and add properties to the screen without
	affecting other overlays that are on the map.
	
	For instance, if you select a property listing on the map, the
	user may want to make the other properties to disappear so they can
	concentrate on the specific property.
**/

//This function will remove all other property listings on the
//map except the selected one
function hideOtherMarkers(id)
{
	if(id)
	{
		for(var i=0; i<listingMarkers.length; i++)
		{
			if(listingMarkers[i].info[0] != id)
			{
				listingMarkers[i].hideMarker();
			}

		}
	}
	else
		alert("You have not selected a listing");	
}

function zoomOnMarker(id)
{
	map.closeInfoWindow();
	if(id)
	{
		for(var i=0; i<listingMarkers.length; i++)
		{
			if(listingMarkers[i].info[0] == id)
			{
				listingMarkers[i].center_and_zoom();
			}
		}
	}
	else
		alert("You have not selected a listing");	
}

function clearRadii()
{
	for(var i=0; i<listingMarkers.length; i++)
	{
		listingMarkers[i].removeRadii();
	}
}
function hideAllMarkers()
{
	for(var i=0; i<listingMarkers.length; i++)
	{
		listingMarkers[i].hideMarker();
	}

	//listingMarkers = new Array(0);
}

function drawRadiusAroundMarker(id, mileage, circles_per_mile)
{
	//alert(listingMarkers.length);
	//statusMessage.innerHTML = listingMarkers.length;
	if(id)
	{
		for(var i=0; i<listingMarkers.length; i++)
		{
			//statusMessage.innerHTML = i + ":" + listingMarkers.length;
			
			if(listingMarkers[i].info[0] == id)
			{
				//alert(listingMarkers[i].mlsinfo);				
				listingMarkers[i].drawRadii(mileage, circles_per_mile);
				return;
			}
		}
	}
	else
		alert("You have not selected a listing");	
}

function drawRadiusAroundLocation(mileage, circles_per_mile)
{
	mainMarker.drawRadii(mileage, circles_per_mile);
}
