( function ( $ ) {

    $( document ).ready( function() {

        /**
         * Terms and Conditions
         */
        if ( $( '#tc_term_page' ).is( ':checked' ) ) {
            $( '#tc_term_editor' ).hide();
            $( '#tc_term_select_page' ).show();

        } else {
            $( '#tc_term_select_page' ).hide();
            $( '#tc_term_editor' ).show();
        }

        $( '#tc_term_popup' ).click( function() {
            $( '#tc_term_select_page' ).hide();
            $( '#tc_term_editor' ).show();
        } );

        $( '#tc_term_page' ).click( function() {
            $( '#tc_term_editor' ).hide();
            $( '#tc_term_select_page' ).show();
        } )

        /**
         * Privacy Policy
         */
        if ( $( '#tc_privacy_page' ).is( ':checked' ) ) {
            $( '#tc_privacy_editor' ).hide();
            $( '#tc_privacy_select_page' ).show();

        } else {
            $( '#tc_privacy_select_page' ).hide();
            $( '#tc_privacy_editor' ).show();
        }

        $( '#tc_privacy_popup' ).click( function() {
            $( '#tc_privacy_select_page' ).hide();
            $( '#tc_privacy_editor' ).show();
        } );

        $( '#tc_privacy_page' ).click( function() {
            $( '#tc_privacy_editor' ).hide();
            $( '#tc_privacy_select_page' ).show();
        } )
    });

})( jQuery );
