add browser compatible function, now the application can run in ie and
chrome, waiting to test in firefox, openra and safari