// File created by Tristan Mcvean
// Revision date: N/A 
// Date: 17.07.05 


function calculatePrice() {	

		var monthlyNetValue=document.fPricing.monthlyBox1.value*document.fPricing.monthlyBox2.value*11.05;
		document.fPricing.monthlyBox3.value=monthlyNetValue.toFixed(2);
		var permNetValue=document.fPricing.permBox1.value*106.37;
		document.fPricing.permBox3.value=permNetValue.toFixed(2);

		if (document.fPricing.VatBeenAdded.checked==true)
			{
			document.fPricing.monthlyBox4.value=document.fPricing.monthlyBox3.value;
			document.fPricing.monthlyBox5.value="0.00";
			document.fPricing.permBox4.value=document.fPricing.permBox3.value;
			document.fPricing.permBox5.value="0.00";
			}
		else
			{
			var monthlyGrossValue=document.fPricing.monthlyBox3.value*1.175;
			document.fPricing.monthlyBox4.value=monthlyGrossValue.toFixed(2);
			var MonthlyVat=document.fPricing.monthlyBox4.value-document.fPricing.monthlyBox3.value;
			document.fPricing.monthlyBox5.value=MonthlyVat.toFixed(2);
			var permGrossValue=document.fPricing.permBox3.value*1.175;
			document.fPricing.permBox4.value=permGrossValue.toFixed(2);
			var permVat=document.fPricing.permBox4.value-document.fPricing.permBox3.value;
			document.fPricing.permBox5.value=permVat.toFixed(2);
			}

C = document.fPricing.monthlyBox3.value
C = Number(C)
D = document.fPricing.permBox3.value
D = Number(D)
subT = (C + D)
document.fPricing.SubTotal.value=subT.toFixed(2);

H = document.fPricing.monthlyBox4.value
H = Number(H)
I = document.fPricing.permBox4.value
I = Number(I)
vatT = (H + I)
document.fPricing.Total.value=vatT.toFixed(2);

M = document.fPricing.monthlyBox5.value
M = Number(M)
N = document.fPricing.permBox5.value
N = Number(N)
allT = (M + N)
document.fPricing.Vat.value=allT.toFixed(2);

if (document.fPricing.monthlyBox1.value>1)
	{myMonthlyLicense=(" Licenses")
	}
	else
	{myMonthlyLicense=(" License")
	}
if (document.fPricing.permBox1.value>1)
	{myPermLicense=(" Permanent Licenses = £")
	}
	else
	{myPermLicense=(" Permanent License = £")
	}
	
	
// Set Plural Days,Weeks,Months,Years

if (document.fPricing.monthlyBox2.value>1)
	{myPluralMonth=(" Months = £")
	}
	else
	{myPluralMonth=(" Month = £")
	}
	

var myBasketA=("");

if (document.fPricing.monthlyBox3.value!=0.00)
	{myBasketA=(myBasketA + document.fPricing.monthlyBox1.value + myMonthlyLicense + " For " + document.fPricing.monthlyBox2.value + myPluralMonth + document.fPricing.monthlyBox4.value + "<BR>");
	}
	
	
	
if (document.fPricing.permBox3.value!=0.00)
	{myBasketA=(myBasketA + document.fPricing.permBox1.value + myPermLicense + document.fPricing.permBox4.value);
	}

	
myBasketA=(myBasketA + "<BR><BR>" + "Your Total is £" + vatT.toFixed(2));
	
if (document.fPricing.VatBeenAdded.checked==true)
	{myBasketA=(myBasketA + "<BR>" + "No VAT has been added to this Order.");
	}
	else
	{myBasketA=(myBasketA + "<BR>" + "VAT has been added to this Order.");
	}
	
if (document.fPricing.Total.value==0.00)
	{myBasketA=("--- Please choose from above! ---");
	}
	



if (document.getElementById)
	{
		x1 = document.getElementById("myTest");
		x1.innerHTML = '';
		x1.innerHTML = myBasketA;
		document.fPricing.MyOrder.value=myBasketA
	}
	else if (document.all)
	{
		x1 = document.all["myTest"];
		x1.innerHTML = myBasketA;
		document.fPricing.MyOrder.value=myBasketA
	}

}
