calculate model dialog header/footer height
new codes updated by client