Little know method that disposes the map, add it to the body.
function DisposeMap() //dispose map etc
{
if (map != null)
{
map.Dispose();
}
}
usage:
<body onload="GetMap();" onunload="DisposeMap();">
It has been my experience that VE will attach to the onunload event itself. I found that I have to do this instead:
if (map && map.vemapcontrol) {
map.Dispose();
}