function getWindowHeight() {
    var windowHeight = 0;
    if (typeof (window.innerHeight) == 'number') {
        windowHeight = window.innerHeight;
    }
    else {
        if (document.documentElement && document.documentElement.clientHeight) {
            windowHeight = document.documentElement.clientHeight;
        }
    }
    return windowHeight;
}

function hideMenu(menuId) {
	document.getElementById(menuId).style.top = '-2000px';
	document.getElementById('regionContainer').style.overflow = 'hidden';
}
  function clearCallIn(menuId) {
	  var codeString = 'window.clearTimeout(timeoutId' + menuId + ')';
	  document.getElementById('regionContainer').style.overflow = 'visible';
	  eval(codeString);  
  }
  function callIn(menuId) {
	var codeString = 'window.timeoutId' +menuId + ' = setTimeout("hideMenu(\''+menuId+'\')",1000)';
	eval(codeString);
  }
  function showMenu(menuId) {
      if (document.getElementById) {
          var windowHeight = getWindowHeight();
          if (windowHeight > 0) {
              var contentHeight = document.getElementById('mainContent').offsetHeight;
              document.getElementById(menuId).style.top = (contentHeight - (25 + regionSelectorCount * 16)) + 'px';
			  document.getElementById('regionContainer').style.overflow = 'visible';
          }
      }
	  timeOutName = eval('window.timeoutId'+menuId);
	  if (timeOutName) {
		  clearCallIn(menuId);
	  }
  }
