function selectDays(dayCount) {
	document.getElementById('class_count').value= dayCount;
	var xxt = parseInt(dayCount,10) * 4;
	
	if (dayCount > 3)
		{
		document.getElementById('standard_package_radio').style.display = 'none';
		document.getElementById('custom_radio').checked = 'checked';
		document.getElementById('program_type').value = 'c';
		hideStandardMemberships();
		}
	else
		{
		document.getElementById('standard_package_radio').style.display = '';
		showStandardMemberships();
		}
	document.getElementById('dpw').value = dayCount;
	document.getElementById('cpp').value = xxt;
	updatePrices();
}

function selectProgram(progType) {
	document.getElementById('program_type').value = progType;
	if (progType == 's')
		{
		showStandardMemberships();
		}
	else
		{
		hideStandardMemberships();
		}
	updatePrices();
}

function selectMembership(membership) {
	document.getElementById('membership').value = membership;
	updatePrices();
}

function showStandardMemberships() {
	document.getElementById('standard_memberships').style.display = '';
	document.getElementById('custom_memberships').style.display = 'none';
	document.getElementById('standard_single').checked = 'checked';
}

function hideStandardMemberships() {
	document.getElementById('standard_memberships').style.display = 'none';
	document.getElementById('custom_memberships').style.display = '';
	document.getElementById('custom_single_only').checked = 'checked';
	document.getElementById('membership').value = '1';
}

function updatePrices() {
var class_count = document.getElementById('class_count').value;
var program_type = document.getElementById('program_type').value;
var membership = document.getElementById('membership').value;
var base_price = 155;

	 if (class_count == '2' && membership == '1' && program_type == 's') { base_price = 155; }
else if (class_count == '2' && membership == '3')	{ base_price = 140; }
else if (class_count == '2' && membership == '6')	{ base_price = 130; }
else if (class_count == '2' && membership == '10')	{ base_price = 120; }
else if (class_count == '3' && membership == '1' && program_type == 's') { base_price = 215; }
else if (class_count == '3' && membership == '3')	{ base_price = 195; }
else if (class_count == '3' && membership == '6')	{ base_price = 180; }
else if (class_count == '3' && membership == '10')	{ base_price = 170; }
else if (class_count == '2' && membership == '1' && program_type == 'c') { base_price = 175; }
else if (class_count == '3' && membership == '1' && program_type == 'c') { base_price = 235; }
else if (class_count == '4' && membership == '1' && program_type == 'c') { base_price = 260; }
else if (class_count == '5' && membership == '1' && program_type == 'c') { base_price = 280; }
document.getElementById('price').value = '$' + base_price.toFixed(2);
document.getElementById('tax').value = '$' + (base_price * .05).toFixed(2);
document.getElementById('total').value = '$' + (base_price * 1.05).toFixed(2);

}

function priceTab(tab_id){

document.getElementById('standard_tab').style.backgroundColor="#F2F2F2";

document.getElementById('custom_tab').style.backgroundColor="#F2F2F2";

document.getElementById('calculator_tab').style.backgroundColor="#F2F2F2";

 	document.getElementById('standard_table').style.display="none";
 	document.getElementById('custom_table').style.display="none";
 	document.getElementById('calculator_table').style.display="none";

 if (tab_id == '1')
 	{
 	document.getElementById('standard_tab').style.backgroundColor="#BFBFBF";
 	document.getElementById('standard_table').style.display="";
 	}
else if (tab_id == '2')
	{
	document.getElementById('custom_tab').style.backgroundColor="#BFBFBF";
	document.getElementById('custom_table').style.display="";
	}
else if (tab_id == '3')
	{
	document.getElementById('calculator_tab').style.backgroundColor="#BFBFBF";
	document.getElementById('calculator_table').style.display="";
	}
}
