Q:

What is Wrong in Custom.js File?

I am trying to add this code below to it:
$("#tabs").tabs("#tab-items section", {
  effect: 'fade',
  fadeOutSpeed: 0,
  fadeInSpeed: 400
});

$(".option-set").on("click", "a", function(e) {
    $(this).addClass('selected')
      .parent().siblings().find("a").removeClass('selected');
});

But wherever I put it, I get an error and random things stop working.  Here is my entire custom.js file, did I code the file improperly?  I'm not entirely sure when I should be using the $(function() { command, and when it's fine without it.
/* --------------------------------------------------------------

INDEX:

[1] Search
[2] Popout Window
[3] Form Numbers
[4] Nav Bar
[5] Smooth Scroll
[6] Estimate Form

-------------------------------------------------------------- */

/* --------------------------------------------------------------

[1*] Search

-------------------------------------------------------------- */

document.getElementById('headerSearch').onsubmit = function() {
    window.location = "javascript:poptastic('http://www.google.com/search?q=site:northtownsremodeling.com ' + document.getElementById('headerInput').value);"
      return false;}

/* --------------------------------------------------------------

[2*] Popout Window

-------------------------------------------------------------- */

var newwindow; function poptastic(url){
  newwindow=window.open(url,'name', 'height=800,width=1020,scrollbars=yes');
    if (window.focus) {newwindow.focus()}}

/* --------------------------------------------------------------

[3*] Form Numbers

-------------------------------------------------------------- */

jQuery(function($){
    $("#menu-primary-number").mask("(999) 999-9999");
    $("#menu-zip").mask("99999");
});

/* --------------------------------------------------------------

[4*] Set Selected Menu Items & Hide

-------------------------------------------------------------- */
/*START FUNCTION*/
$(function() {

    $("#header-subnav ul").hide();
    $('.menu-option-set a[data-subid]').on('click', function(e) {
        e.preventDefault();
        var $s = $("#" + $(this).attr('data-subid'));                
        if($s.is(':hidden')) {
            $("#header-subnav").removeClass('hidden');
            $("#header-subnav ul").hide();
            $s.show();
        } else {
            $s.hide();
            $("#header-subnav").addClass('hidden');
        }
    });

    $('.menu-option-set a').click(function()
    {
        // if clicked item is selected then deselect it
        if ($(this).hasClass('selected'))
        {
            $(this).removeClass('selected');
        }

        // otherwise deselect all and select just this one
        else
        {
            $('.menu-option-set a').removeClass('selected');
            $(this).addClass('selected');
        }
    });

/* --------------------------------------------------------------

[5*] Smooth Scroll

-------------------------------------------------------------- */

    $('.navbar a, .scroll a, .smoothscroll a').bind('click',function(event){
        var $anchor = $(this);

        $('html, body').stop().animate({
            scrollTop: $($anchor.attr('href')).offset().top
        }, 850,'easeInOutExpo');
        /*
        if you don't want to use the easing effects:
        $('html, body').stop().animate({
            scrollTop: $($anchor.attr('href')).offset().top
        }, 1000);
        */
        event.preventDefault();
    });

/* --------------------------------------------------------------

[6*] Estimate Form

-------------------------------------------------------------- */

    // Setup any needed variables.
    var $form   = $('.estimate-form'),
        $loader = '<img src="/img/loader.gif" height="11" width="16" alt="Loading..." />';

    $form.append('<div id="response" class="hidden">');
    var $response = $('#response');

    // Do what we need to when form is submitted.
    $form.on('click', 'input[type=submit]', function(e){

        // Hide any previous response text and show loader
        $response.hide().html( $loader ).show();

        // Make AJAX request 
        $.post('/resource/script/estimate-send.php', $form.serialize(), function( data ) {

            // Show response message
            $response.html( data );

            // Scroll to bottom of the form to show respond message
            var bottomPosition = $form.offset().top + $form.outerHeight() - $(window).height();

            if( $(document).scrollTop() < bottomPosition )
                $('html, body').animate({ scrollTop : bottomPosition });

            // If form has been sent succesfully, clear it
            if( data.indexOf('success') !== -1 )
                $form.find('input:not(input[type="submit"], input[type="reset"]), textarea, select').val('').attr( 'checked', false );

        });

        // Cancel default action
        e.preventDefault();
    });

});/*END FUNCTION*/

Thanks guys! / Gals!
EDIT: the error that comes up when I put it in is this:
Uncaught TypeError: Object [object Object] has no method 'tabs' 

A:

It seems you haven't added JQueryUI.js to your HTML file.

