you could also just put a check for the get_object returning null

Code
for (var i in menus) {
if (menus[i] != html) {
  var oMnu = get_object(menus[i]);
  if (oMnu != null) oMnu.style.display = 'none';
}
}

shoulda had null check anyways..