Enter the total income before taxes and deductions.
Enter the total income before taxes and deductions.
Enter the total number of years the couple was married.
Enter how long support should be paid. Often linked to marriage duration.
A factor representing the impact of child custody arrangements (e.g., 0.1 for primary custody).
Estimated Alimony Payment
—
Annual Alimony Payment:—
Monthly Alimony Payment:—
Total Alimony Paid Over Term:—
Formula Basis: This calculation is a simplified estimation. It uses a common approach: (Payer's Income – Payee's Income) * 0.4, adjusted by marriage duration and a child custody factor. Actual alimony is determined by courts considering many factors.
Alimony Over Time Projection
Annual Alimony Breakdown
Year
Payer's Income
Payee's Income
Alimony Paid
Cumulative Alimony
What is Spouse Alimony?
Spouse alimony, often referred to as spousal support or maintenance, is a court-ordered payment from one spouse to another during or after a divorce or legal separation. The primary purpose of alimony is to help a financially dependent spouse maintain a reasonable standard of living, especially when they have sacrificed career opportunities to support the marriage, or when there's a significant income disparity between the spouses. It's crucial to understand that alimony is not a guaranteed right; its award, amount, and duration are determined by specific legal guidelines and the unique circumstances of each case. It's distinct from child support, which is focused on the financial needs of children.
Who Should Use a Spouse Alimony Calculator?
Anyone involved in or anticipating a divorce or separation where financial support between spouses is a consideration should find a spouse alimony calculator useful. This includes:
Individuals considering divorce who want to understand potential financial outcomes.
Spouses who have been out of the workforce or have lower earning capacity due to domestic responsibilities.
Spouses with significantly higher incomes who may be required to pay support.
Legal professionals (attorneys, mediators) looking for a preliminary estimation tool.
A spouse alimony calculator provides a starting point for financial planning and negotiation. It helps manage expectations by offering a quantifiable estimate based on common inputs.
Common Misconceptions About Alimony
Several myths surround alimony, leading to misunderstandings:
Alimony is always awarded: This is false. Alimony is not automatic and depends heavily on state laws, the length of the marriage, the needs of one spouse, and the ability of the other to pay.
Alimony duration is fixed: While some states have guidelines (e.g., half the length of the marriage), judges have discretion. Many alimony awards are rehabilitative (designed to help a spouse become self-supporting) or permanent in long-term marriages.
Alimony is tax-deductible: For agreements finalized after December 31, 2018, alimony payments are generally NOT tax-deductible for the payer and NOT taxable income for the recipient under federal law (though state laws may vary). Prior agreements might still have tax implications.
Alimony is only for the wife: Alimony can be paid by either spouse, regardless of gender, based on financial need and ability to pay.
Using a reliable spouse alimony calculator can help clarify these points by showing how specific inputs influence potential outcomes.
Spouse Alimony Formula and Mathematical Explanation
The calculation of alimony is complex and varies significantly by jurisdiction. There isn't a single universal formula. However, many states use guidelines or formulas that consider several key factors. A common, simplified approach often involves a percentage of the difference between the spouses' incomes, modified by the duration of the marriage and other factors. Our alimony payment calculator uses a generalized model to provide an estimate.
Step-by-Step Derivation (Simplified Model)
Calculate Income Disparity: Subtract the payee's gross annual income from the payer's gross annual income.
Apply Income Percentage: Multiply the income disparity by a percentage, commonly around 30-40%. This establishes a baseline support amount.
Adjust for Marriage Duration: The duration of the marriage is a critical factor. Longer marriages often result in longer support durations, and sometimes higher amounts. In this calculator, we use a multiplier related to marriage duration, though in practice, duration often dictates the *maximum* term rather than directly adjusting the payment amount.
Incorporate Child Custody Factor: If children are involved and one parent has primary custody, this can influence alimony, potentially reducing the payer's obligation or influencing the payee's need. A factor is applied here to reflect this.
Calculate Annual and Monthly Alimony: The adjusted baseline figure becomes the estimated annual alimony. This is then divided by 12 for the monthly estimate.
Total Alimony Calculation: Multiply the monthly or annual alimony by the determined support duration.
Variables Explained
The inputs used in our spousal support calculator represent crucial elements considered in alimony determinations:
Variable
Meaning
Unit
Typical Range/Consideration
Payer's Gross Annual Income
The total income of the spouse obligated to pay alimony, before taxes and deductions.
Currency (e.g., USD)
$20,000 – $1,000,000+
Payee's Gross Annual Income
The total income of the spouse seeking or receiving alimony, before taxes and deductions.
Currency (e.g., USD)
$0 – $500,000+
Duration of Marriage (Years)
The total length of time the couple was legally married.
Years
1 – 50+ years
Desired Support Duration (Years)
The proposed or legally mandated period for which alimony will be paid.
Years
0.5 – 20+ years (often tied to marriage duration)
Child Custody Factor
A factor reflecting the impact of primary physical custody of minor children on the financial needs and abilities of each spouse.
Decimal (0 to 1)
0.0 to 0.5 (higher values suggest greater impact)
Annual Alimony Payment
The estimated total alimony amount to be paid over one year.
Currency (e.g., USD)
Calculated
Monthly Alimony Payment
The estimated alimony amount to be paid each month.
Currency (e.g., USD)
Calculated
Total Alimony Paid
The sum of all alimony payments over the entire support duration.
Currency (e.g., USD)
Calculated
Note: Legal formulas often include many more variables such as marital standard of living, age and health of spouses, contributions to the marriage (including domestic labor), separate property, and future earning capacities. This calculator provides a simplified overview.
Practical Examples (Real-World Use Cases)
Example 1: Moderate Income Disparity, Long Marriage
Scenario: Sarah and John were married for 15 years. John earns $120,000 annually, while Sarah, after focusing on raising their two children, earns $40,000 annually. They agree that Sarah should receive support for 7.5 years (half the marriage duration). There are no current minor children requiring significant custody adjustments impacting finances directly.
Inputs:
Payer's Gross Annual Income: $120,000
Payee's Gross Annual Income: $40,000
Duration of Marriage: 15 Years
Desired Support Duration: 7.5 Years
Child Custody Factor: 0.0 (no significant impact)
Calculation Result (Illustrative):
Income Difference: $120,000 – $40,000 = $80,000
Baseline Annual Alimony: $80,000 * 0.40 = $32,000
Estimated Annual Alimony: $32,000
Estimated Monthly Alimony: $32,000 / 12 = ~$2,667
Total Alimony Paid: $32,000 * 7.5 = $240,000
Financial Interpretation: John would pay approximately $2,667 per month to Sarah for 7.5 years. This helps Sarah maintain a reasonable standard of living while she potentially increases her earning capacity or adjusts to her post-divorce financial situation. The total paid reflects the substantial duration of the marriage.
Example 2: High Income Earner, Shorter Marriage, Primary Custody
Scenario: Michael and Emily were married for 6 years. Michael's income is $250,000 annually, and Emily's is $60,000. Emily has primary custody of their young child. They are considering a support duration of 3 years.
Inputs:
Payer's Gross Annual Income: $250,000
Payee's Gross Annual Income: $60,000
Duration of Marriage: 6 Years
Desired Support Duration: 3 Years
Child Custody Factor: 0.2 (Emily has primary custody)
Factor Adjustment (Illustrative – may reduce support): Let's assume the custody factor leads to a slight reduction, perhaps lowering the annual target slightly, e.g., ~$70,000 annually for simplicity in this model. *Note: Real formulas handle this differently, sometimes impacting net income calculations.*
Estimated Annual Alimony: $70,000
Estimated Monthly Alimony: $70,000 / 12 = ~$5,833
Total Alimony Paid: $70,000 * 3 = $210,000
Financial Interpretation: Michael would pay approximately $5,833 monthly for 3 years. The higher income disparity results in a significant monthly payment, but the shorter marriage duration limits the total payout compared to Example 1. Emily's primary custody role is factored in, potentially balancing needs against obligations. This example highlights how different circumstances yield vastly different alimony estimates.
How to Use This Spouse Alimony Calculator
Our spouse alimony calculator is designed for simplicity and ease of use. Follow these steps to get an estimated alimony figure:
Step-by-Step Instructions
Enter Payer's Income: Input the gross annual income of the spouse who is expected to pay alimony.
Enter Payee's Income: Input the gross annual income of the spouse who is expected to receive alimony.
Input Marriage Duration: Provide the total number of years the couple was married. This is a critical factor in determining eligibility and duration of support.
Specify Support Duration: Enter the desired or legally suggested number of years for alimony payments. This is often related to the marriage duration.
Adjust Child Custody Factor (Optional but Recommended): If applicable, enter a value between 0 and 1. A higher value indicates primary custody has a significant financial impact. A value of 0 means no specific adjustment for custody.
Click 'Calculate Alimony': The calculator will process the inputs and display the estimated results.
How to Read Results
Main Result (Highlighted): This shows the estimated *monthly* alimony payment. It's the most frequently referenced figure for budgeting.
Annual Alimony: Your estimated alimony obligation or receipt over a full year.
Monthly Alimony: The estimated payment per month, useful for immediate budgeting.
Total Alimony Paid: The total sum expected over the entire support duration.
Table and Chart: These provide a year-by-year breakdown and visual representation of the alimony payments, showing how the cumulative amount grows over time.
Decision-Making Guidance
The results from this spousal support calculator should be used as a starting point for discussions and negotiations. They are estimates and not legally binding court orders. Consider the following:
Negotiation Baseline: Use the figures to inform your negotiation strategy. If you are the payer, understand your potential obligation; if you are the payee, understand your potential support needs.
Legal Consultation: Always consult with a qualified family law attorney. They can explain how your specific state's laws apply and advise on factors not included in this calculator, such as marital standard of living, individual needs, ability to pay, fault (in some states), and rehabilitative potential.
Financial Planning: Use the estimated total alimony to plan your long-term financial future, whether it's budgeting for payments or planning how to utilize received support.
Key Factors That Affect Alimony Results
While our calculator simplifies the process, real-world alimony decisions are influenced by a multitude of factors. Understanding these can provide a clearer picture:
Income Disparity: This is perhaps the most significant factor. A larger gap between the spouses' incomes generally leads to a higher potential alimony award. The calculator directly incorporates this.
Duration of Marriage: Longer marriages are more likely to result in alimony awards, and the duration of payments often correlates with the length of the marriage. Some states have specific guidelines, like awarding support for half the marriage duration for marriages over a certain length.
Financial Need and Ability to Pay: The court assesses the genuine need of the lower-earning spouse and the capacity of the higher-earning spouse to provide support without undue hardship. This includes analyzing budgets, expenses, and earning potentials.
Standard of Living During Marriage: Courts often aim for the recipient spouse to maintain a standard of living reasonably comparable to that enjoyed during the marriage, especially in long-term marriages. This requires evaluating the lifestyle expense history.
Age and Health of Spouses: Advanced age or significant health issues can impede a spouse's ability to become self-supporting, potentially leading to longer or permanent alimony awards.
Contributions to the Marriage: This includes not just financial contributions but also non-monetary contributions like homemaking, childcare, and supporting the other spouse's education or career advancement. These are vital considerations for alimony.
Educational and Career Sacrifices: If one spouse deferred education or career progression to support the family or the other spouse's career, this is a strong argument for alimony to allow them time and resources to re-enter or advance in the workforce.
Separate Property and Assets: The amount of separate property (owned before marriage or received as gifts/inheritance) each spouse possesses can influence alimony calculations.
Rehabilitative Potential: Courts assess how long it might take for the lower-earning spouse to acquire the education, training, or skills necessary to become self-supporting. This informs the duration of rehabilitative alimony.
Taxes: While alimony is generally not tax-deductible or taxable for recent agreements, the tax implications of income and expenses for both parties can still be indirectly considered in ensuring a fair overall financial outcome post-divorce.
Our alimony calculator serves as a basic tool; a legal professional will delve into all these nuances.
Frequently Asked Questions (FAQ)
What is the difference between alimony and child support?
Child support is exclusively for the financial needs of the children, covering expenses like housing, food, education, and healthcare. Alimony (spousal support) is for the financial needs of a spouse, aiming to maintain a standard of living or facilitate self-sufficiency. They are calculated using different criteria and are legally distinct.
How long does alimony typically last?
The duration varies greatly. For short marriages, it might be temporary or non-existent. For long-term marriages (often defined as 10-20+ years), it can be for a set period (rehabilitative) or potentially permanent. Many states use guidelines, such as half the length of the marriage, but judges have discretion based on individual circumstances.
Can alimony be modified after the divorce?
Yes, alimony can often be modified if there is a substantial change in circumstances for either the payer or the recipient. This could include job loss, significant income increase or decrease, remarriage of the recipient (which may terminate or reduce alimony), or changes in needs due to health. Modifications typically require a court order.
What happens if the paying spouse doesn't pay alimony?
If a spouse fails to pay court-ordered alimony, the recipient can take legal action. Enforcement mechanisms include wage garnishment, bank account levies, liens on property, passport denial, and even jail time (contempt of court). It's a serious legal obligation.
Does remarriage of the recipient spouse affect alimony?
In most jurisdictions, the remarriage of the recipient spouse typically leads to the termination of alimony payments. This is because the legal obligation of support is transferred to the new spouse. Cohabitation may also trigger termination or modification in some states, depending on the specifics.
Are there limits on how much alimony can be awarded?
Yes, while not always a strict cap, courts consider the payer's ability to pay without causing undue hardship and the recipient's needs and standard of living. Some states have statutory formulas or advisory guidelines that help define limits, while others rely more on judicial discretion based on a list of statutory factors.
What is "rehabilitative alimony"?
Rehabilitative alimony is financial support paid for a limited period, intended to help a spouse gain the necessary education, training, or work experience to become self-supporting. It's common in cases where one spouse has been out of the workforce for an extended time.
Does fault in the divorce affect alimony?
In some states ("no-fault" states), marital misconduct is not considered when determining alimony. However, in other states, fault (such as adultery, abandonment, abuse) can be a factor the court considers when deciding whether to award alimony, its amount, and its duration.
Understand the principles and common methods for dividing property during a divorce.
var chartInstance = null; // Global variable to hold chart instance
function calculateAlimony() {
// Clear previous errors and results
document.getElementById('payerIncomeError').textContent = ";
document.getElementById('payeeIncomeError').textContent = ";
document.getElementById('marriageDurationYearsError').textContent = ";
document.getElementById('supportDurationYearsError').textContent = ";
document.getElementById('custodyFactorError').textContent = ";
document.getElementById('result-container').style.display = 'none';
var payerIncome = parseFloat(document.getElementById('payerIncome').value);
var payeeIncome = parseFloat(document.getElementById('payeeIncome').value);
var marriageDurationYears = parseFloat(document.getElementById('marriageDurationYears').value);
var supportDurationYears = parseFloat(document.getElementById('supportDurationYears').value);
var custodyFactor = parseFloat(document.getElementById('custodyFactor').value);
var errors = false;
// Input Validation
if (isNaN(payerIncome) || payerIncome < 0) {
document.getElementById('payerIncomeError').textContent = 'Please enter a valid positive number for payer income.';
errors = true;
}
if (isNaN(payeeIncome) || payeeIncome < 0) {
document.getElementById('payeeIncomeError').textContent = 'Please enter a valid positive number for payee income.';
errors = true;
}
if (isNaN(marriageDurationYears) || marriageDurationYears <= 0) {
document.getElementById('marriageDurationYearsError').textContent = 'Please enter a valid positive number for marriage duration.';
errors = true;
}
if (isNaN(supportDurationYears) || supportDurationYears <= 0) {
document.getElementById('supportDurationYearsError').textContent = 'Please enter a valid positive number for support duration.';
errors = true;
}
if (isNaN(custodyFactor) || custodyFactor 1) {
document.getElementById('custodyFactorError').textContent = 'Custody factor must be between 0 and 1.';
errors = true;
}
if (errors) {
return; // Stop calculation if there are errors
}
// — Core Alimony Calculation Logic —
// This is a simplified model. Real-world calculations are more complex and jurisdiction-dependent.
var incomeDifference = payerIncome – payeeIncome;
var baseAnnualAlimony = 0;
// Ensure payer income is higher for alimony to be paid by payer
if (incomeDifference > 0) {
// Apply a percentage (e.g., 40%) to the income difference
baseAnnualAlimony = incomeDifference * 0.40;
} else {
// If payee has higher or equal income, payer doesn't pay alimony in this model
baseAnnualAlimony = 0;
}
// Simple adjustment for marriage duration (e.g., cap support duration or slightly adjust amount)
// For simplicity, we primarily use supportDurationYears directly.
// A more complex model might use marriageDurationYears to influence supportDurationYears or apply a factor.
// Apply custody factor – this is illustrative, actual formulas vary wildly.
// This example might slightly reduce calculated alimony if custody factor is high,
// assuming custody responsibilities influence recipient's needs or payer's ability.
// A more common approach is that custody impacts need/ability directly, not a simple multiplier on calculated alimony.
// Let's use it to adjust the *payee's perceived need* implicitly, or just as a factor.
// For this model, let's assume it might slightly *reduce* the calculated alimony amount
// if the custody factor is high, implying the recipient has significant duties that also require resources.
// Or, a more realistic interpretation: higher custody factor might mean recipient needs MORE support to manage that.
// Let's stick to a simple reduction for demonstration, but acknowledge complexity.
var adjustedAnnualAlimony = baseAnnualAlimony;
if(incomeDifference > 0) { // Only adjust if payer is paying
// Example: If custody factor is 0.2, reduce alimony by 20% of the base calculation.
// THIS IS HIGHLY SIMPLIFIED. Many formulas are more complex.
adjustedAnnualAlimony = baseAnnualAlimony * (1 – custodyFactor * 0.5); // Reduce alimony by up to 50% if custody factor is 1.0
}
// Ensure calculated alimony is not negative and not more than payer can reasonably afford (simplified)
adjustedAnnualAlimony = Math.max(0, adjustedAnnualAlimony);
// Avoid alimony exceeding a certain % of payer's income, e.g., 30%
adjustedAnnualAlimony = Math.min(adjustedAnnualAlimony, payerIncome * 0.30);
var annualAlimony = adjustedAnnualAlimony;
var monthlyAlimony = annualAlimony / 12;
var totalAlimony = annualAlimony * supportDurationYears;
// Format currency values
var currencyFormatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 0,
maximumFractionDigits: 0
});
document.getElementById('main-result').textContent = currencyFormatter.format(monthlyAlimony);
document.getElementById('annualAlimony').textContent = currencyFormatter.format(annualAlimony);
document.getElementById('monthlyAlimony').textContent = currencyFormatter.format(monthlyAlimony);
document.getElementById('totalAlimony').textContent = currencyFormatter.format(totalAlimony);
document.getElementById('result-container').style.display = 'block';
// Update chart and table
updateChartAndTable(payerIncome, payeeIncome, annualAlimony, supportDurationYears);
}
function updateChartAndTable(payerIncome, payeeIncome, annualAlimony, supportDurationYears) {
var alimonyTableBody = document.getElementById('alimonyTableBody');
alimonyTableBody.innerHTML = "; // Clear existing rows
var cumulativeAlimony = 0;
var chartData = {
labels: [],
datasets: [
{
label: 'Alimony Paid',
data: [],
borderColor: 'var(–primary-color)',
backgroundColor: 'rgba(0, 74, 153, 0.2)',
fill: false,
tension: 0.1
},
{
label: 'Payer\'s Income After Alimony',
data: [],
borderColor: '#6c757d', // Secondary color
backgroundColor: 'rgba(108, 117, 125, 0.2)',
fill: false,
tension: 0.1
}
]
};
var currencyFormatter = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 0, maximumFractionDigits: 0 });
// Limit table/chart generation to a reasonable number of years (e.g., 20) to prevent excessive data
var maxYearsToShow = Math.min(Math.ceil(supportDurationYears), 20);
for (var year = 1; year <= maxYearsToShow; year++) {
var currentAnnualAlimony = (year maxYearsToShow) {
var finalYear = Math.ceil(supportDurationYears);
var finalTotalAlimony = annualAlimony * supportDurationYears;
var payerIncomeAtEnd = payerIncome – annualAlimony; // Assuming payment continues till end
var row = alimonyTableBody.insertRow();
row.insertCell(0).textContent = `${maxYearsToShow + 1} – ${finalYear} (Final)`;
row.insertCell(1).textContent = currencyFormatter.format(payerIncome);
row.insertCell(2).textContent = currencyFormatter.format(payeeIncome);
row.insertCell(3).textContent = currencyFormatter.format(annualAlimony) + ' (avg)';
row.insertCell(4).textContent = currencyFormatter.format(finalTotalAlimony);
// Add final points to chart data if not already covered
if (chartData.labels.length < supportDurationYears) {
chartData.labels.push(`Year ${finalYear}`);
chartData.datasets[0].data.push(annualAlimony); // Average for the final period
chartData.datasets[1].data.push(payerIncomeAtEnd);
}
}
updateChart(chartData);
}
function updateChart(data) {
var ctx = document.getElementById('alimonyChart').getContext('2d');
// Destroy previous chart instance if it exists
if (chartInstance) {
chartInstance.destroy();
}
chartInstance = new Chart(ctx, {
type: 'line',
data: data,
options: {
responsive: true,
maintainAspectRatio: false, // Allows custom height/width
scales: {
y: {
beginAtZero: true,
ticks: {
callback: function(value) {
if (value % 10000 === 0) { // Format ticks for better readability
return '$' + value.toLocaleString();
}
return '';
}
}
}
},
plugins: {
tooltip: {
callbacks: {
label: function(context) {
var label = context.dataset.label || '';
if (label) {
label += ': ';
}
if (context.parsed.y !== null) {
label += new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 0, maximumFractionDigits: 0 }).format(context.parsed.y);
}
return label;
}
}
},
legend: {
position: 'top',
}
}
}
});
}
// Function to handle FAQ toggling
function toggleFaq(element) {
var faqItem = element.closest('.faq-item');
faqItem.classList.toggle('open');
}
function resetCalculator() {
document.getElementById('payerIncome').value = '100000';
document.getElementById('payeeIncome').value = '50000';
document.getElementById('marriageDurationYears').value = '10';
document.getElementById('supportDurationYears').value = '5';
document.getElementById('custodyFactor').value = '0.1';
// Clear errors and hide results
document.getElementById('payerIncomeError').textContent = '';
document.getElementById('payeeIncomeError').textContent = '';
document.getElementById('marriageDurationYearsError').textContent = '';
document.getElementById('supportDurationYearsError').textContent = '';
document.getElementById('custodyFactorError').textContent = '';
document.getElementById('result-container').style.display = 'none';
document.getElementById('alimonyTableBody').innerHTML = ''; // Clear table
if (chartInstance) {
chartInstance.destroy(); // Destroy chart
chartInstance = null;
}
}
function copyResults() {
var mainResult = document.getElementById('main-result').textContent;
var annualAlimony = document.getElementById('annualAlimony').textContent;
var monthlyAlimony = document.getElementById('monthlyAlimony').textContent;
var totalAlimony = document.getElementById('totalAlimony').textContent;
var payerIncome = document.getElementById('payerIncome').value;
var payeeIncome = document.getElementById('payeeIncome').value;
var marriageDurationYears = document.getElementById('marriageDurationYears').value;
var supportDurationYears = document.getElementById('supportDurationYears').value;
var custodyFactor = document.getElementById('custodyFactor').value;
var copyText = "— Estimated Alimony Results —\n\n";
copyText += "Monthly Alimony Payment: " + mainResult + "\n";
copyText += "Annual Alimony Payment: " + annualAlimony + "\n";
copyText += "Total Alimony Paid Over Term: " + totalAlimony + "\n\n";
copyText += "— Key Assumptions —\n";
copyText += "Payer's Gross Annual Income: $" + payerIncome + "\n";
copyText += "Payee's Gross Annual Income: $" + payeeIncome + "\n";
copyText += "Duration of Marriage: " + marriageDurationYears + " years\n";
copyText += "Support Duration: " + supportDurationYears + " years\n";
copyText += "Child Custody Factor: " + custodyFactor + "\n\n";
copyText += "Formula Basis: Simplified calculation based on income difference, duration, and custody factor. Consult a legal professional for actual determinations.\n";
navigator.clipboard.writeText(copyText).then(function() {
// Alert the user that the text was copied (optional)
// alert("Results copied to clipboard!");
// Or provide visual feedback
var copyButton = event.target;
copyButton.textContent = 'Copied!';
setTimeout(function() {
copyButton.textContent = 'Copy Results';
}, 2000);
}, function(err) {
console.error('Async: Could not copy text: ', err);
alert("Failed to copy results. Please copy manually.");
});
}
// Initial calculation on page load if default values are present
document.addEventListener('DOMContentLoaded', function() {
// Check if inputs have default values to trigger calculation
var defaultPayerIncome = '100000';
var defaultPayeeIncome = '50000';
var defaultMarriageDuration = '10';
var defaultSupportDuration = '5';
var defaultCustodyFactor = '0.1';
if (document.getElementById('payerIncome').value === defaultPayerIncome &&
document.getElementById('payeeIncome').value === defaultPayeeIncome &&
document.getElementById('marriageDurationYears').value === defaultMarriageDuration &&
document.getElementById('supportDurationYears').value === defaultSupportDuration &&
document.getElementById('custodyFactor').value === defaultCustodyFactor) {
calculateAlimony();
}
});
// Dummy Chart.js for preview – replace with actual Chart.js if available in WP theme
// If Chart.js is not available, this placeholder will prevent JS errors but won't render a chart.
// In a WordPress environment, you'd typically enqueue Chart.js library.
if (typeof Chart === 'undefined') {
var Chart = function() {
this.destroy = function() { console.log('Chart.js placeholder destroyed.'); };
console.log('Chart.js not found. Using placeholder.');
};
console.log('Chart.js library not detected. Chart functionality will be limited.');
}