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

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