You are using jQuery items ($ specifically) before they have been defined. ie your script
$(document).ready
appears before the <script> include of jQuery itself which is at the bottom of the page. Move the script references to the top of the page, or put the script that is on your product page into its own js file and include it after the js include.