|
|
|
|
Just enter your details below to see
your potential savings |
|
|
<script language="JavaScript" type="text/javascript">
<!--
function checkNum(data) {
if (data.length == 0) {
return (false);
}
var valid = "0123456789.";
for (var i = 0; i<data.length; i++){
tempChar = data.substring (i, i+1);
if (valid.indexOf(tempChar, 0) == -1) {
return (false);
}
}
return (true);
}
function calcCost(inField) {
var temp = checkNum(inField.mileage.value);
if (temp == 1) {
var mileage = eval(inField.mileage.value);
}
else {
alert("You must enter a 'Valid Number' for your Mileage.");
return false;
}
var temp1 = checkNum(inField.mpg.value);
if (temp1 == 1) {
var mpg = eval(inField.mpg.value);
}
else {
alert("You must enter a 'Valid Number' for your Miles Per Gallon.");
return false;
}
var temp2 = checkNum(inField.petrolPrice.value);
if (temp2 == 1) {
var petrolPrice = eval(inField.petrolPrice.value);
}
else {
alert("You must enter a 'Valid Price' for your Petrol Cost.");
return false;
}
var temp3 = checkNum(inField.lpgPrice.value);
if (temp3 == 1) {
var lpgPrice = eval(inField.lpgPrice.value);
}
else {
alert("You must enter a 'Valid Price' for your Liquified Petroleum Gas (LPG).");
return false;
}
var Petrolmpl = mpg/4.55;
var LPGmpl = Petrolmpl*0.9;
var totalPetrolCost= (mileage/Petrolmpl)*(petrolPrice/100);
var totalLPGcost= (mileage/LPGmpl)*(lpgPrice/100);
totalPetrolCost = Math.floor(totalPetrolCost);
totalLPGcost = Math.floor(totalLPGcost);
var saving = totalPetrolCost - totalLPGcost;
saving = Math.floor(saving);
inField.petrol.value = totalPetrolCost;
inField.lpg.value = totalLPGcost;
//inField.lpg.value = "£" + totalLPGcost;
inField.saving.value = saving;
return true;
}
//-->
</script>
|
|
|
Hot Price Update! |
|
Mercedes ML 320
with 70L under floor tank fully sequential system with ECU and
extended warranty
£1550!
|
|