Alaska Marine Lines Shipping Rates Calculator

Alaska Marine Lines Shipping Rates Calculator

This calculator helps you estimate the shipping costs for your cargo using Alaska Marine Lines. Please input the details of your shipment below to get an estimated rate.

function calculateShippingRate() { var weight = parseFloat(document.getElementById("weight").value); var volume = parseFloat(document.getElementById("volume").value); var distance = parseFloat(document.getElementById("distance").value); var fuelSurcharge = parseFloat(document.getElementById("fuelSurcharge").value); var resultDiv = document.getElementById("result"); resultDiv.innerHTML = ""; // Clear previous results // Basic validation if (isNaN(weight) || weight <= 0) { resultDiv.innerHTML = "Please enter a valid weight greater than 0."; return; } if (isNaN(volume) || volume <= 0) { resultDiv.innerHTML = "Please enter a valid volume greater than 0."; return; } if (isNaN(distance) || distance <= 0) { resultDiv.innerHTML = "Please enter a valid distance greater than 0."; return; } if (isNaN(fuelSurcharge) || fuelSurcharge < 0) { resultDiv.innerHTML = "Please enter a valid fuel surcharge percentage (0 or greater)."; return; } // Simplified Rate Calculation Logic (This is a hypothetical model) // In reality, AML has complex tariffs, minimums, and specific commodity rates. // This calculator uses a simplified formula based on weight, volume, and distance. var baseRatePerLb = 0.50; // Hypothetical base rate per pound var baseRatePerCubicFoot = 1.20; // Hypothetical base rate per cubic foot var distanceFactor = distance * 0.02; // Hypothetical factor based on distance var weightCost = weight * baseRatePerLb; var volumeCost = volume * baseRatePerCubicFoot; var baseShippingCost = Math.max(weightCost, volumeCost) + distanceFactor; // Typically, you'd use the higher of weight or volume cost, plus distance var fuelSurchargeAmount = baseShippingCost * (fuelSurcharge / 100); var estimatedTotalCost = baseShippingCost + fuelSurchargeAmount; resultDiv.innerHTML = "

Estimated Shipping Cost

" + "Base Shipping Cost: $" + baseShippingCost.toFixed(2) + "" + "Fuel Surcharge: $" + fuelSurchargeAmount.toFixed(2) + "" + "Estimated Total: $" + estimatedTotalCost.toFixed(2) + ""; } .calculator-container { font-family: sans-serif; border: 1px solid #ccc; padding: 20px; border-radius: 8px; max-width: 500px; margin: 20px auto; background-color: #f9f9f9; } .calculator-container h2 { text-align: center; margin-bottom: 15px; color: #333; } .calculator-container p { text-align: center; margin-bottom: 20px; color: #555; line-height: 1.5; } .input-section { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; } .input-section label { font-weight: bold; color: #444; flex-basis: 45%; } .input-section input[type="number"] { padding: 10px; border: 1px solid #ccc; border-radius: 4px; width: 50%; box-sizing: border-box; } .calculator-container button { display: block; width: 100%; padding: 12px 20px; background-color: #007bff; color: white; border: none; border-radius: 5px; font-size: 16px; cursor: pointer; transition: background-color 0.3s ease; margin-top: 20px; } .calculator-container button:hover { background-color: #0056b3; } #result { margin-top: 25px; padding-top: 15px; border-top: 1px dashed #eee; text-align: center; font-size: 1.1em; color: #333; } #result h3 { margin-bottom: 10px; color: #0056b3; } #result p { margin-bottom: 8px; text-align: left; margin-left: 10%; } #result strong { color: #28a745; }

Leave a Comment