calc function cross-browser compatibility