If WebBrowser1_DocumentCompleted
is leaved out like it was initially the other way round is to add an instruction if (map) return;
at the start of Initialize() because for some reason looks like the javascript is modified, which makes the DocumentCompleted to be called again, which again invokes Initialize() and so in an infinit loop.
function Initialize(zoomLevel,lat,lng,type){
//Get the type of map to start.
//Need to convert the GoogleMapType enum
//to an actual Google Map Type
if(map) return;
var MapType;
switch (type)
{
// ....