$(document).ready(function() {

        $('.application').hide();
        $('.property').hide();
        $('.closing').hide();
        $('.testimonials').hide();
        $('.refinance').hide();
        $('.home-purchase').hide();
         $('.home-equity').hide();
         $('.debt-consolidation').hide();


        $('#application').click(function() {

            $('.application').toggle();
            $(this).toggleClass('open');

        });

        $('#property').click(function() {

            $('.property').toggle();
            $(this).toggleClass('open');

        });

        $('#closing').click(function() {

            $('.closing').toggle();
            $(this).toggleClass('open');

        });

        $('#testimonials').click(function(){

           $('.testimonials').toggle();
           $(this).toggleClass('open')
           $('.about-us').slideToggle('slow');

        });

        $('#refinance').click(function(){

           $('.refinance').toggle();
           $(this).toggleClass('open')

           if($('.our-products').is(':visible')) {

               //$('.our-products').slideUp('slow');
           }
           else {
              // $('.our-products').slideDown('slow');
           }

        });
        $('#home-purchase').click(function(){

           $('.home-purchase').toggle();
           $(this).toggleClass('open')
           
           if($('.our-products').is(':visible')) {

               //$('.our-products').slideUp('slow');
           }
           else {
              // $('.our-products').slideDown('slow');
           }

        });
        $('#home-equity').click(function(){

           $('.home-equity').toggle();
           $(this).toggleClass('open')

          if($('.our-products').is(':visible')) {

               //$('.our-products').slideUp('slow');
           }
           else {
               //$('.our-products').slideDown('slow');
           }

        });
        $('#debt-consolidation').click(function(){

           $('.debt-consolidation').toggle();
           $(this).toggleClass('open')

           if($('.our-products').is(':visible')) {

               //$('.our-products').slideUp('slow');
           }
           else {
               //$('.our-products').slideDown('slow');
           }

        });

        $('#flipTabs').tabs();

});

