I have a small javascript pricing calculation that is not working on a friend's PC, but it works fine on my Mac. I'm guessing it's a semi-colon or something small that's not in the correct spot? Please help if you can?! The full page can be found @ http://procollage.com/pricing/photo-collage-pricing.html. Thank you all, again, in advance.
Here is the script.
<script LANGUAGE="JavaScript">
<!--
function calculate(PricingForm)
{
height = eval(PricingForm.height.value);
width = eval(PricingForm.width.value);
photos = eval(PricingForm.photos.value);
lgtext = eval(PricingForm.lgtext.value);
mountlam = eval(PricingForm.mount.value);
mountlam = eval(PricingForm.lam.value);
GetPriceOne (PricingForm, height, width, photos, lgtext, mount, lam);
}
function GetPriceOne(PricingForm, height, width, photos, lgtext, mount, lam)
{
PriceOne = height * width;
GetPriceTwo(PricingForm, height, width, photos, lgtext, mount, lam, PriceOne);
}
function GetPriceTwo(PricingForm, height, width, photos, lgtext, mount, lam, PriceOne)
{
PriceTwo = PriceOne / 144;
GetPriceThree(PricingForm, height, width, photos, lgtext, mount, lam, PriceTwo);
}
function GetPriceThree(PricingForm, height, width, photos, lgtext, mount, lam, PriceTwo)
{
PriceThree = PriceTwo * 15;
GetPriceFour(PricingForm, height, width, photos, lgtext, mount, lam, PriceThree);
}
function GetPriceFour(PricingForm, height, width, photos, lgtext, mount, lam, PriceThree)
{
if(PricingForm.lgtext.checked)
{
PriceFour = PriceThree + 20;
GetPriceFive(PricingForm, height, width, photos, lgtext, mount, lam, PriceFour);
}
else
{
PriceFour = PriceThree;
GetPriceFive(PricingForm, height, width, photos, lgtext, mount, lam, PriceFour);
}
}
function GetPriceFive(PricingForm, height, width, photos, lgtext, mount, lam, PriceFour)
{
if(PricingForm.mount.checked)
{
PriceFive = PriceFour + PriceTwo * 5;
GetPriceSix(PricingForm, height, width, photos, lgtext, mount, lam, PriceFive);
}
else
{
PriceFive = PriceFour;
GetPriceSix(PricingForm, height, width, photos, lgtext, mount, lam, PriceFive);
}
}
function GetPriceSix(PricingForm, height, width, photos, lgtext, mount, lam, PriceFive)
{
if(PricingForm.lam.checked)
{
PriceSix = PriceFive + PriceTwo * 5;
GetPriceSeven(PricingForm, height, width, photos, lgtext, mount, lam, PriceSix);
}
else
{
PriceSix = PriceFive;
GetPriceSeven(PricingForm, height, width, photos, lgtext, mount, lam, PriceSix);
}
}
function GetPriceSeven(PricingForm, height, width, photos, lgtext, mount, lam, PriceSix)
{
total = (photos * 4.95) + PriceSix;
WriteDocument(total);
}
function RoundToPennies(n)
{
pennies = n * 100;
pennies = Math.round(pennies);
strPennies = "" + pennies;
len = strPennies.length;
return strPennies.substring(0, len - 2) + "." + strPennies.substring(len - 2, len);
}
function WriteDocument(total) {
document.PricingForm.collageEstimate.value = "$" + RoundToPennies(total);
}
//-->
</script>