change window.onload to $(document).ready