/**
 * 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 ($('#unfair_agreement-checkbox').find('.icheck-control').length > 0) {
            $('#unfair_agreement-checkbox').iCheck('disable');
        } else {
            $('#unfair_agreement-checkbox').prop('disabled', 'disabled');
        }
        $(document).on('click', '#unfair_iagreeterms', function(e) {
            if ($('#unfair_agreement-checkbox').find('.checkbox-styled').length > 0) {
                $('#unfair_agreement-checkbox').iCheck('enable');
                $('#unfair_agreement-checkbox').iCheck('check');
            } else {
                $('#unfair_agreement-checkbox').removeProp('disabled');
            }
        });
        
    } else {
    
    
        $('#unfair_agreement').prop('disabled', 'disabled');



        $('#unfair_iagreeterms').click(function (e) {
            $('#unfair_agreement').removeProp('disabled');

            if ($('#iCheck-unfair_agreement').length > 0) {
                $('#unfair_agreement').iCheck('enable');
                $('#unfair_agreement').iCheck('check');
            } else {
                $('#unfair_agreement').removeProp('disabled');
            }
        });
        
    }
    
    $('#read_unfair_policy').click(function (e) {
        e.preventDefault;
        $('#unfair_Modal').modal('show');
        return false;
    });    
        
});
