This calculator helps you estimate your Autopac insurance rate based on various factors that influence your premium. Understanding these components can help you anticipate your insurance costs and make informed decisions.
.autopac-calculator-container {
font-family: sans-serif;
border: 1px solid #ddd;
padding: 20px;
border-radius: 8px;
max-width: 600px;
margin: 20px auto;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.autopac-calculator-container h2 {
text-align: center;
margin-bottom: 15px;
color: #333;
}
.autopac-calculator-container p {
text-align: center;
color: #555;
margin-bottom: 25px;
line-height: 1.5;
}
.calculator-inputs {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 15px;
margin-bottom: 20px;
}
.input-group {
display: flex;
flex-direction: column;
}
.input-group label {
margin-bottom: 5px;
font-weight: bold;
color: #444;
}
.input-group input {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1rem;
}
.input-group input:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}
.autopac-calculator-container button {
display: block;
width: 100%;
padding: 12px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 1.1rem;
cursor: pointer;
transition: background-color 0.3s ease;
}
.autopac-calculator-container button:hover {
background-color: #0056b3;
}
#result {
margin-top: 20px;
padding: 15px;
background-color: #e9ecef;
border-radius: 4px;
text-align: center;
font-size: 1.2rem;
color: #333;
font-weight: bold;
}
function calculateAutopacRate() {
var vehicleValue = parseFloat(document.getElementById("vehicleValue").value);
var driverAge = parseInt(document.getElementById("driverAge").value);
var drivingExperience = parseInt(document.getElementById("drivingExperience").value);
var annualKms = parseInt(document.getElementById("annualKms").value);
var collisionDeductible = parseFloat(document.getElementById("collisionDeductible").value);
var comprehensiveDeductible = parseFloat(document.getElementById("comprehensiveDeductible").value);
var previousClaims = parseInt(document.getElementById("previousClaims").value);
var trafficViolations = parseInt(document.getElementById("trafficViolations").value);
var estimatedRate = 500; // Base rate
// Factors influencing the rate
// 1. Vehicle Value (Higher value = higher risk)
if (!isNaN(vehicleValue) && vehicleValue > 0) {
estimatedRate += vehicleValue * 0.005; // 0.5% of vehicle value
}
// 2. Driver Age (Younger/older drivers may have higher rates)
if (!isNaN(driverAge)) {
if (driverAge 65) {
estimatedRate += 100;
}
}
// 3. Driving Experience (Less experience = higher risk)
if (!isNaN(drivingExperience)) {
if (drivingExperience < 5) {
estimatedRate += 150;
} else if (drivingExperience < 10) {
estimatedRate += 75;
}
}
// 4. Annual Kilometers Driven (More kilometers = higher exposure)
if (!isNaN(annualKms)) {
estimatedRate += (annualKms / 1000) * 10; // $10 for every 1000 km
}
// 5. Deductibles (Lower deductibles = higher premium)
if (!isNaN(collisionDeductible) && collisionDeductible < 500) {
estimatedRate += (500 – collisionDeductible) * 0.2; // $0.2 for every $1 below $500
}
if (!isNaN(comprehensiveDeductible) && comprehensiveDeductible 0) {
estimatedRate += previousClaims * 150; // $150 per previous claim
}
// 7. Traffic Violations (More violations = higher risk)
if (!isNaN(trafficViolations) && trafficViolations > 0) {
estimatedRate += trafficViolations * 250; // $250 per major violation
}
// Ensure no negative rates and display
var resultElement = document.getElementById("result");
if (isNaN(estimatedRate) || estimatedRate < 0) {
resultElement.innerHTML = "Please enter valid numbers for all fields.";
} else {
resultElement.innerHTML = "Estimated Autopac Rate: $" + estimatedRate.toFixed(2);
}
}