most likely it is an issue of scope due to where you are initially
declaring
var markerCluster = new MarkerClusterer(map,allMarkers, {gridSize: 5,
zoomOnClick: false});
It needs to be global.
try doing:
var markerCluster = null; at the very TOP of your code before you do
anything else. Most likely you are declaring your map variable
somewhere like this needs to be done.
then later where you have the
var markerCluster = new MarkerClusterer(map,allMarkers, {gridSize: 5,
zoomOnClick: false});
just remove the "var" and change it to:
markerCluster = new MarkerClusterer(map,allMarkers, {gridSize: 5,
zoomOnClick: false});
I think it will work then.