There is no reason to do both document.ready and $(function...