
function ShowHideRows(id)
{
	if(id.getAttribute("id")=="Delivery1")
	{
		var BestTime = document.getElementById('BestTime').style;
		if(id.value == 'asap' )
		{
			BestTime.display = '';
		}
		else if (id.value == 'scheduled' || id.value == '')
		{
			BestTime.display = 'none';
		}
		var SchedTime = document.getElementById('SchedTime').style;
		var SchedDate = document.getElementById('SchedDate').style;
		if(id.value == 'scheduled' )
		{
			SchedTime.display = '';
			SchedDate.display = '';
		}
		else if (id.value == 'asap' || id.value == '')
		{
			SchedTime.display = 'none';
			SchedDate.display = 'none';
		}
	}
	else if(id.getAttribute("id")=="Pregnant")
	{
		var Preg = document.getElementById('Pregnant2').style;
		if(id.value=='True' )
		{
			Preg.display = '';
		}
		else
		{
			Preg.display = 'none';
		}
	}
	else if (id.getAttribute("id")=="CurrentlyInsured")
	{
		if (document.getElementById('PolicyDesired').value == 'ROP Term' || document.getElementById('PolicyDesired').value == 'Term Life')
		{
			var insured = document.getElementById('CurrentlyInsured');
			var PolicyType = document.getElementById('PolicyType').style;
			var AmountCoverage = document.getElementById('AmountCoverage').style;
			var MonthlyPremium = document.getElementById('MonthlyPremium').style;
			var ReplacingPolicy = document.getElementById('ReplacingPolicy').style;
			if (id.value == 'True')
			{
				PolicyType.display = '';
				AmountCoverage.display = '';
				MonthlyPremium.display = '';
				ReplacingPolicy.display = '';	
			}
			else if (id.value == 'False')
			{
				PolicyType.display = 'none';
				AmountCoverage.display = 'none';
				MonthlyPremium.display = 'none';
				ReplacingPolicy.display = 'none';	
			}
		}
		else if (document.getElementById('PolicyDesired').value == 'Universal Life' || document.getElementById('PolicyDesired').value == 'Whole Life')
		{
			var insured = document.getElementById('CurrentlyInsured');
			var PolicyType = document.getElementById('PolicyType').style;
			var AmountCoverage = document.getElementById('AmountCoverage').style;
			var MonthlyPremium = document.getElementById('MonthlyPremium').style;
			var ReplacingPolicy = document.getElementById('ReplacingPolicy').style;
			if (id.value == 'True')
			{
				PolicyType.display = '';
				AmountCoverage.display = '';
				MonthlyPremium.display = '';
				ReplacingPolicy.display = '';	
			}
			else if (id.value == 'False')
			{
				PolicyType.display = 'none';
				AmountCoverage.display = 'none';
				MonthlyPremium.display = 'none';
				ReplacingPolicy.display = 'none';	
			}
		}
	}
	
	else if(id.getAttribute("id")=="PolicyDesired")
	{
		var TLT = document.getElementById('TLT').style;
		var TLR = document.getElementById('TLR').style;
		var MonthlyPremiumRow = document.getElementById('TargetMonthlyPremiumRow').style;
		var MainObjectiveRow = document.getElementById('MainObjectiveRow').style;
		if (id.value == 'ROP Term')
		{
			MonthlyPremiumRow.display = 'none';
			MainObjectiveRow.display = 'none';
			
			//Term Length Fields
			TLR.display = '';
			TLT.display = 'none';
			
			//make sure conditoinal is right when policydesired changed
			var CashValue = document.getElementById('CashValueRow').style;	
			CashValue.display = 'none';
			var MoneytoMove = document.getElementById('MoneytoMoveRow').style;	
			MoneytoMove.display = 'none';
			
			//make sure conditional for currently insured is correct
			var insured = document.getElementById('CurrentlyInsured');
			var PolicyType = document.getElementById('PolicyType').style;
			var AmountCoverage = document.getElementById('AmountCoverage').style;
			var MonthlyPremium = document.getElementById('MonthlyPremium').style;
			var ReplacingPolicy = document.getElementById('ReplacingPolicy').style;
			if (document.getElementById('CurrentlyInsured').value == 'True')
			{
				PolicyType.display = '';
				AmountCoverage.display = '';
				MonthlyPremium.display = '';
				ReplacingPolicy.display = '';	
			}
			else if (document.getElementById('CurrentlyInsured').value == 'False')
			{
				PolicyType.display = 'none';
				AmountCoverage.display = 'none';
				MonthlyPremium.display = 'none';
				ReplacingPolicy.display = 'none';	
			}
		}
		else if (id.value == 'Term Life')
		{
			//Term Length Fields
			TLT.display = '';
			TLR.display = 'none';
			
			MonthlyPremiumRow.display = 'none';
			MainObjectiveRow.display = 'none';
			
			//make sure conditional is right when policydesired changed
			var CashValue = document.getElementById('CashValueRow').style;	
			CashValue.display = 'none';
			var MoneytoMove = document.getElementById('MoneytoMoveRow').style;	
			MoneytoMove.display = 'none';
			
			//make sure conditional for currently insured is correct
			var insured = document.getElementById('CurrentlyInsured');
			var PolicyType = document.getElementById('PolicyType').style;
			var AmountCoverage = document.getElementById('AmountCoverage').style;
			var MonthlyPremium = document.getElementById('MonthlyPremium').style;
			var ReplacingPolicy = document.getElementById('ReplacingPolicy').style;
			if (document.getElementById('CurrentlyInsured').value == 'True')
			{
				PolicyType.display = '';
				AmountCoverage.display = '';
				MonthlyPremium.display = '';
				ReplacingPolicy.display = '';	
			}
			else if (document.getElementById('CurrentlyInsured').value == 'False')
			{
				PolicyType.display = 'none';
				AmountCoverage.display = 'none';
				MonthlyPremium.display = 'none';
				ReplacingPolicy.display = 'none';	
			}
		}
		else if (id.value == 'Universal Life' || id.value == 'Whole Life')
		{
			TLT.display = 'none';
			TLR.display = 'none';
			
			MonthlyPremiumRow.display = '';
			MainObjectiveRow.display = '';
			
			var CashValue = document.getElementById('CashValueRow').style;
			if (document.getElementById('ReplacingPolicy').value == 'True')
			{
				CashValue.display = ''
			}
			var insured = document.getElementById('CurrentlyInsured');
			var PolicyType = document.getElementById('PolicyType').style;
			var AmountCoverage = document.getElementById('AmountCoverage').style;
			var MonthlyPremium = document.getElementById('MonthlyPremium').style;
			var ReplacingPolicy = document.getElementById('ReplacingPolicy').style;
			if (document.getElementById('CurrentlyInsured').value == 'True')
			{
				PolicyType.display = '';
				AmountCoverage.display = '';
				MonthlyPremium.display = '';
				ReplacingPolicy.display = '';	
			}
			else if (document.getElementById('CurrentlyInsured').value == 'False')
			{
				PolicyType.display = 'none';
				AmountCoverage.display = 'none';
				MonthlyPremium.display = 'none';
				ReplacingPolicy.display = 'none';	
			}
			
		}
	}
	else if(id.getAttribute("id")=="ReplacingPolicy")
	{
		var CashValue = document.getElementById('CashValueRow').style;	
		if (id.value == 'True')
		{
			if (document.getElementById('PolicyDesired').value == 'Whole Life')
			{
				CashValue.display = '';
			}
			if (document.getElementById('PolicyDesired').value == 'Universal Life')
			{
				CashValue.display = '';
			}
		}
		
		else if (id.value == 'False')
		{
			CashValue.display = 'none';
		}
	}
	else if(id.getAttribute("id")=="CashValue")
	{
		var MoneytoMove = document.getElementById('MoneytoMoveRow').style;	
		var policy = document.getElementById('PolicyDesired');
		if (id.value == 'True')
		{
			if (policy.value == 'Whole Life' || policy.value == 'Universal Life')
			{
				MoneytoMove.display = '';
			}
		}
		
		else if (id.value == 'False')
		{
			MoneytoMove.display = 'none';
		}
	}
	else if (id.getAttribute("id") == "Agent")
	{
		var AgentNum = document.getElementById('AgentNum').style;
		if (id.value == 'True')
		{
			AgentNum.display = '';
		}
		else if (id.value == 'False')
		{
			AgentNum.display = "none";
		}
	}
	
}
