Uncaught TypeError: Cannot call method 'extend' of undefined
You are attempting to use jQuery before it's loaded.

You should place that code inside your ready function:

$(document).ready(function () {
    // place code here
});


Although to be really Drupal-friendly, you should use Drupal's behaviors.