function changeRate(oForm) {
	var nTotal = 0.00;
	var nGST = 0.00;
	
	var nOptionTotal = 0.00;
	var nOptionGST   = 0.00;
	
	var nAdditionalTotal = 0.00;
	var nAdditionalGST = 0.00;
	
	var lcProvince = oForm.bill_state_or_province.options[oForm.bill_state_or_province.selectedIndex].value;
	
	if (oForm.rvar_option[0].checked) {
		oForm.quantityOptionA.value = 1;
		oForm.quantityOptionB.value = 0;	
		oForm.quantityOptionC.value = 0;
		oForm.quantityOptionD.value = 0;
		nOptionTotal = parseFloat(nOPTIONA);
		nOptionGST   = parseFloat(calculateTax(nOPTIONA, lcProvince));
		//nOptionGST   = parseFloat(nOPTIONA * nGSTRate);
	}
	else if (oForm.rvar_option[1].checked) {
		oForm.quantityOptionA.value = 0;
		oForm.quantityOptionB.value = 1;
		oForm.quantityOptionC.value = 0;
		oForm.quantityOptionD.value = 0;
		nOptionTotal = parseFloat(nOPTIONB);
		nOptionGST   = parseFloat(calculateTax(nOPTIONB, lcProvince));
		//nOptionGST   = parseFloat(nOPTIONB * nGSTRate);
	}
	else if (oForm.rvar_option[2].checked) {
		oForm.quantityOptionA.value = 0;
		oForm.quantityOptionB.value = 0;
		oForm.quantityOptionC.value = 1;
		oForm.quantityOptionD.value = 0;
		nOptionTotal = parseFloat(nOPTIONC);
		nOptionGST   = parseFloat(calculateTax(nOPTIONC, lcProvince));
		//nOptionGST   = parseFloat(nOPTIONC * nGSTRate);
	}
	else {
		oForm.quantityOptionA.value = 0;
		oForm.quantityOptionB.value = 0;
		oForm.quantityOptionC.value = 0;
		oForm.quantityOptionD.value = 1;
		nOptionTotal = parseFloat(nOPTIOND);
		nOptionGST   = parseFloat(calculateTax(nOPTIOND, lcProvince));
		//nOptionGST   = parseFloat(nOPTIOND * nGSTRate);
	}
	document.getElementById("mbrfee").innerHTML = "$" + tocurrency(nOptionTotal + nOptionGST);

	nAdditionalNum	  = parseInt(oForm.quantityAdditionalAssociates.value);
	nAdditionalTotal = parseFloat(nAdditionalNum * nADDTIONAL);
	nAdditionalGST	  = parseFloat(calculateTax((nAdditionalNum * nADDTIONAL), lcProvince));
	//nAdditionalGST	  = parseFloat((nAdditionalNum * nADDTIONAL) * nGSTRate);
	document.getElementById("additional_associates_total").innerHTML = "$" + tocurrency(nAdditionalTotal + nAdditionalGST);
	document.getElementById("additional_associates_number").innerHTML = nAdditionalNum;
	
	additionalServices(oForm);
	document.getElementById("additional_services_total").innerHTML = "$" + tocurrency(nAdditionalServicesTotal + nAdditionalServicesGST);
	
	nTotal = nOptionTotal + nAdditionalTotal + nAdditionalServicesTotal;
	nGST	  = nOptionGST + nAdditionalGST + nAdditionalServicesGST;
	
	document.getElementById("totalcost").innerHTML = "$" + tocurrency(nTotal + nGST);
	oForm.charge_total.value = tocurrency(nTotal + nGST);
	oForm.gst.value 		= tocurrency(nGST);		
}

function additionalServices(oForm) {
	var nEblast_Chapter_Amt			= 0.00;
	var nEblast_Chapter_GST			= 0.00;
	var nEblast_Chapter_Reminder_Amt 	= 0.00;
	var nEblast_Chapter_Reminder_GST 	= 0.00;
	var nEblast_National_Amt			= 0.00;
	var nEblast_National_GST			= 0.00;
	var nEblast_National_Reminder_Amt 	= 0.00;
	var nEblast_National_Reminder_GST 	= 0.00;
	var nAdditional_Listing_Amt		= 0.00;
	var nAdditional_Listing_GST		= 0.00;
	var nNewsletter3x3_Amt			= 0.00;
	var nNewsletter3x3_GST			= 0.00;
	var nNewsletter4x4_Amt			= 0.00;
	var nNewsletter4x4_GST			= 0.00;
	var nNewsletter5x5_Amt			= 0.00;
	var nNewsletter5x5_GST			= 0.00;	
	var nMailing_Amt				= 0.00;
	var nMailing_GST				= 0.00;	
	
	var lcProvince = oForm.bill_state_or_province.options[oForm.bill_state_or_province.selectedIndex].value;
	
	if (oForm.eblast_chapter.value > 0) {
		oForm.quantityEblastChapter.value = oForm.eblast_chapter.value;
		nEblast_Chapter_Amt			= parseFloat(oForm.eblast_chapter.value * nEBLAST_CHAPTER);
		nEblast_Chapter_GST			= parseFloat(calculateTax(nEblast_Chapter_Amt, lcProvince));
		//nEblast_Chapter_GST			= parseFloat(nEblast_Chapter_Amt * nGSTRate);
	}
	if (oForm.eblast_chapter_reminder.value > 0) {
		oForm.quantityEblastChapterReminder.value = oForm.eblast_chapter_reminder.value;
		nEblast_Chapter_Reminder_Amt	= parseFloat(oForm.eblast_chapter_reminder.value * nEBLAST_CHAPTER_REMINDER);
		nEblast_Chapter_Reminder_GST 	=parseFloat(calculateTax(nEblast_Chapter_Reminder_Amt, lcProvince));
		//nEblast_Chapter_Reminder_GST 	= parseFloat(nEblast_Chapter_Reminder_Amt * nGSTRate);
	}
	if (oForm.eblast_national.value > 0) {
		oForm.quantityEblastNational.value = oForm.eblast_national.value;
		nEblast_National_Amt		= parseFloat(oForm.eblast_national.value * nEBLAST_NATIONAL);
		nEblast_National_GST		= parseFloat(calculateTax(nEblast_National_Amt, lcProvince));
		//nEblast_National_GST		= parseFloat(nEblast_National_Amt * nGSTRate);
	}
	if (oForm.eblast_national_reminder.value) {
		oForm.quantityEblastNationalReminder.value = oForm.eblast_national_reminder.value;
		nEblast_National_Reminder_Amt = parseFloat(oForm.eblast_national_reminder.value * nEBLAST_NATIONAL_REMINDER);
		nEblast_National_Reminder_GST = parseFloat(calculateTax(nEblast_National_Reminder_Amt, lcProvince));
		//nEblast_National_Reminder_GST = parseFloat(nEblast_National_Reminder_Amt * nGSTRate);
	}
	if (oForm.additional_listing.value > 0) {
		oForm.quantityAdditionalListing.value = oForm.additional_listing.value;
		nAdditional_Listing_Amt		= parseFloat(oForm.additional_listing.value * nADDITIONAL_LISTING);
		nAdditional_Listing_GST		= parseFloat(calculateTax(nAdditional_Listing_Amt, lcProvince));
		//nAdditional_Listing_GST		= parseFloat(nAdditional_Listing_Amt * nGSTRate);
	}
	if (oForm.newsletter3x3.value > 0) {
		oForm.quantityNewsletter3x3.value = oForm.newsletter3x3.value;
		nNewsletter3x3_Amt			= parseFloat(oForm.newsletter3x3.value * nNEWSLETTER3X3);
		nNewsletter3x3_GST			= parseFloat(calculateTax(nNewsletter3x3_Amt, lcProvince));
		//nNewsletter3x3_GST			= parseFloat(nNewsletter3x3_Amt * nGSTRate);
	}
	if (oForm.newsletter4x4.value > 0) {
		oForm.quantityNewsletter4x4.value = oForm.newsletter4x4.value;
		nNewsletter4x4_Amt			= parseFloat(oForm.newsletter4x4.value * nNEWSLETTER4X4);
		nNewsletter4x4_GST			= parseFloat(calculateTax(nNewsletter4x4_Amt, lcProvince));
		//nNewsletter4x4_GST			= parseFloat(nNewsletter4x4_Amt * nGSTRate);
	}
	if (oForm.newsletter5x5.value > 0) {
		oForm.quantityNewsletter5x5.value = oForm.newsletter5x5.value;
		nNewsletter5x5_Amt			= parseFloat(oForm.newsletter5x5.value * nNEWSLETTER5X5);
		nNewsletter5x5_GST			= parseFloat(calculateTax(nNewsletter5x5_Amt, lcProvince));
		//nNewsletter5x5_GST			= parseFloat(nNewsletter5x5_Amt * nGSTRate);
	}
	if (oForm.mailing.value > 0) {
		oForm.quantityMailing.value = oForm.mailing.value;
		nMailing_Amt				= parseFloat(oForm.mailing.value * nMAILING);
		nMailing_GST				= parseFloat(calculateTax(nMailing_Amt, lcProvince));
		//nMailing_GST				= parseFloat(nMailing_Amt * nGSTRate);
	}
	
	nAdditionalServicesTotal 	= nEblast_Chapter_Amt + nEblast_Chapter_Reminder_Amt + nEblast_National_Amt + nEblast_National_Reminder_Amt + nAdditional_Listing_Amt + nNewsletter3x3_Amt	+ nNewsletter4x4_Amt + nNewsletter5x5_Amt + nMailing_Amt;
	nAdditionalServicesGST		= nEblast_Chapter_GST + nEblast_Chapter_Reminder_GST + nEblast_National_GST + nEblast_National_Reminder_GST + nAdditional_Listing_GST + nNewsletter3x3_GST	+ nNewsletter4x4_GST + nNewsletter5x5_GST + nMailing_GST;
}

function additionalContacts(oForm, oAdditionalContact) {
	var llDisabled = true;
	if (oAdditionalContact.checked) {
		llDisabled = false;
		nAdditionalNum = nAdditionalNum + 1;
	}
	else {
		nAdditionalNum = nAdditionalNum - 1;	
	}
	
	oForm.quantityAdditionalAssociates.value = nAdditionalNum;

	switch(oAdditionalContact.value) {
		case "1":
			oForm.rvar_branch_address1.disabled = llDisabled;
			oForm.rvar_branch_phone1.disabled = llDisabled;
			oForm.rvar_branch_name1.disabled = llDisabled;
			oForm.rvar_branch_email1.disabled = llDisabled;
			oForm.additionalassociate2.disabled = llDisabled;
			break;
		case "2":
			oForm.rvar_branch_address2.disabled = llDisabled;
			oForm.rvar_branch_phone2.disabled = llDisabled;
			oForm.rvar_branch_name2.disabled = llDisabled;
			oForm.rvar_branch_email2.disabled = llDisabled;		
			oForm.additionalassociate3.disabled = llDisabled;
			break;
		case "3":
			oForm.rvar_branch_address3.disabled = llDisabled;
			oForm.rvar_branch_phone3.disabled = llDisabled;
			oForm.rvar_branch_name3.disabled = llDisabled;
			oForm.rvar_branch_email3.disabled = llDisabled;			
			break;
	}
	changeRate(oForm);
}