function ToggleBillTo(chosen)
{
	//This function displays / hides the BillTo section depending on how the 
	//potential customer responds to the Same as ShipTo question
	if (chosen == 'Y')
	{
		document.getElementById('d_BillTo').style.display = 'none';
		document.ProspectQual.BillToName.value = '';
		document.ProspectQual.BillToAddr1.value = '';
		document.ProspectQual.BillToCity.value = '';
		document.ProspectQual.BillToState.value = '';
		document.ProspectQual.BillToZip.value = '';
		document.ProspectQual.BillToPhone.value = '';
		document.ProspectQual.BillToFAX.value = '';
		document.ProspectQual.BillToEMail.value = '';
		b_fields["BillToName"]["r"] = false;
		b_fields["BillToAddr1"]["r"] = false;
		b_fields["BillToCity"]["r"] = false;
		b_fields["BillToState"]["r"] = false;
		b_fields["BillToState"]["f"] = 'cwftrue';
		b_fields["BillToZip"]["r"] = false;
		b_fields["BillToPhone"]["r"] = false;
		b_fields["BillToFAX"]["r"] = false;
		b_fields["BillToEMail"]["r"] = false;
	}
	else
	{
		document.getElementById('d_BillTo').style.display = 'inline';
		document.ProspectQual.BillToName.value = document.ProspectQual.ShipToName.value;
		document.ProspectQual.BillToAddr1.value = document.ProspectQual.ShipToAddr1.value;
		document.ProspectQual.BillToCity.value = document.ProspectQual.ShipToCity.value;
		document.ProspectQual.BillToState.value = document.ProspectQual.ShipToState.value;
		document.ProspectQual.BillToZip.value = document.ProspectQual.ShipToZip.value;
		document.ProspectQual.BillToPhone.value = document.ProspectQual.ShipToPhone.value;
		document.ProspectQual.BillToFAX.value = document.ProspectQual.ShipToFAX.value;
		document.ProspectQual.BillToEMail.value = document.ProspectQual.ShipToEMail.value;
		b_fields["BillToName"]["r"] = true;
		b_fields["BillToAddr1"]["r"] = true;
		b_fields["BillToCity"]["r"] = true;
		b_fields["BillToState"]["r"] = true;
		b_fields["BillToState"]["f"] = 'alpha';
		b_fields["BillToZip"]["r"] = true;
		b_fields["BillToPhone"]["r"] = true;
		b_fields["BillToFAX"]["r"] = true;
		b_fields["BillToEMail"]["r"] = true;
	}
}
function ToggleLicense(chosen)
{
	//This function displays / hides the Form depending on how the 
	//potential customer responds to the Have License question
	if (chosen == 'Y')
	{
		document.getElementById('d_Licensed').style.display = 'inline';
	}
	else
	{
		document.getElementById('d_Licensed').style.display = 'none';
	}
}
function SetTypeOfBusiness(chosen)
{
	//Other Business Type is only required for Other / Misc.
	if (chosen == 14)
	{
		b_fields["OtherBusinessType"]["r"] = true;
	}
	else
	{
		b_fields["OtherBusinessType"]["r"] = false;
	}
}
function SetHowLearn(chosen)
{
	switch(chosen)
	{
		case '2':
		{
			//Trade Publication
			b_fields["LearnTradePub"]["r"] = true;
			b_fields["LearnShow"]["r"] = false;
			b_fields["LearnReferrer"]["r"] = false;
			b_fields["LearnOther"]["r"] = false;
			break;
		}
		case '3':
		{
			//Trade Show
			b_fields["LearnTradePub"]["r"] = false;
			b_fields["LearnShow"]["r"] = true;
			b_fields["LearnReferrer"]["r"] = false;
			b_fields["LearnOther"]["r"] = false;
			break;
		}
		case '4':
		{
			//Referrer
			b_fields["LearnTradePub"]["r"] = false;
			b_fields["LearnShow"]["r"] = false;
			b_fields["LearnReferrer"]["r"] = true;
			b_fields["LearnOther"]["r"] = false;
			break;
		}
		case '5':
		{
			//Other
			b_fields["LearnTradePub"]["r"] = false;
			b_fields["LearnShow"]["r"] = false;
			b_fields["LearnReferrer"]["r"] = false;
			b_fields["LearnOther"]["r"] = true;
			break;
		}
		default:
		{
			//Internet
			b_fields["LearnTradePub"]["r"] = false;
			b_fields["LearnShow"]["r"] = false;
			b_fields["LearnReferrer"]["r"] = false;
			b_fields["LearnOther"]["r"] = false;
			break;
		}
	}
}
function SetOwner(chosen)
{
	//Owner name only required if not being completed by owner
	if (chosen == 'N')
	{
		b_fields["OwnerName"]["r"] = true;
	}
	else
	{
		b_fields["OwnerName"]["r"] = false;
	}
}
function SetBuyer(chosen)
{
	//Owner name only required if not being completed by owner
	if (chosen == 'N')
	{
		b_fields["PurchAgent"]["r"] = true;
	}
	else
	{
		b_fields["PurchAgent"]["r"] = false;
	}
}
function CountWant()
{
	document.ProspectQual.WantCount.value = 0;
	if (document.ProspectQual.WantHangPegBag.checked == true)
		document.ProspectQual.WantCount.value++; 	
	if (document.ProspectQual.WantClipstrip.checked == true)
		document.ProspectQual.WantCount.value++; 	
	if (document.ProspectQual.WantLaydownBag.checked == true)
		document.ProspectQual.WantCount.value++; 	
	if (document.ProspectQual.WantStdBarTube.checked == true)
		document.ProspectQual.WantCount.value++; 	
	if (document.ProspectQual.WantChangemaker.checked == true)
		document.ProspectQual.WantCount.value++; 	
	if (document.ProspectQual.WantTubs.checked == true)
		document.ProspectQual.WantCount.value++; 	
	if (document.ProspectQual.WantBigBoxTheatre.checked == true)
		document.ProspectQual.WantCount.value++; 	
	if (document.ProspectQual.WantBucketJar.checked == true)
		document.ProspectQual.WantCount.value++; 	
	if (document.ProspectQual.WantBulk.checked == true)
		document.ProspectQual.WantCount.value++; 	
	if (document.ProspectQual.WantOther.checked == true)
		document.ProspectQual.WantCount.value++; 	
}
function CountProg()
{
	document.ProspectQual.ProgCount.value = 0;
	if (document.ProspectQual.ProgValueLine.checked == true)
		document.ProspectQual.ProgCount.value++; 	
	if (document.ProspectQual.ProgPrePriced.checked == true)
		document.ProspectQual.ProgCount.value++; 	
	if (document.ProspectQual.ProgPremiumBrands.checked == true)
		document.ProspectQual.ProgCount.value++; 
	if (document.ProspectQual.ProgSeasonal.checked == true)
		document.ProspectQual.ProgCount.value++; 	
	if (document.ProspectQual.ProgBulk.checked == true)
		document.ProspectQual.ProgCount.value++; 	
}
function CountPremium()
{
	document.ProspectQual.PremCount.value = 0;
	if (document.ProspectQual.BrandHeide.checked == true)
		document.ProspectQual.PremCount.value++;
	if (document.ProspectQual.BrandNowLater.checked == true)
		document.ProspectQual.PremCount.value++;
	if (document.ProspectQual.BrandTrolli.checked == true)
		document.ProspectQual.PremCount.value++;
	if (document.ProspectQual.BrandFarleys.checked == true)
		document.ProspectQual.PremCount.value++;
	if (document.ProspectQual.BrandAmazinFruit.checked == true)
		document.ProspectQual.PremCount.value++;
	if (document.ProspectQual.BrandBobs.checked == true)
		document.ProspectQual.PremCount.value++;
	if (document.ProspectQual.BrandChuckles.checked == true)
		document.ProspectQual.PremCount.value++;
	if (document.ProspectQual.BrandSuperBubble.checked == true)
		document.ProspectQual.PremCount.value++;
	if (document.ProspectQual.BrandRainBlo.checked == true)
		document.ProspectQual.PremCount.value++;
	if (document.ProspectQual.BrandFruitStripe.checked == true)
		document.ProspectQual.PremCount.value++;
	if (document.ProspectQual.BrandHotDog.checked == true)
		document.ProspectQual.PremCount.value++;
	if (document.ProspectQual.BrandMightyBite.checked == true)
		document.ProspectQual.PremCount.value++;
	if (document.ProspectQual.BrandSathers.checked == true)
		document.ProspectQual.PremCount.value++;
	if (document.ProspectQual.BrandBrachs.checked == true)
		document.ProspectQual.PremCount.value++;
}
