code: function () {
  
  		var nDisplayRegionHeight = getDisplayRegionHeight(),
  			bMenuHasItems = (oMenu.getItems().length > 0),
  			nMenuMinScrollHeight,
  			fnReturnVal;
  
  
  		if (nMenuOffsetHeight > nDisplayRegionHeight) {
  
  			nMenuMinScrollHeight = 
  				bMenuHasItems ? oMenu.cfg.getProperty(_MIN_SCROLL_HEIGHT) : nMenuOffsetHeight;
  
  
  			if ((nDisplayRegionHeight > nMenuMinScrollHeight) && bMenuHasItems) {
  				nMaxHeight = nDisplayRegionHeight;
  			}
  			else {
  				nMaxHeight = nInitialMaxHeight;
  			}
  
  
  			oMenu._setScrollHeight(nMaxHeight);
  			oMenu.hideEvent.subscribe(resetMaxHeight);
  			
  
  			// Re-align the Menu since its height has just changed
  			// as a result of the setting of the maxheight property.
  
  			alignY();
  			
  
  			if (nDisplayRegionHeight < nMenuMinScrollHeight) {
  
  				if (bFlipped) {
  	
  					/*
  						 All possible positions and values for the "maxheight" 
  						 configuration property have been tried, but none were 
  						 successful, so fall back to the original size and position.
  					*/
  
  					flipVertical();
  					
  				}
  				else {
  	
  					flipVertical();
  
  					bFlipped = true;
  	
  					fnReturnVal = setVerticalPosition();
  	
  				}
  				
  			}
  		
  		}
  		else if (nMaxHeight && (nMaxHeight !== nInitialMaxHeight)) {
  		
  			oMenu._setScrollHeight(nInitialMaxHeight);
  			oMenu.hideEvent.subscribe(resetMaxHeight);
  
  			// Re-align the Menu since its height has just changed
  			// as a result of the setting of the maxheight property.
  
  			alignY();
  		
  		}
  
  		return fnReturnVal;
  
  	}
docs: /*
  Trys to place the Menu in the best possible position (either above or
  below its corresponding context element).