
function AdjValanceOptions()
{
	var testWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;

	if (document.getElementById('divBamboo')) document.getElementById('divBamboo').style.display = 'none';
	if (document.getElementById('divWood')) document.getElementById('divWood').style.display = 'none';
	if (document.getElementById('divMetal')) document.getElementById('divMetal').style.display = 'none';

	//if (document.getElementById('FeatureOption77')) document.getElementById('FeatureOption77').disabled = true;
	if (document.getElementById('FeatureOption78')) document.getElementById('FeatureOption78').disabled = true;
	if (document.getElementById('FeatureOption69')) document.getElementById('FeatureOption69').disabled = true;
	if (document.getElementById('FeatureOption70')) document.getElementById('FeatureOption70').disabled = true;
	if (document.getElementById('FeatureOption71')) document.getElementById('FeatureOption71').disabled = true;
	if (document.getElementById('FeatureOption72')) document.getElementById('FeatureOption72').disabled = true;
	if (document.getElementById('FeatureOption73')) document.getElementById('FeatureOption73').disabled = true;
	if (document.getElementById('FeatureOption74')) document.getElementById('FeatureOption74').disabled = true;
	if (document.getElementById('FeatureOption75')) document.getElementById('FeatureOption75').disabled = true;
	if (document.getElementById('FeatureOption76')) document.getElementById('FeatureOption76').disabled = true;
	if (document.getElementById('FeatureOption78')) document.getElementById('FeatureOption78').disabled = true;
	if (document.getElementById('FeatureOption79')) document.getElementById('FeatureOption79').disabled = true;
	if (document.getElementById('FeatureOption80')) document.getElementById('FeatureOption80').disabled = true;
	if (document.getElementById('FeatureOption94')) document.getElementById('FeatureOption94').disabled = true;
	if (document.getElementById('FeatureOption95')) document.getElementById('FeatureOption95').disabled = true;
	
	if (document.getElementById('FeatureOption82')) document.getElementById('FeatureOption82').disabled = true; //valance trim color
	
	if (document.getElementById('FeatureOption81'))
	{
		if (document.getElementById('FeatureOption81').value > 220)
		{
			if (document.getElementById('FeatureOption82')) document.getElementById('FeatureOption82').disabled = false; //valance trim color
		}
	}
	
	if (document.getElementById('FeatureOption68'))
	{
		if (document.shopcart.FeatureOption68.value > 176) //Rod Type selected
		{	
			//must choose 3" pocket if rod is selected
			if (document.getElementById('FeatureOption67'))
			{
				if (document.getElementById('FeatureOption67').selectedIndex == 0)
				{
					alert('All rods sold by SelectBlinds.com require the 3" pocket to be selected.');
					document.getElementById('FeatureOption67').selectedIndex = 1;
				}
			}
			if (document.shopcart.FeatureOption68.value == 177) //Bamboo Rod selected
			{
				if (document.getElementById('divBamboo')) document.getElementById('divBamboo').style.display = 'block';

				if (document.getElementById('FeatureOption71')) document.getElementById('FeatureOption71').disabled = false;
				if (document.getElementById('FeatureOption72')) document.getElementById('FeatureOption72').disabled = false;
				if (document.getElementById('FeatureOption78')) document.getElementById('FeatureOption78').disabled = false;
				
				if (document.shopcart.FeatureOption72.value == 190) //Bamboo Rod 1 1/4"
				{
					//FINIALS
					if (document.getElementById('FeatureOption74')) 
					{
						document.getElementById('FeatureOption74').disabled = false;
						var selectedFinial = document.getElementById('FeatureOption74').options[document.getElementById('FeatureOption74').selectedIndex].value
						document.getElementById('FeatureOption74').options.length = 0;
						addOption(document.getElementById('FeatureOption74'),'Madras ($25.00)','196');
						addOption(document.getElementById('FeatureOption74'),'Wyndham ($25.00)','197');
						addOption(document.getElementById('FeatureOption74'),'End Cap ($15.00)','198');
						addOption(document.getElementById('FeatureOption74'),'Heathrow ($25.00)','262');
						document.getElementById('FeatureOption74').selectedIndex = selectOption(document.getElementById('FeatureOption74'),selectedFinial);
					}
					
					//POLE
					if (document.getElementById('FeatureOption78')) 
					{
						document.getElementById('FeatureOption78').disabled = false;
						var selectedPole = document.getElementById('FeatureOption78').options[document.getElementById('FeatureOption78').selectedIndex].value
						document.getElementById('FeatureOption78').options.length = 0;
						addOption(document.getElementById('FeatureOption78'),'48" ($25.00)','211');
						addOption(document.getElementById('FeatureOption78'),'72" ($30.00)','212');
						addOption(document.getElementById('FeatureOption78'),'96" ($40.00)','213');						
						document.getElementById('FeatureOption78').selectedIndex = selectOption(document.getElementById('FeatureOption78'),selectedPole);
					}
					
					//BRACKET
					if (document.getElementById('FeatureOption94')) 
					{
						document.getElementById('FeatureOption94').disabled = false;
						var selectedBracket = document.getElementById('FeatureOption94').options[document.getElementById('FeatureOption94').selectedIndex].value
						document.getElementById('FeatureOption94').options.length = 0;
						addOption(document.getElementById('FeatureOption94'),'Single Bracket ($15.00)','298');
						addOption(document.getElementById('FeatureOption94'),'Double Bracket ($25.00)','299');
						document.getElementById('FeatureOption94').selectedIndex = selectOption(document.getElementById('FeatureOption94'),selectedBracket);
					}
				}
				if (document.shopcart.FeatureOption72.value == 191) //Bamboo Rod 1 7/8"
				{
					//FINIALS
					if (document.getElementById('FeatureOption74')) 
					{
						document.getElementById('FeatureOption74').disabled = false;
						var selectedFinial = document.getElementById('FeatureOption74').options[document.getElementById('FeatureOption74').selectedIndex].value
						document.getElementById('FeatureOption74').options.length = 0;
						addOption(document.getElementById('FeatureOption74'),'Madras ($25.00)','263');
						addOption(document.getElementById('FeatureOption74'),'Wyndham ($25.00)','264');
						addOption(document.getElementById('FeatureOption74'),'End Cap ($18.00)','265');
						addOption(document.getElementById('FeatureOption74'),'Heathrow ($25.00)','266');
						document.getElementById('FeatureOption74').selectedIndex = selectOption(document.getElementById('FeatureOption74'),selectedFinial);
					}
						
					//POLE
					if (document.getElementById('FeatureOption78')) 
					{
						document.getElementById('FeatureOption78').disabled = false;
						var selectedPole = document.getElementById('FeatureOption78').options[document.getElementById('FeatureOption78').selectedIndex].value
						document.getElementById('FeatureOption78').options.length = 0;
						addOption(document.getElementById('FeatureOption78'),'48" ($35.00)','259');
						addOption(document.getElementById('FeatureOption78'),'72" ($50.00)','260');
						addOption(document.getElementById('FeatureOption78'),'96" ($70.00)','261');						
						document.getElementById('FeatureOption78').selectedIndex = selectOption(document.getElementById('FeatureOption78'),selectedPole);
					}
						
					//BRACKET
					if (document.getElementById('FeatureOption94')) 
					{
						document.getElementById('FeatureOption94').disabled = false;
						var selectedBracket = document.getElementById('FeatureOption94').options[document.getElementById('FeatureOption94').selectedIndex].value
						document.getElementById('FeatureOption94').options.length = 0;
						addOption(document.getElementById('FeatureOption94'),'Single Bracket ($12.00)','300');
						addOption(document.getElementById('FeatureOption94'),'Double Bracket ($15.00)','301');
						document.getElementById('FeatureOption94').selectedIndex = selectOption(document.getElementById('FeatureOption94'),selectedBracket);
					}
				}
				if (testWidth < 48 && document.getElementById('FeatureOption78')) document.getElementById('FeatureOption78').selectedIndex = 0;
				if (testWidth >= 48 && testWidth < 72 && document.getElementById('FeatureOption78')) document.getElementById('FeatureOption78').selectedIndex = 1;
				if (testWidth >= 72 && document.getElementById('FeatureOption78')) document.getElementById('FeatureOption78').selectedIndex = 2;
			}
			if (document.shopcart.FeatureOption68.value == 179) //Wood Rod selected
			{
				if (document.getElementById('divWood')) document.getElementById('divWood').style.display = 'block';

				if (document.getElementById('FeatureOption73')) document.getElementById('FeatureOption73').disabled = false;
				if (document.getElementById('FeatureOption70')) document.getElementById('FeatureOption70').disabled = false;
				if (document.getElementById('FeatureOption76')) document.getElementById('FeatureOption76').disabled = false;
				if (document.getElementById('FeatureOption79')) document.getElementById('FeatureOption79').disabled = false;
				if (document.getElementById('FeatureOption95')) document.getElementById('FeatureOption95').disabled = false;
				
				
				if (document.shopcart.FeatureOption73.value == 193 || document.shopcart.FeatureOption73.value == 195) //Wood Rod 1 3/8" Fluted Smooth
				{
					//FINIALS
					if (document.getElementById('FeatureOption76')) 
					{
						var selectedFinial = document.getElementById('FeatureOption76').options[document.getElementById('FeatureOption76').selectedIndex].value;
						document.getElementById('FeatureOption76').options.length = 0;
						addOption(document.getElementById('FeatureOption76'),'Ball w/ Leaves ($25.00)','201');
						addOption(document.getElementById('FeatureOption76'),'Filigree Ball ($25.00)','202');
						addOption(document.getElementById('FeatureOption76'),'Fluted Cone ($25.00)','203');
						addOption(document.getElementById('FeatureOption76'),'Mushroom ($25.00)','204');
						addOption(document.getElementById('FeatureOption76'),'Pagoda ($25.00)','205');
						addOption(document.getElementById('FeatureOption76'),'Pine Cone ($25.00)','273');
						addOption(document.getElementById('FeatureOption76'),'Swirl Flame ($25.00)','274');
						addOption(document.getElementById('FeatureOption76'),'Tulip ($25.00)','275');
						addOption(document.getElementById('FeatureOption76'),'End Cap ($15.00)','308');
						document.getElementById('FeatureOption76').selectedIndex = selectOption(document.getElementById('FeatureOption76'),selectedFinial);
					}
						
					//POLE
					if (document.getElementById('FeatureOption79')) 
					{
						var selectedPole = document.getElementById('FeatureOption79').options[document.getElementById('FeatureOption79').selectedIndex].value
						document.getElementById('FeatureOption79').options.length = 0;
						addOption(document.getElementById('FeatureOption79'),'48" ($25.00)','214');
						addOption(document.getElementById('FeatureOption79'),'72" ($30.00)','215');
						addOption(document.getElementById('FeatureOption79'),'96" ($40.00)','216');						
						document.getElementById('FeatureOption79').selectedIndex = selectOption(document.getElementById('FeatureOption79'),selectedPole);
					}
						
					//BRACKET
					if (document.getElementById('FeatureOption95')) 
					{
						var selectedBracket =  document.getElementById('FeatureOption95').options[document.getElementById('FeatureOption95').selectedIndex].value;
						document.getElementById('FeatureOption95').options.length = 0;
						addOption(document.getElementById('FeatureOption95'),'Single Bracket ($15.00)','302');
						addOption(document.getElementById('FeatureOption95'),'Double Bracket ($25.00)','303');
						document.getElementById('FeatureOption95').selectedIndex = selectOption(document.getElementById('FeatureOption95'),selectedBracket);
					}
				}
				if (document.shopcart.FeatureOption73.value == 194 || document.shopcart.FeatureOption73.value == 210) //Wood Rod 2" Fluted Smooth
				{
					//FINIALS
					if (document.getElementById('FeatureOption76')) 
					{
						var selectedFinial = document.getElementById('FeatureOption76').options[document.getElementById('FeatureOption76').selectedIndex].value;
						document.getElementById('FeatureOption76').options.length = 0;
						addOption(document.getElementById('FeatureOption76'),'Ball w/ Leaves ($25.00)','276');
						addOption(document.getElementById('FeatureOption76'),'Filigree Ball ($25.00)','277');
						addOption(document.getElementById('FeatureOption76'),'Fluted Cone ($25.00)','278');
						addOption(document.getElementById('FeatureOption76'),'Mushroom ($25.00)','279');
						addOption(document.getElementById('FeatureOption76'),'Pagoda ($25.00)','280');
						addOption(document.getElementById('FeatureOption76'),'Pine Cone ($25.00)','281');
						addOption(document.getElementById('FeatureOption76'),'Swirl Flame ($25.00)','282');
						addOption(document.getElementById('FeatureOption76'),'Tulip ($25.00)','283');
						addOption(document.getElementById('FeatureOption76'),'End Cap ($18.00)','309');
						document.getElementById('FeatureOption76').selectedIndex = selectOption(document.getElementById('FeatureOption76'),selectedFinial);
					}
						
					//POLE
					if (document.getElementById('FeatureOption79')) 
					{
						var selectedPole = document.getElementById('FeatureOption79').options[document.getElementById('FeatureOption79').selectedIndex].value
						document.getElementById('FeatureOption79').options.length = 0;
						addOption(document.getElementById('FeatureOption79'),'48" ($35.00)','267');
						addOption(document.getElementById('FeatureOption79'),'72" ($50.00)','268');
						addOption(document.getElementById('FeatureOption79'),'96" ($70.00)','269');						
						document.getElementById('FeatureOption79').selectedIndex = selectOption(document.getElementById('FeatureOption79'),selectedPole);
					}
						
					//BRACKET
					if (document.getElementById('FeatureOption95')) 
					{
						var selectedBracket = document.getElementById('FeatureOption95').options[document.getElementById('FeatureOption95').selectedIndex].value;
						document.getElementById('FeatureOption95').options.length = 0;
						addOption(document.getElementById('FeatureOption95'),'Single Bracket ($12.00)','304');
						addOption(document.getElementById('FeatureOption95'),'Double Bracket ($15.00)','305');
						document.getElementById('FeatureOption95').selectedIndex = selectOption(document.getElementById('FeatureOption95'),selectedBracket);
					}
				}
				if (document.shopcart.FeatureOption73.value == 256 ) //Wood Rod 1 3/8" Spiral
				{
					//FINIALS
					if (document.getElementById('FeatureOption76')) 
					{
						var selectedFinial = document.getElementById('FeatureOption76').options[document.getElementById('FeatureOption76').selectedIndex].value;
						document.getElementById('FeatureOption76').options.length = 0;
						addOption(document.getElementById('FeatureOption76'),'Ball w/ Leaves ($25.00)','284');
						addOption(document.getElementById('FeatureOption76'),'Filigree Ball ($25.00)','285');
						addOption(document.getElementById('FeatureOption76'),'Fluted Cone ($25.00)','286');
						addOption(document.getElementById('FeatureOption76'),'Mushroom ($25.00)','287');
						addOption(document.getElementById('FeatureOption76'),'Pagoda ($25.00)','288');
						addOption(document.getElementById('FeatureOption76'),'Pine Cone ($25.00)','289');
						addOption(document.getElementById('FeatureOption76'),'Swirl Flame ($25.00)','290');
						addOption(document.getElementById('FeatureOption76'),'Tulip ($25.00)','291');
						addOption(document.getElementById('FeatureOption76'),'End Cap ($15.00)','310');
						
						document.getElementById('FeatureOption76').selectedIndex = selectOption(document.getElementById('FeatureOption76'),selectedFinial);
					}
					
						
					//POLE
					if (document.getElementById('FeatureOption79')) 
					{
						var selectedPole = document.getElementById('FeatureOption79').options[document.getElementById('FeatureOption79').selectedIndex].value
						
						document.getElementById('FeatureOption79').options.length = 0;
						addOption(document.getElementById('FeatureOption79'),'48" ($30.00)','270');
						addOption(document.getElementById('FeatureOption79'),'72" ($35.00)','271');
						addOption(document.getElementById('FeatureOption79'),'96" ($45.00)','272');						
						document.getElementById('FeatureOption79').selectedIndex = selectOption(document.getElementById('FeatureOption79'),selectedPole);
					}
					
					//BRACKET
					if (document.getElementById('FeatureOption95')) 
					{
						var selectedBracket = document.getElementById('FeatureOption95').options[document.getElementById('FeatureOption95').selectedIndex].value;
						document.getElementById('FeatureOption95').options.length = 0;
						addOption(document.getElementById('FeatureOption95'),'Single Bracket ($15.00)','306');
						addOption(document.getElementById('FeatureOption95'),'Double Bracket ($25.00)','307');
						document.getElementById('FeatureOption95').selectedIndex = selectOption(document.getElementById('FeatureOption95'),selectedBracket);
					}
				}

				
				if (testWidth < 48 && document.getElementById('FeatureOption79')) document.getElementById('FeatureOption79').selectedIndex = 0;
				if (testWidth >= 48 && testWidth < 72 && document.getElementById('FeatureOption79')) document.getElementById('FeatureOption79').selectedIndex = 1;
				if (testWidth >= 72 && document.getElementById('FeatureOption79')) document.getElementById('FeatureOption79').selectedIndex = 2;
			}
			if (document.shopcart.FeatureOption68.value == 178) //Metal Rod selected
			{
				if (document.getElementById('divMetal')) document.getElementById('divMetal').style.display = 'block';
				
				if (document.getElementById('FeatureOption69')) document.getElementById('FeatureOption69').disabled = false;
				if (document.getElementById('FeatureOption75')) document.getElementById('FeatureOption75').disabled = false;
				if (document.getElementById('FeatureOption80')) document.getElementById('FeatureOption80').disabled = false;
				
				if (testWidth < 48 && document.getElementById('FeatureOption80')) document.getElementById('FeatureOption80').selectedIndex = 0;
				if (testWidth >= 48 && testWidth < 86 && document.getElementById('FeatureOption80')) document.getElementById('FeatureOption80').selectedIndex = 1;
				if (testWidth >= 86 && document.getElementById('FeatureOption80')) document.getElementById('FeatureOption80').selectedIndex = 2;
			}
		}
	}
}

function addOption(selectbox,text,value )
{
	var optn = document.createElement("option");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}

function selectOption(selectbox,text)
{ 
	for(i=0;selectbox.length-1;i++)
	{
		if(selectbox.options[i].value == text)return i;
		if(i == selectbox.length-1 && selectbox.options[i].value != text) return 0;
	}
	return 0;
}

function AdjValanceOptionsCS()
{
	var testWidth = document.shopcart.WidthInches.value + document.shopcart.Width8ths.value;
	
	if (document.getElementById('divBamboo')) document.getElementById('divBamboo').style.display = 'none';
	if (document.getElementById('divWood')) document.getElementById('divWood').style.display = 'none';
	if (document.getElementById('divMetal')) document.getElementById('divMetal').style.display = 'none';
	
//	if (document.getElementById('FeatureOption77_CS')) document.getElementById('FeatureOption77_CS').disabled = true;
	if (document.getElementById('FeatureOption78_CS')) document.getElementById('FeatureOption78_CS').disabled = true;
	if (document.getElementById('FeatureOption69_CS')) document.getElementById('FeatureOption69_CS').disabled = true;
	if (document.getElementById('FeatureOption70_CS')) document.getElementById('FeatureOption70_CS').disabled = true;
	if (document.getElementById('FeatureOption71_CS')) document.getElementById('FeatureOption71_CS').disabled = true;
	if (document.getElementById('FeatureOption72_CS')) document.getElementById('FeatureOption72_CS').disabled = true;
	if (document.getElementById('FeatureOption73_CS')) document.getElementById('FeatureOption73_CS').disabled = true;
	if (document.getElementById('FeatureOption74_CS')) document.getElementById('FeatureOption74_CS').disabled = true;
	if (document.getElementById('FeatureOption75_CS')) document.getElementById('FeatureOption75_CS').disabled = true;
	if (document.getElementById('FeatureOption76_CS')) document.getElementById('FeatureOption76_CS').disabled = true;
	if (document.getElementById('FeatureOption78_CS')) document.getElementById('FeatureOption78_CS').disabled = true;
	if (document.getElementById('FeatureOption79_CS')) document.getElementById('FeatureOption79_CS').disabled = true;
	if (document.getElementById('FeatureOption80_CS')) document.getElementById('FeatureOption80_CS').disabled = true;
	if (document.getElementById('FeatureOption94_CS')) document.getElementById('FeatureOption94_CS').disabled = true;
	if (document.getElementById('FeatureOption95_CS')) document.getElementById('FeatureOption95_CS').disabled = true;
	
	
	
	if (document.getElementById('FeatureOption82_CS')) document.getElementById('FeatureOption82_CS').disabled = true; //valance trim color
	
	if (document.getElementById('FeatureOption81_CS'))
	{
		if (document.getElementById('FeatureOption81_CS').value > 220)
		{
			if (document.getElementById('FeatureOption82_CS')) document.getElementById('FeatureOption82_CS').disabled = false; //valance trim color
		}
	}
	
	if (document.getElementById('FeatureOption68_CS'))
	{
		if (document.shopcart.FeatureOption68_CS.value > 176) //Rod Type selected
		{	
			if (document.shopcart.FeatureOption68_CS.value == 177) //Bamboo Rod selected
			{
				if (document.getElementById('divBamboo')) document.getElementById('divBamboo').style.display = 'block';
				
				if (document.getElementById('FeatureOption71_CS')) document.getElementById('FeatureOption71_CS').disabled = false;
				if (document.getElementById('FeatureOption72_CS')) document.getElementById('FeatureOption72_CS').disabled = false;
				if (document.getElementById('FeatureOption78_CS')) document.getElementById('FeatureOption78_CS').disabled = false;
				
				if (document.shopcart.FeatureOption72_CS.value == 190) //Bamboo Rod 1 1/4"
				{ 
					//FINIALS
					if (document.getElementById('FeatureOption74_CS'))
					{
						if (document.getElementById('FeatureOption74_CS')) document.getElementById('FeatureOption74_CS').disabled = false;
						var selectedFinial = document.getElementById('FeatureOption74_CS').options[document.getElementById('FeatureOption74_CS').selectedIndex].value
						document.getElementById('FeatureOption74_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption74_CS'),'Madras ($25.00)','196');
						addOption(document.getElementById('FeatureOption74_CS'),'Wyndham ($25.00)','197');
						addOption(document.getElementById('FeatureOption74_CS'),'End Cap ($15.00)','198');
						addOption(document.getElementById('FeatureOption74_CS'),'Heathrow ($25.00)','262');
					
						document.getElementById('FeatureOption74_CS').selectedIndex = selectOption(document.getElementById('FeatureOption74_CS'),selectedFinial);
					}
					
					//POLE
					if (document.getElementById('FeatureOption78_CS'))
					{
						var selectedPole = document.getElementById('FeatureOption78_CS').options[document.getElementById('FeatureOption78_CS').selectedIndex].value
						document.getElementById('FeatureOption78_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption78_CS'),'48" ($25.00)','211');
						addOption(document.getElementById('FeatureOption78_CS'),'72" ($30.00)','212');
						addOption(document.getElementById('FeatureOption78_CS'),'96" ($40.00)','213');											
						document.getElementById('FeatureOption78_CS').selectedIndex = selectOption(document.getElementById('FeatureOption78_CS'),selectedPole);
					}
					
					//BRACKET
					if (document.getElementById('FeatureOption94_CS'))
					{
						if (document.getElementById('FeatureOption94_CS')) document.getElementById('FeatureOption94_CS').disabled = false;
						var selectedBracket = document.getElementById('FeatureOption94_CS').options[document.getElementById('FeatureOption94_CS').selectedIndex].value
						document.getElementById('FeatureOption94_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption94_CS'),'Single Bracket ($15.00)','298');
						addOption(document.getElementById('FeatureOption94_CS'),'Double Bracket ($25.00)','299');
						document.getElementById('FeatureOption94_CS').selectedIndex = selectOption(document.getElementById('FeatureOption94_CS'),selectedBracket);
					}
				}
				if (document.shopcart.FeatureOption72_CS.value == 191) //Bamboo Rod 1 7/8"
				{
					//FINIALS
					if (document.getElementById('FeatureOption74_CS'))
					{
						if (document.getElementById('FeatureOption74_CS')) document.getElementById('FeatureOption74_CS').disabled = false;
						var selectedFinial = document.getElementById('FeatureOption74_CS').options[document.getElementById('FeatureOption74_CS').selectedIndex].value
						document.getElementById('FeatureOption74_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption74_CS'),'Madras ($25.00)','263');
						addOption(document.getElementById('FeatureOption74_CS'),'Wyndham ($25.00)','264');
						addOption(document.getElementById('FeatureOption74_CS'),'End Cap ($18.00)','265');
						addOption(document.getElementById('FeatureOption74_CS'),'Heathrow ($25.00)','266');
						document.getElementById('FeatureOption74_CS').selectedIndex = selectOption(document.getElementById('FeatureOption74_CS'),selectedFinial);
					}
				
					//POLE
					if (document.getElementById('FeatureOption78_CS'))
					{
						var selectedPole = document.getElementById('FeatureOption78_CS').options[document.getElementById('FeatureOption78_CS').selectedIndex].value
						document.getElementById('FeatureOption78_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption78_CS'),'48" ($35.00)','259');
						addOption(document.getElementById('FeatureOption78_CS'),'72" ($50.00)','260');
						addOption(document.getElementById('FeatureOption78_CS'),'96" ($70.00)','261');										
						document.getElementById('FeatureOption78_CS').selectedIndex = selectOption(document.getElementById('FeatureOption78_CS'),selectedPole);
					}
					
					//BRACKET
					if (document.getElementById('FeatureOption94_CS'))
					{
						if (document.getElementById('FeatureOption94_CS')) document.getElementById('FeatureOption94_CS').disabled = false;
						var selectedBracket = document.getElementById('FeatureOption94_CS').options[document.getElementById('FeatureOption94_CS').selectedIndex].value
						document.getElementById('FeatureOption94_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption94_CS'),'Single Bracket ($12.00)','300');
						addOption(document.getElementById('FeatureOption94_CS'),'Double Bracket ($15.00)','301');
						document.getElementById('FeatureOption94_CS').selectedIndex = selectOption(document.getElementById('FeatureOption94_CS'),selectedBracket);
					}
				}
				if (testWidth < 48 && document.getElementById('FeatureOption78_CS')) document.getElementById('FeatureOption78_CS').selectedIndex = 0;
				if (testWidth >= 48 && testWidth < 72 && document.getElementById('FeatureOption78_CS')) document.getElementById('FeatureOption78_CS').selectedIndex = 1;
				if (testWidth >= 72 && document.getElementById('FeatureOption78_CS')) document.getElementById('FeatureOption78_CS').selectedIndex = 2;
			}
			if (document.shopcart.FeatureOption68_CS.value == 179) //Wood Rod selected
			{
				if (document.getElementById('divWood')) document.getElementById('divWood').style.display = 'block';
				
				if (document.getElementById('FeatureOption73_CS')) document.getElementById('FeatureOption73_CS').disabled = false;
				if (document.getElementById('FeatureOption70_CS')) document.getElementById('FeatureOption70_CS').disabled = false;
				if (document.getElementById('FeatureOption76_CS')) document.getElementById('FeatureOption76_CS').disabled = false;
				if (document.getElementById('FeatureOption79_CS')) document.getElementById('FeatureOption79_CS').disabled = false;
				if (document.getElementById('FeatureOption95_CS')) document.getElementById('FeatureOption95_CS').disabled = false;
				
				if (document.shopcart.FeatureOption73_CS.value == 193 || document.shopcart.FeatureOption73_CS.value == 195) //Wood Rod 1 3/8" Fluted Smooth
				{
					//FINIALS
					if (document.getElementById('FeatureOption76_CS'))
					{
						var selectedFinial = document.getElementById('FeatureOption76_CS').options[document.getElementById('FeatureOption76_CS').selectedIndex].value;
						document.getElementById('FeatureOption76_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption76_CS'),'Ball w/ Leaves ($25.00)','201');
						addOption(document.getElementById('FeatureOption76_CS'),'Filigree Ball ($25.00)','202');
						addOption(document.getElementById('FeatureOption76_CS'),'Fluted Cone ($25.00)','203');
						addOption(document.getElementById('FeatureOption76_CS'),'Mushroom ($25.00)','204');
						addOption(document.getElementById('FeatureOption76_CS'),'Pagoda ($25.00)','205');
						addOption(document.getElementById('FeatureOption76_CS'),'Pine Cone ($25.00)','273');
						addOption(document.getElementById('FeatureOption76_CS'),'Swirl Flame ($25.00)','274');
						addOption(document.getElementById('FeatureOption76_CS'),'Tulip ($25.00)','275');
						addOption(document.getElementById('FeatureOption76_CS'),'End Cap ($15.00)','308');
				
						document.getElementById('FeatureOption76_CS').selectedIndex = selectOption(document.getElementById('FeatureOption76_CS'),selectedFinial);
					}
						
					//POLE
					if (document.getElementById('FeatureOption79_CS'))
					{
						var selectedPole = document.getElementById('FeatureOption79_CS').options[document.getElementById('FeatureOption79_CS').selectedIndex].value
						document.getElementById('FeatureOption79_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption79_CS'),'48" ($25.00)','214');
						addOption(document.getElementById('FeatureOption79_CS'),'72" ($30.00)','215');
						addOption(document.getElementById('FeatureOption79_CS'),'96" ($40.00)','216');						
						document.getElementById('FeatureOption79_CS').selectedIndex = selectOption(document.getElementById('FeatureOption79_CS'),selectedPole);
					}
						
					//BRACKET
					if (document.getElementById('FeatureOption95_CS'))
					{
						var selectedBracket =  document.getElementById('FeatureOption95_CS').options[document.getElementById('FeatureOption95_CS').selectedIndex].value;
						document.getElementById('FeatureOption95_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption95_CS'),'Single Bracket ($15.00)','302');
						addOption(document.getElementById('FeatureOption95_CS'),'Double Bracket ($25.00)','303');
						document.getElementById('FeatureOption95_CS').selectedIndex = selectOption(document.getElementById('FeatureOption95_CS'),selectedBracket);
					}
				}
				if (document.shopcart.FeatureOption73_CS.value == 194 || document.shopcart.FeatureOption73_CS.value == 210) //Wood Rod 2" Fluted Smooth
				{
						
					//FINIALS
					if (document.getElementById('FeatureOption76_CS'))
					{
						var selectedFinial = document.getElementById('FeatureOption76_CS').options[document.getElementById('FeatureOption76_CS').selectedIndex].value;
						document.getElementById('FeatureOption76_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption76_CS'),'Ball w/ Leaves ($25.00)','276');
						addOption(document.getElementById('FeatureOption76_CS'),'Filigree Ball ($25.00)','277');
						addOption(document.getElementById('FeatureOption76_CS'),'Fluted Cone ($25.00)','278');
						addOption(document.getElementById('FeatureOption76_CS'),'Mushroom ($25.00)','279');
						addOption(document.getElementById('FeatureOption76_CS'),'Pagoda ($25.00)','280');
						addOption(document.getElementById('FeatureOption76_CS'),'Pine Cone ($25.00)','281');
						addOption(document.getElementById('FeatureOption76_CS'),'Swirl Flame ($25.00)','282');
						addOption(document.getElementById('FeatureOption76_CS'),'Tulip ($25.00)','283');
						addOption(document.getElementById('FeatureOption76_CS'),'End Cap ($18.00)','309');
					
						document.getElementById('FeatureOption76_CS').selectedIndex = selectOption(document.getElementById('FeatureOption76_CS'),selectedFinial);
					}
						
					//POLE
					if (document.getElementById('FeatureOption79_CS'))
					{
						var selectedPole = document.getElementById('FeatureOption79_CS').options[document.getElementById('FeatureOption79_CS').selectedIndex].value
						document.getElementById('FeatureOption79_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption79_CS'),'48" ($35.00)','267');
						addOption(document.getElementById('FeatureOption79_CS'),'72" ($50.00)','268');
						addOption(document.getElementById('FeatureOption79_CS'),'96" ($70.00)','269');					
						document.getElementById('FeatureOption79_CS').selectedIndex = selectOption(document.getElementById('FeatureOption79_CS'),selectedPole);
					}
						
					//BRACKET
					if (document.getElementById('FeatureOption95_CS'))
					{
						var selectedBracket = document.getElementById('FeatureOption95_CS').options[document.getElementById('FeatureOption95_CS').selectedIndex].value;
						document.getElementById('FeatureOption95_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption95_CS'),'Single Bracket ($12.00)','304');
						addOption(document.getElementById('FeatureOption95_CS'),'Double Bracket ($15.00)','305');
						document.getElementById('FeatureOption95_CS').selectedIndex = selectOption(document.getElementById('FeatureOption95_CS'),selectedBracket);
					}
				}
				if (document.shopcart.FeatureOption73_CS.value == 256 ) //Wood Rod 1 3/8" Spiral
				{
					//FINIALS
					if (document.getElementById('FeatureOption76_CS'))
					{
						var selectedFinial = document.getElementById('FeatureOption76_CS').options[document.getElementById('FeatureOption76_CS').selectedIndex].value;
						document.getElementById('FeatureOption76_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption76_CS'),'Ball w/ Leaves ($25.00)','284');
						addOption(document.getElementById('FeatureOption76_CS'),'Filigree Ball ($25.00)','285');
						addOption(document.getElementById('FeatureOption76_CS'),'Fluted Cone ($25.00)','286');
						addOption(document.getElementById('FeatureOption76_CS'),'Mushroom ($25.00)','287');
						addOption(document.getElementById('FeatureOption76_CS'),'Pagoda ($25.00)','288');
						addOption(document.getElementById('FeatureOption76_CS'),'Pine Cone ($25.00)','289');
						addOption(document.getElementById('FeatureOption76_CS'),'Swirl Flame ($25.00)','290');
						addOption(document.getElementById('FeatureOption76_CS'),'Tulip ($25.00)','291');
						addOption(document.getElementById('FeatureOption76_CS'),'End Cap ($15.00)','310');
						document.getElementById('FeatureOption76_CS').selectedIndex = selectOption(document.getElementById('FeatureOption76_CS'),selectedFinial);
					}
							
					//POLE
					if (document.getElementById('FeatureOption79_CS'))
					{
						var selectedPole = document.getElementById('FeatureOption79_CS').options[document.getElementById('FeatureOption79_CS').selectedIndex].value
						document.getElementById('FeatureOption79_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption79_CS'),'48" ($30.00)','270');
						addOption(document.getElementById('FeatureOption79_CS'),'72" ($35.00)','271');
						addOption(document.getElementById('FeatureOption79_CS'),'96" ($45.00)','272');						
						document.getElementById('FeatureOption79_CS').selectedIndex = selectOption(document.getElementById('FeatureOption79_CS'),selectedPole);
					}
					
					//BRACKET
					if (document.getElementById('FeatureOption95_CS'))
					{
						var selectedBracket = document.getElementById('FeatureOption95_CS').options[document.getElementById('FeatureOption95_CS').selectedIndex].value;
						document.getElementById('FeatureOption95_CS').options.length = 0;
						addOption(document.getElementById('FeatureOption95_CS'),'Single Bracket ($15.00)','306');
						addOption(document.getElementById('FeatureOption95_CS'),'Double Bracket ($25.00)','307');
						document.getElementById('FeatureOption95_CS').selectedIndex = selectOption(document.getElementById('FeatureOption95_CS'),selectedBracket);
					}
				}

				
				if (testWidth < 48 && document.getElementById('FeatureOption79_CS')) document.getElementById('FeatureOption79_CS').selectedIndex = 0;
				if (testWidth >= 48 && testWidth < 72 && document.getElementById('FeatureOption79_CS')) document.getElementById('FeatureOption79_CS').selectedIndex = 1;
				if (testWidth >= 72 && document.getElementById('FeatureOption79_CS')) document.getElementById('FeatureOption79_CS').selectedIndex = 2;
			}
			if (document.shopcart.FeatureOption68_CS.value == 178) //Metal Rod selected
			{
				if (document.getElementById('divMetal')) document.getElementById('divMetal').style.display = 'block';
				
				if (document.getElementById('FeatureOption69_CS')) document.getElementById('FeatureOption69_CS').disabled = false;
				if (document.getElementById('FeatureOption75_CS')) document.getElementById('FeatureOption75_CS').disabled = false;
				if (document.getElementById('FeatureOption80_CS')) document.getElementById('FeatureOption80_CS').disabled = false;
				
				if (testWidth < 48 && document.getElementById('FeatureOption80_CS')) document.getElementById('FeatureOption80_CS').selectedIndex = 0;
				if (testWidth >= 48 && testWidth < 86 && document.getElementById('FeatureOption80_CS')) document.getElementById('FeatureOption80_CS').selectedIndex = 1;
				if (testWidth >= 86 && document.getElementById('FeatureOption80_CS')) document.getElementById('FeatureOption80_CS').selectedIndex = 2;
			}
		}
	}
}


function CalcPriceCS(checkJS){
	var frmEle = eval("document.shopcart");
	var Price = 0;var HeadrailPrice = 0;var TaxPrice = 0;var OptionsPrice = 0;

	var blindWidth = frmEle.WidthInchesCS.value + frmEle.Width8thsCS.value;
	var blindHeight = 0;
	if (frmEle.Height8thsCS.value == '0')
	{
		frmEle.HeightInchesCS.value;
	}
	else
	{
		frmEle.HeightInchesCS.value + frmEle.Height8thsCS.value;
	}
	
	//set check that enabled
	if(checkJS != 1){frmEle.jsBrowserCheck.value = "1";}

	var catID = "";
	if (frmEle.cid) catID = eval(frmEle.cid.value);
	if (catID == "20")
	{
		blindWidth = RoundUp(blindWidth);
		blindHeight = RoundUp(blindHeight);
	}
	else
	{
		if (blindWidth > 0)
		{
			blindWidth = RoundUp(blindWidth);
			blindWidth = getPriceBreakCS(blindWidth,aWidthsCS);
			blindHeight = RoundUp(blindHeight);
			blindHeight = getPriceBreakCS(blindHeight,aHeightsCS);
		}
	}

	//calc base price
	var testWidth = document.shopcart.WidthInchesCS.value + document.shopcart.Width8thsCS.value;
	var testHeight = 0;
	if (document.shopcart.Height8thsCS.value == '0')
	{
		testHeight = document.shopcart.HeightInchesCS.value;
	}
	else
	{
		testHeight = document.shopcart.HeightInchesCS.value + document.shopcart.Height8thsCS.value;
	}
	
	Price = getBasePriceCS(blindWidth,blindHeight,testWidth,testHeight);
	
	//setup option availability prior to setting option pricing
	AdjValanceOptionsCS();
	
	
	if (document.getElementById('FeatureOption84_CS')) //Lining
	{
		if (document.shopcart.FeatureOption84_CS.value == 229 || document.shopcart.FeatureOption84_CS.value == 230)
		{
			OptionsPrice += 25;
		}
	}
	if (document.getElementById('FeatureOption96_CS')) //Lining
	{
		if (document.shopcart.FeatureOption96_CS.value == 416 || document.shopcart.FeatureOption96_CS.value == 417)
		{
			OptionsPrice += 25;
		}
	}
	if (document.getElementById('FeatureOption97_CS')) //Lining
	{
		if (document.shopcart.FeatureOption97_CS.value == 419 || document.shopcart.FeatureOption97_CS.value == 420)
		{
			OptionsPrice += 25;
		}
	}
	if (document.getElementById('FeatureOption81_CS')) //trim
	{
		if (document.shopcart.FeatureOption81_CS.value == 221 || document.shopcart.FeatureOption81_CS.value == 222 || (document.shopcart.FeatureOption81_CS.value >= 401 && document.shopcart.FeatureOption81_CS.value <= 406))
		{
			OptionsPrice += 25; //fringe
		}
		if (document.shopcart.FeatureOption81_CS.value >= 407 && document.shopcart.FeatureOption81_CS.value <= 414)
		{
			OptionsPrice += 20; //cord
		}
	}
	if (document.getElementById('FeatureOption86_CS')) //trim
	{
		if (document.shopcart.FeatureOption86_CS.value == 234 || document.shopcart.FeatureOption86_CS.value == 235 || (document.shopcart.FeatureOption86_CS.value >= 317 && document.shopcart.FeatureOption86_CS.value <= 322))
		{
			OptionsPrice += 25; //fringe
		}
		if (document.shopcart.FeatureOption86_CS.value >= 323 && document.shopcart.FeatureOption86_CS.value <= 330)
		{
			OptionsPrice += 20; //cord
		}
	}
	if (document.getElementById('FeatureOption87_CS')) //trim
	{
		if (document.shopcart.FeatureOption87_CS.value == 237 || document.shopcart.FeatureOption87_CS.value == 238 || (document.shopcart.FeatureOption87_CS.value >= 331 && document.shopcart.FeatureOption87_CS.value <= 336))
		{
			OptionsPrice += 25; //fringe
		}
		if (document.shopcart.FeatureOption87_CS.value >= 337 && document.shopcart.FeatureOption87_CS.value <= 344)
		{
			OptionsPrice += 20; //cord
		}
	}
	if (document.getElementById('FeatureOption88_CS')) //trim
	{
		if (document.shopcart.FeatureOption88_CS.value == 240 || document.shopcart.FeatureOption88_CS.value == 241 || (document.shopcart.FeatureOption88_CS.value >= 345 && document.shopcart.FeatureOption88_CS.value <= 350))
		{
			OptionsPrice += 25; //fringe
		}
		if (document.shopcart.FeatureOption88_CS.value >= 351 && document.shopcart.FeatureOption88_CS.value <= 358)
		{
			OptionsPrice += 20; //cord
		}
	}
	if (document.getElementById('FeatureOption89_CS')) //trim
	{
		if (document.shopcart.FeatureOption89_CS.value == 243 || document.shopcart.FeatureOption89_CS.value == 244 || (document.shopcart.FeatureOption89_CS.value >= 359 && document.shopcart.FeatureOption89_CS.value <= 364))
		{
			OptionsPrice += 25; //fringe
		}
		if (document.shopcart.FeatureOption89_CS.value >= 365 && document.shopcart.FeatureOption89_CS.value <= 372)
		{
			OptionsPrice += 20; //cord
		}
	}
	if (document.getElementById('FeatureOption90_CS')) //trim
	{
		if (document.shopcart.FeatureOption90_CS.value == 246 || document.shopcart.FeatureOption90_CS.value == 247 || (document.shopcart.FeatureOption90_CS.value >= 373 && document.shopcart.FeatureOption90_CS.value <= 378))
		{
			OptionsPrice += 25; //fringe
		}
		if (document.shopcart.FeatureOption90_CS.value >= 379 && document.shopcart.FeatureOption90_CS.value <= 386)
		{
			OptionsPrice += 20; //cord
		}
	}
	if (document.getElementById('FeatureOption91_CS')) //trim
	{
		if (document.shopcart.FeatureOption91_CS.value == 249 || document.shopcart.FeatureOption91_CS.value == 250 || (document.shopcart.FeatureOption91_CS.value >= 387 && document.shopcart.FeatureOption91_CS.value <= 392))
		{
			OptionsPrice += 25; //fringe
		}
		if (document.shopcart.FeatureOption91_CS.value >= 393 && document.shopcart.FeatureOption91_CS.value <= 400)
		{
			OptionsPrice += 20; //cord
		}
	}
	if (document.getElementById('FeatureOption68_CS'))
	{
		if (document.shopcart.FeatureOption68_CS.value > 176) //Rod Type selected
		{	
			if (document.shopcart.FeatureOption68_CS.value == 177) //Bamboo Rod selected
			{
				// Bamboo Pole
				if (document.getElementById('FeatureOption78_CS'))
				{
					if (document.getElementById('FeatureOption78_CS').value == 211) //48" 1 1/4"
					{
						OptionsPrice += 25;
					}
					if (document.getElementById('FeatureOption78_CS').value == 212) //72" 1 1/4"
					{
						OptionsPrice += 30;
					}
					if (document.getElementById('FeatureOption78_CS').value == 213) //96" 1 1/4"
					{
						OptionsPrice += 40;
					}
					if (document.getElementById('FeatureOption78_CS').value == 259) //48" 1 7/8"
					{
						OptionsPrice += 35;
					}
					if (document.getElementById('FeatureOption78_CS').value == 260) //72" 1 7/8"
					{
						OptionsPrice += 50;
					}
					if (document.getElementById('FeatureOption78_CS').value == 261) //96" 1 7/8"
					{
						OptionsPrice += 70;
					}
				}
				//Bamboo Brackets
				if (document.getElementById('FeatureOption94_CS'))
				{
					if (document.getElementById('FeatureOption94_CS').value == 298) //Single Bracket 1 1/4"
					{
						OptionsPrice += 15;
					}
					if (document.getElementById('FeatureOption94_CS').value == 299) //Double Bracket 1 1/4"
					{
						OptionsPrice += 25;
					}
					if (document.getElementById('FeatureOption94_CS').value == 300) //Single Bracket 1 7/8"
					{
						OptionsPrice += 12;
					}
					if (document.getElementById('FeatureOption94_CS').value == 301) //Double Bracket 1 7/8"
					{
						OptionsPrice += 15;
					}
				}
				//Bamboo Finials
				if (document.getElementById('FeatureOption74_CS'))
				{
					var woodFinials = document.getElementById('FeatureOption74_CS').value;
					if (woodFinials == 196 || woodFinials == 197 || woodFinials == 262 || woodFinials == 263 || woodFinials == 264 || woodFinials == 266)
					{
						OptionsPrice += 25;
					}
					if (woodFinials == 198)
					{
						OptionsPrice += 15;
					}
					if (woodFinials == 265)
					{
						OptionsPrice += 18;
					}
				}
			}
			if (document.shopcart.FeatureOption68_CS.value == 179) //Wood Rod selected
			{
				//Wood Pole Size
				if (document.getElementById('FeatureOption79_CS'))
				{
					if (document.getElementById('FeatureOption79_CS').value == 214) //48" 1 3/8" Fluted/Smooth
					{
						OptionsPrice += 25;
					}
					if (document.getElementById('FeatureOption79_CS').value == 215) //72" 1 3/8" Fluted/Smooth
					{
						OptionsPrice += 30;
					}
					if (document.getElementById('FeatureOption79_CS').value == 216) //96" 1 3/8" Fluted/Smooth
					{
						OptionsPrice += 40;
					}
					if (document.getElementById('FeatureOption79_CS').value == 267) //48" 2" Fluted/Smooth
					{
						OptionsPrice += 35;
					}
					if (document.getElementById('FeatureOption79_CS').value == 268) //72" 2" Fluted/Smooth
					{
						OptionsPrice += 50;
					}
					if (document.getElementById('FeatureOption79_CS').value == 269) //96" 2" Fluted/Smooth
					{
						OptionsPrice += 70;
					}
					if (document.getElementById('FeatureOption79_CS').value == 270) //48" 1 3/8" Spiral
					{
						OptionsPrice += 30;
					}
					if (document.getElementById('FeatureOption79_CS').value == 271) //72" 1 3/8" Spiral
					{
						OptionsPrice += 35;
					}
					if (document.getElementById('FeatureOption79_CS').value == 272) //96" 1 3/8" Spiral
					{
						OptionsPrice += 45;
					}
				}
				//Wood Finials
				if (document.getElementById('FeatureOption76_CS'))
				{
					if (document.getElementById('FeatureOption76_CS').value > 200 && document.getElementById('FeatureOption76_CS').value < 292)
					{
						OptionsPrice += 25;
					}
					if (document.getElementById('FeatureOption76_CS').value == 308)
					{
						OptionsPrice += 15;
					}
					if (document.getElementById('FeatureOption76_CS').value == 309)
					{
						OptionsPrice += 18;
					}
					if (document.getElementById('FeatureOption76_CS').value == 310)
					{
						OptionsPrice += 15;
					}
				}
				//Wood Brackets
				if (document.getElementById('FeatureOption95_CS'))
				{

					if (document.getElementById('FeatureOption95_CS').value == 302) //Single Bracket 1 3/8" Fluted/SMooth
					{
						OptionsPrice += 15;
					}
					if (document.getElementById('FeatureOption95_CS').value == 303) //Double Bracket 1 3/8" Fluted/Smooth
					{
						OptionsPrice += 25;
					}
					if (document.getElementById('FeatureOption95_CS').value == 304) //Single Bracket 2" Fluted/Smooth
					{
						OptionsPrice += 12;
					}
					if (document.getElementById('FeatureOption95_CS').value == 305) //Double Bracket 2" Fluted/Smooth
					{
						OptionsPrice += 15;
					}
					if (document.getElementById('FeatureOption95_CS').value == 306) //Single Bracket 1 3/8" Spiral
					{
						OptionsPrice += 15;
					}
					if (document.getElementById('FeatureOption95_CS').value == 307) //Double Bracket 1 3/8" Spiral
					{
						OptionsPrice += 25;
					}
				}
			}
			if (document.shopcart.FeatureOption68_CS.value == 178) //Metal Rod selected
			{
				//Metal Pole Size
				if (document.getElementById('FeatureOption80_CS'))
				{

					if (document.getElementById('FeatureOption80_CS').value == 217) //28 - 48"
					{
						OptionsPrice += 30;
					}
					if (document.getElementById('FeatureOption80_CS').value == 218) //48" - 86"
					{
						OptionsPrice += 35;
					}
					if (document.getElementById('FeatureOption80_CS').value == 219) //86 - 120"
					{
						OptionsPrice += 50;
					}
				}
				//Metal Finials
				if (document.getElementById('FeatureOption75_CS'))
				{
					if (document.getElementById('FeatureOption75_CS').value > 198 && document.getElementById('FeatureOption75_CS').value < 297) 
					{
						OptionsPrice += 25;
					}
					if (document.getElementById('FeatureOption75_CS').value == 297) 
					{
						OptionsPrice += 10;
					}
				}
			}
		}
	}
	
	//calc option price
//	OptionsPrice = getOptionPrices(Price);
	//calc option headrail
//	HeadrailPrice = getHeadrailPrice(Price);

//	Price += OptionsPrice + HeadrailPrice + TaxPrice;
	Price += OptionsPrice;
	
	var SalePercentage = eval(frmEle.SalePercentageCS.value);
	Price = ToDollarsAndCents(Price);
	SalePrice = ((Price - OptionsPrice) * SalePercentage) + (OptionsPrice);//give discount on base price only
	SalePrice = ToDollarsAndCents(SalePrice);
	frmEle.PriceCS.value = SalePrice;
	frmEle.ValancePriceCS.value = roundNumber(Price - (Price * .25), 2);
	//frmEle.DisplayPrice.value = Price;
	
	var displayPrice = 0;
	var displayTotalPrice = 0;
	var dealerLvl = document.getElementById("dealerlvl").value;
	//frmEle.DisplayPrice2.value = Price;
	if (dealerLvl == "0") 
	{
		if (Price == 0)
		{
			displayTotalPrice = ToDollarsAndCents(Price);
			displayPrice = ToDollarsAndCents(Price);
		}
		else
		{
			if (frmEle.DisplayPrice.value != '')
			{
				var tmpTotal = parseFloat(Price) + parseFloat(frmEle.DisplayPrice.value);
				displayTotalPrice = ToDollarsAndCents(roundNumber(tmpTotal - (tmpTotal * .25), 2));
				displayPrice = ToDollarsAndCents(roundNumber(Price - (Price * .25), 2));
			}
			else
			{
				displayTotalPrice = ToDollarsAndCents(roundNumber(Price - (Price * .25), 2));
				displayPrice = ToDollarsAndCents(roundNumber(Price - (Price * .25), 2));
			}
		}
	}
	if (Price == "0.00")
	{
		document.getElementById("DisplayPriceDivCS").innerHTML = "$N/A";
		document.getElementById("DisplayPriceDivTotalCS").innerHTML = "$N/A";
		//document.getElementById("DisplayPriceDivSale").innerHTML = "$N/A";
		//document.getElementById("DisplayMSRPPrice").innerHTML = "N/A";
	}
	else
	{
		document.getElementById("DisplayPriceDivCS").innerHTML = "$" + displayPrice;
		document.getElementById("DisplayPriceDivTotalCS").innerHTML = "$" + displayTotalPrice;
		//document.getElementById("DisplayPriceDivSale").innerHTML = "$" + SalePrice;	
		//document.getElementById("DisplayMSRPPrice").innerHTML = MSRPPrice;
	}
}

function ValanceStyle_None(pid)
{
	var loc = window.location.href;
	var index = loc.indexOf("?");
	if (index > 0)
	{
		loc = loc.substring(0, index);
		window.location.href = loc + "?pid=" + pid;
	}
	else
	{
		window.location.href = window.location.href + "?pid=" + pid;
	}
}

function ValanceStyle_Change(obj, pid, categoryID)
{ 
	var OptQStr = '&op=';
	if(document.getElementById('AvailableOptions'))
	{
		var strAvailableOptions = document.getElementById('AvailableOptions').innerHTML;	
		var AvailableOptions = strAvailableOptions.split(",");
		var OptName = '';
		var OptQstValue = false;
		
		for(i=0;i<AvailableOptions.length-1;i++)	
		{	AvailableOptions[i] = AvailableOptions[i].replace(" ", "");
			OptName = "Option" + AvailableOptions[i] ;
			OptQstValue = false;

			if(document.getElementById(OptName))
			{
				OptQstValue = document.getElementById(OptName).checked;
			}
			if(OptQstValue)
			{   
				OptQStr += "o" + AvailableOptions[i] + ",";
			}
		}
	}
	var loc = window.location.href;
	var index = loc.indexOf("?");
	if (index > 0)
	{
		loc = loc.substring(0, index);
		window.location.href = loc + "?pid=" + pid + "&cscid=" + categoryID + "&cspid=" + obj.options[obj.selectedIndex].value + OptQStr;
	}
	else
	{
		window.location.href = window.location.href + "?pid=" + pid + "&cscid=" + categoryID + "&cspid=" + obj.options[obj.selectedIndex].value + OptQStr;
	}
}

function roundNumber(num, dec) {
	var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
	return result;
}

function getPriceBreakCS(theSize,theType){

	var i = 0;
	var PriceBreak = 0;
	for(i=0;i<theType.length;i++){
		if(theSize <= theType[i] || i==(theType.length-1)) {
			//Find price break for selected size selected
			PriceBreak = theType[i];
			i = theType.length;
		}
	}
	return PriceBreak;
}

function getBasePriceCS(theWidth,theHeight,testWidth,testHeight){
	var i = 0;
	var Price = 0;
	//alert(theWidth + " " + theHeight);
	for(i=0;i<aPricingCS.length;i++){
		if(theWidth==aPricingCS[i].width && theHeight==aPricingCS[i].height) {
			//Find matching price
			Price = aPricingCS[i].price;

			if(Price == 0){
				alert("Due to weight constraints, the size you have selected is not available!");
				if(document.shopcart.submitbutton)document.shopcart.submitbutton.style.display = 'none';
			}
			else{
				if(document.shopcart.submitbutton)document.shopcart.submitbutton.style.display = 'block';
			}
			
			i = aPricingCS.length;
		}
	}

	return Price;
}

