/**
 * WS Agree Terms | (c) 2025 whmcsservices.com
 * Created By WHMCSServices      http://www.whmcsservices.com
 * License: You must have a valid license purchased in order to legally use the module for your project.
 * Author - WHMCSServices
 */

$(document).ready(function () {
    
    
    if (template === 'lagom2') {
        
        
        if ($('#tos-checkbox').find('.icheck-control').length > 0) {
            $('#tos-checkbox').iCheck('disable');
        } else {
            $('#tos-checkbox').prop('disabled', 'disabled');
        }
        $(document).on('click', '#iagreeterms', function(e) {
            if ($('#tos-checkbox').find('.checkbox-styled').length > 0) {
                $('#tos-checkbox').iCheck('enable');
                $('#tos-checkbox').iCheck('check');
            } else {
                $('#tos-checkbox').removeProp('disabled');
            }
        });
    } else {
        if ($('#iCheck-accepttos').length > 0) {
            $('#accepttos').iCheck('disable');
        } else {
            $('#accepttos').prop('disabled', 'disabled');
        }
        $(document).on('click', '#iagreeterms', function(e) {
            if ($('#iCheck-accepttos').length > 0) {
                $('#accepttos').iCheck('enable');
                $('#accepttos').iCheck('check');
            } else {
                $('#accepttos').removeProp('disabled');
            }
        });
    }
    $('#tosreading').click(function (e) {
        e.preventDefault;
        $('#myModal').modal('show');
        return false;
    });
});
