pure javascript preloader