added window load function to replace doc ready