function getWindowHeight() {if (window.self && self.innerHeight) {return self.innerHeight;
}if (document.documentElement && document.documentElement.clientHeight) {return document.documentElement.clientHeight;
}return 0; }

function getWindowWidth() {if (window.self && self.innerWidth) {return self.innerWidth;
}if (document.documentElement && document.documentElement.clientWidth) {return document.documentElement.clientWidth;
}return 0; }

function MMS_onLoad_() {
  MMS_onResize_(true);
  if (typeof(MMS_onLoad) == 'function') MMS_onLoad(); 
}

function MMS_onUnload_() {
  if (typeof(MMS_onUnload) == 'function') MMS_onUnload(); 
}

function MMS_onResize_(onload) {
  if (typeof(MMS_onResize) == 'function') MMS_onResize(onload); 
}

function MMS_onResizeMap() {
var map = document.getElementById('map');
if (map.className == "fixed") return;
var offsetTop = 0;
var offsetLeft = 0;
for (var e = map; e != null; e = e.offsetParent) { offsetTop += e.offsetTop; offsetLeft += e.offsetLeft; }
var height = getWindowHeight() - offsetTop;
var width = getWindowWidth() - offsetLeft;
if (height > 0) { map.style.height = ""+height+"px"; }
if (width > 0) { map.style.width = ""+width+"px"; }
}

