Look at this:
if(google.maps.geometry.poly.containsLocation(new google.maps.LatLng(arrayLatitude[counter1], arrayLongitude[counter1]), polygon))
{
}
Important notice: If you don't set getSouthWest and getNorth... it always return false: Google Maps v3 map.getBounds().containsLatLng is not a function
var temp_rectangle = new google.maps.Rectangle({
bounds: new google.maps.LatLngBounds(
new google.maps.LatLng(array_shapes_object[counter].getSouthWestLat, array_shapes_object[counter].getSouthWestLng),
new google.maps.LatLng(array_shapes_object[counter].getNorthEastLat, array_shapes_object[counter].getNorthEastLng))
});
if(temp_rectangle.getBounds().contains(new google.maps.LatLng(arrayLatitude[counter1], arrayLongitude[counter1])))
{
alert("Inside");
}
else
{
alert("Outside");
}