Medishare Calculator
.medishare-calculator-container {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
max-width: 700px;
margin: 20px auto;
padding: 25px;
border: 1px solid #e0e0e0;
border-radius: 8px;
background-color: #ffffff;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.medishare-calculator-container h2 {
color: #2c3e50;
text-align: center;
margin-bottom: 25px;
font-size: 28px;
}
.medishare-calculator-container p {
color: #555;
line-height: 1.6;
margin-bottom: 15px;
}
.calculator-form .form-group {
margin-bottom: 18px;
}
.calculator-form label {
display: block;
margin-bottom: 8px;
font-weight: bold;
color: #34495e;
}
.calculator-form select,
.calculator-form input[type="number"] {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 16px;
box-sizing: border-box;
background-color: #f8f8f8;
}
.calculator-form select:focus,
.calculator-form input[type="number"]:focus {
border-color: #007bff;
outline: none;
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}
.calculator-form button {
display: block;
width: 100%;
padding: 14px;
background-color: #28a745;
color: white;
border: none;
border-radius: 5px;
font-size: 18px;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s ease;
margin-top: 25px;
}
.calculator-form button:hover {
background-color: #218838;
}
.calculator-result {
margin-top: 30px;
padding: 20px;
border: 1px solid #d4edda;
background-color: #e9f7ef;
border-radius: 8px;
color: #155724;
font-size: 17px;
line-height: 1.8;
}
.calculator-result h4 {
color: #155724;
margin-top: 0;
margin-bottom: 15px;
font-size: 22px;
}
.calculator-result p {
margin-bottom: 10px;
}
.calculator-result strong {
color: #0a3615;
}
.medishare-article {
margin-top: 40px;
padding-top: 30px;
border-top: 1px solid #e0e0e0;
}
.medishare-article h3 {
color: #2c3e50;
font-size: 24px;
margin-bottom: 20px;
}
.medishare-article h4 {
color: #34495e;
font-size: 20px;
margin-top: 25px;
margin-bottom: 15px;
}
.medishare-article ul {
list-style-type: disc;
margin-left: 25px;
margin-bottom: 15px;
color: #555;
}
.medishare-article li {
margin-bottom: 8px;
line-height: 1.6;
}
.medishare-article strong {
color: #34495e;
}
function calculateMedishareCosts() {
var householdType = document.getElementById("householdType").value;
var annualHouseholdPortion = parseInt(document.getElementById("annualHouseholdPortion").value);
var oldestMemberAge = parseInt(document.getElementById("oldestMemberAge").value);
var resultDiv = document.getElementById("medishareResult");
// Hypothetical Medishare rates (for demonstration purposes)
// These rates are illustrative and do not reflect actual Medishare pricing.
var rates = {
"Individual": {
"3000": { "18-44": 200, "45-54": 250, "55-64": 300, "65+": 150 },
"6000": { "18-44": 150, "45-54": 200, "55-64": 250, "65+": 100 },
"9000": { "18-44": 120, "45-54": 170, "55-64": 220, "65+": 80 },
"12000": { "18-44": 100, "45-54": 150, "55-64": 200, "65+": 60 }
},
"Couple": {
"3000": { "18-44": 400, "45-54": 500, "55-64": 600, "65+": 300 },
"6000": { "18-44": 300, "45-54": 400, "55-64": 500, "65+": 200 },
"9000": { "18-44": 240, "45-54": 340, "55-64": 440, "65+": 160 },
"12000": { "18-44": 200, "45-54": 300, "55-64": 400, "65+": 120 }
},
"Family": { // Family rates often cap, so age might be less of a factor or only for oldest member
"3000": { "18-44": 600, "45-54": 750, "55-64": 900, "65+": 900 },
"6000": { "18-44": 450, "45-54": 600, "55-64": 750, "65+": 750 },
"9000": { "18-44": 360, "45-54": 510, "55-64": 660, "65+": 660 },
"12000": { "18-44": 300, "45-54": 450, "55-64": 600, "65+": 600 }
}
};
if (isNaN(oldestMemberAge) || oldestMemberAge 99) {
resultDiv.innerHTML = "Please enter a valid age for the oldest member (18-99).";
return;
}
var ageBracket;
if (oldestMemberAge >= 18 && oldestMemberAge = 45 && oldestMemberAge = 55 && oldestMemberAge = 65) {
ageBracket = "65+";
} else {
resultDiv.innerHTML = "Age out of supported range for calculation.";
return;
}
var monthlyContribution = 0;
try {
monthlyContribution = rates[householdType][annualHouseholdPortion.toString()][ageBracket];
} catch (e) {
resultDiv.innerHTML = "Could not find a rate for the selected criteria. Please check inputs.";
return;
}
if (monthlyContribution === undefined) {
resultDiv.innerHTML = "Could not find a rate for the selected criteria. Please check inputs.";
return;
}
var totalAnnualContribution = monthlyContribution * 12;
var maximumAnnualOutOfPocket = totalAnnualContribution + annualHouseholdPortion;
resultDiv.innerHTML =
"