function enable(en)
{
	if(en == "s")
	{
		document.form1.slopeRatio.disabled = false;
		document.form1.sFL.disabled = false;
		document.form1.cFL.disabled = true;
		document.form1.maxVeg.disabled = true;

	}
	else
	{
		document.form1.slopeRatio.disabled = true;
		document.form1.sFL.disabled = true;
		document.form1.cFL.disabled = false;
		document.form1.maxVeg.disabled = false;

	}
}

var d = new dynamicSelect();
d.addSelect('slopeRatio');
d.selects['slopeRatio'].addOption('0');
d.selects['slopeRatio'].options['0'].createOption('<= 3 months', 's1a');
d.selects['slopeRatio'].options['0'].createOption('> 3 months < 12 months', 's2a');
d.selects['slopeRatio'].options['0'].createOption('> 12 months < 24 months', 's3a');
d.selects['slopeRatio'].options['0'].createOption('> 24 months < 36 months', 's4a');
d.selects['slopeRatio'].options['0'].createOption('> 36 months', 's5a');
d.selects['slopeRatio'].addOption('1');
d.selects['slopeRatio'].options['1'].createOption('<= 3 months', 's1b');
d.selects['slopeRatio'].options['1'].createOption('> 3 months < 12 months', 's2b');
d.selects['slopeRatio'].options['1'].createOption('> 12 months < 24 months', 's3b');
d.selects['slopeRatio'].options['1'].createOption('> 24 months < 36 months', 's4b');
d.selects['slopeRatio'].options['1'].createOption('> 36 months', 's5b');
d.selects['slopeRatio'].addOption('2');
d.selects['slopeRatio'].options['2'].createOption('<= 3 months', 's1c');
d.selects['slopeRatio'].options['2'].createOption('> 3 months < 12 months', 's2c');
d.selects['slopeRatio'].options['2'].createOption('> 12 months < 24 months', 's3c');
d.selects['slopeRatio'].options['2'].createOption('> 24 months < 36 months', 's4c');
d.selects['slopeRatio'].options['2'].createOption('> 36 months', 's5c');
d.selects['slopeRatio'].addOption('3');
d.selects['slopeRatio'].options['3'].createOption('<= 3 months', 's1d');
d.selects['slopeRatio'].options['3'].createOption('> 3 months < 12 months', 's2d');
d.selects['slopeRatio'].options['3'].createOption('> 12 months < 24 months', 's3d');
d.selects['slopeRatio'].options['3'].createOption('> 24 months < 36 months', 's4d');
d.selects['slopeRatio'].options['3'].createOption('> 36 months', 's5d');
d.selects['slopeRatio'].addOption('4');
d.selects['slopeRatio'].options['4'].createOption('> 12 months < 24 months', 's3e');
d.selects['slopeRatio'].options['4'].createOption('> 24 months < 36 months', 's4e');
d.selects['slopeRatio'].options['4'].createOption('> 36 months', 's5e');
d.selects['slopeRatio'].addOption('5');
d.selects['slopeRatio'].options['5'].createOption('> 24 months < 36 months', 's4f');
d.selects['slopeRatio'].options['5'].createOption('> 36 months', 's5f');
d.selects['slopeRatio'].addOption('6');
d.selects['slopeRatio'].options['6'].createOption('> 36 months', 's5g');

var e = new dynamicSelect();
e.addSelect('cFL');
e.selects['cFL'].addOption('0');
e.selects['cFL'].options['0'].createOption('t <= 12 Pa (<= 0.25 lbs/ft2)', 'c1a');
e.selects['cFL'].options['0'].createOption('t > 12 Pa and <= 24 Pa (> 0.25 lbs/ft2 and <= 0.5 lbs/ft2)', 'c1b');
e.selects['cFL'].options['0'].createOption('t > 24 Pa and <= 72 Pa (> 0.5 lbs/ft2 and <= 1.5 lbs/ft2)', 'c1c');
e.selects['cFL'].options['0'].createOption('t > 72 Pa and <= 84 Pa (> 1.5 lbs/ft2 and <= 1.75 lbs/ft2)', 'c1d');
e.selects['cFL'].addOption('1');
e.selects['cFL'].options['1'].createOption('t <= 12 Pa (<= 0.25 lbs/ft2)', 'c2a');
e.selects['cFL'].options['1'].createOption('t > 12 Pa and <= 24 Pa (> 0.25 lbs/ft2 and <= 0.5 lbs/ft2)', 'c2b');
e.selects['cFL'].options['1'].createOption('t > 24 Pa and <= 72 Pa (> 0.5 lbs/ft2 and <= 1.5 lbs/ft2)', 'c2c');
e.selects['cFL'].options['1'].createOption('t > 72 Pa and <= 84 Pa (> 1.5 lbs/ft2 and <= 1.75 lbs/ft2)', 'c2d');
e.selects['cFL'].addOption('2');
e.selects['cFL'].options['2'].createOption('t <= 12 Pa (<= 0.25 lbs/ft2)', 'c3a');
e.selects['cFL'].options['2'].createOption('t > 12 Pa and <= 24 Pa (> 0.25 lbs/ft2 and <= 0.5 lbs/ft2)', 'c3b');
e.selects['cFL'].options['2'].createOption('t > 24 Pa and <= 72 Pa (> 0.5 lbs/ft2 and <= 1.5 lbs/ft2)', 'c3c');
e.selects['cFL'].options['2'].createOption('t > 72 Pa and <= 84 Pa (> 1.5 lbs/ft2 and <= 1.75 lbs/ft2)', 'c3d');
e.selects['cFL'].options['2'].createOption('t > 84 Pa and <= 96 Pa (> 1.75 lbs/ft2 and <= 2.0 lbs/ft2)', 'c3e');
e.selects['cFL'].addOption('3');
e.selects['cFL'].options['3'].createOption('t <= 12 Pa (<= 0.25 lbs/ft2)', 'c4a');
e.selects['cFL'].options['3'].createOption('t > 12 Pa and <= 24 Pa (> 0.25 lbs/ft2 and <= 0.5 lbs/ft2)', 'c4b');
e.selects['cFL'].options['3'].createOption('t > 24 Pa and <= 72 Pa (> 0.5 lbs/ft2 and <= 1.5 lbs/ft2)', 'c4c');
e.selects['cFL'].options['3'].createOption('t > 72 Pa and <= 84 Pa (> 1.5 lbs/ft2 and <= 1.75 lbs/ft2)', 'c4d');
e.selects['cFL'].options['3'].createOption('t > 84 Pa and <= 96 Pa (> 1.75 lbs/ft2 and <= 2.0 lbs/ft2)', 'c4e');
e.selects['cFL'].options['3'].createOption('t > 96 Pa and <= 108 Pa (> 2.0 lbs/ft2 and <= 2.25 lbs/ft2)', 'c4f');
e.selects['cFL'].addOption('4');
e.selects['cFL'].options['4'].createOption('');
function dynamicSelect()
{
	this.selects = new Array();
	this.addSelect = function(name)
	{
		this.selects[name] = new selectObj();
	}
	this.updateOptions = function(source, target)
	{
		var form = source.form;
		var target = form.elements[target];
		var value = source.options[source.selectedIndex].value;

		while(target.options.length) target.remove(0);
		if(!this.selects[source.name].options[value])
		{
			alert("Error");
			return;
		}
		var data = this.selects[source.name].options[value].options;
		for(var x=0; x<data.length; x++)
		{
			try
			{
				target.add(data[x]);
			}
			catch(e)
			{
				target.add(data[x], null);
			}
		}
		target.selectedIndex = 0;
	}
}

function selectObj()
{
	this.options = new Array();
	this.addOption = function(value)
	{
		this.options[value] = new optionObj();
	}
}
function optionObj()
{
	this.options = new Array();
	this.createOption = function(name, value)
	{
		this.options[this.options.length] = new Option(name, value);
	}
}
function update()
{
	document.form1.maxUnVeg.options.length = 0;
	if(document.form1.maxVeg.value == "0")
	{
		if(document.form1.cFL.value == "4")
		{
			e.updateOptions(document.form1.cFL, 'maxUnVeg');
			document.form1.maxUnVeg.disabled = true;
		}
		else
		{
		document.form1.maxUnVeg.disabled = false;
		e.updateOptions(document.form1.cFL, 'maxUnVeg');
		}
	}
	else
	{
		document.form1.maxUnVeg.disabled = true;
	}
}