function lf_dynamicSelect() {
	this.selects = new Array();

	this.addSelect = function(name) {
		this.selects[name] = new selectObj();
	}
	this.updateOptions = function(source, target, level2, level3)
	// source = 1st select
	// target = name of target select
	// if there is a sub cat id, need SelectedIndex of value of subcat
	{
	    var form = source.form;
	    var target = form.elements[target];
	    var value = source.options[source.selectedIndex].value;
	    while (target.options.length) target.remove(0);

	    // if level1 value = "other" then show other div"
	    if (value == 'Other') {
	        getElementRef('heardOther').style.display = 'block';
	    } else {
	        //hide level 3 box on any change
	        getElementRef(level3).style.display = 'none';
	        form.hOther.value = '';
	    }
	    // check current select has a level 2
	    if (!this.selects[source.name].options[value]) {
	        //alert('Invalid selection.'); //For debugging while you set it up
	        getElementRef(level2).style.display = 'none';
	        return;
	    } else {
	        getElementRef(level2).style.display = 'inline';
	    }

	    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);
	}
}
//Start setup [Edit below here]

var d = new lf_dynamicSelect();
// need "subCats" to determine if category has subCategory (used in lead_form_heard_about.js)
var subCats = 'Advertisement,Website,Referral,Search Engine, Trade Show'

d.addSelect('heard');

d.selects['heard'].addOption('Advertisement');
d.selects['heard'].options['Advertisement'].createOption('Select One', '');
d.selects['heard'].options['Advertisement'].createOption('Business Solutions', 'Business Solutions');
d.selects['heard'].options['Advertisement'].createOption('CRN', 'CRN');
d.selects['heard'].options['Advertisement'].createOption('Redmond Channel Partners', 'Redmond Channel Partners');
d.selects['heard'].options['Advertisement'].createOption('RSPA', 'RSPA');
d.selects['heard'].options['Advertisement'].createOption('VARBusiness', 'VARBusiness');
d.selects['heard'].options['Advertisement'].createOption('Other', 'Other');

d.selects['heard'].addOption('Website');
d.selects['heard'].options['Website'].createOption('Select One', '');
d.selects['heard'].options['Website'].createOption('Autotask', 'Autotask');
d.selects['heard'].options['Website'].createOption('Capterra', 'Catperra');
d.selects['heard'].options['Website'].createOption('The Software Network', 'The Software Network');
d.selects['heard'].options['Website'].createOption('Web-Based Software', 'Web-Based Software');
d.selects['heard'].options['Website'].createOption('Other', 'Other');

d.selects['heard'].addOption('Referral');
d.selects['heard'].options['Referral'].createOption('Select One', '');
d.selects['heard'].options['Referral'].createOption('Autotask User', 'Autotask User');
d.selects['heard'].options['Referral'].createOption('Friend/Colleague', 'Friend/Colleague');
d.selects['heard'].options['Referral'].createOption('Ingram Micro', 'Ingram Micro');
d.selects['heard'].options['Referral'].createOption('Kaseya', 'Kaseya');
d.selects['heard'].options['Referral'].createOption('Level Platforms', 'Level Platforms');
d.selects['heard'].options['Referral'].createOption('MSP Partners', 'MSP Partners');
d.selects['heard'].options['Referral'].createOption('MSPSN', 'MSPSN');
d.selects['heard'].options['Referral'].createOption('N-able', 'N-able');
d.selects['heard'].options['Referral'].createOption('Other', 'Other');

d.selects['heard'].addOption('Search Engine');
d.selects['heard'].options['Search Engine'].createOption('Select One', '');
d.selects['heard'].options['Search Engine'].createOption('Google', 'Google');
d.selects['heard'].options['Search Engine'].createOption('MSN', 'MSN');
d.selects['heard'].options['Search Engine'].createOption('Yahoo!', 'Yahoo!');
d.selects['heard'].options['Search Engine'].createOption('Other', 'Other');

d.selects['heard'].addOption('Trade Show');
d.selects['heard'].options['Trade Show'].createOption('Select One', '');
d.selects['heard'].options['Trade Show'].createOption('ASCII Bootcamp', 'ASCII Bootcamp');
d.selects['heard'].options['Trade Show'].createOption('Comptia', 'Comptia');
d.selects['heard'].options['Trade Show'].createOption('Ingram Micro Event', 'Ingram Micro Event');
d.selects['heard'].options['Trade Show'].createOption('IT Alliance', 'IT Alliance');
d.selects['heard'].options['Trade Show'].createOption('Microsoft Event', 'Microsoft Event');
d.selects['heard'].options['Trade Show'].createOption('MSP Alliance', 'MSP Alliance');
d.selects['heard'].options['Trade Show'].createOption('SBS Group', 'SBS Group');
d.selects['heard'].options['Trade Show'].createOption('SMB Nation', 'SMB Nation');
d.selects['heard'].options['Trade Show'].createOption('XChange', 'XChange');
d.selects['heard'].options['Trade Show'].createOption('Other', 'Other');