How to add JQuery code to drupal site
If you don't know how to add your js code to drupal, there are two ways:


Create js file in your theme_folder/js, e.g, scripts.js, put your code into that file, open .info file of theme and add scripts[]=js/scripts.js
Create a js file as I wrote above and open template.php of your theme and put       

drupal_add_js(drupal_get_path('theme', 'YOUR_THEME_NAME') . '/js/scripts.js', array('type' =&gt; 'file', 'group' =&gt; JS_THEME));


in YOUR_THEME_preprocess_page(). 
(This is not an ideal way, but it shows how you can use a drupal_add_js() function)


also read documentation for more info.