
/*
Script by RoBorg
RoBorg@geniusbug.com
http://javascript.geniusbug.com
Please do not remove or edit this message
*/



//Start setup [Edit below here]

var d = new dynamicSelect();

d.addSelect('model');

d.selects['model'].addOption('honda');
d.selects['model'].options['honda'].createOption('All Honda Models', 'All Honda Models');
d.selects['model'].options['honda'].createOption('CBR600', 'CBR600');
d.selects['model'].options['honda'].createOption('CBR600F2', 'CBR600F2');
d.selects['model'].options['honda'].createOption('CBR600F3', 'CBR600F3');
d.selects['model'].options['honda'].createOption('CBR600F4', 'CBR600F4');
d.selects['model'].options['honda'].createOption('CBR600F4i', 'CBR600F4i');
d.selects['model'].options['honda'].createOption('CBR600RR', 'CBR600RR');



d.selects['model'].addOption('harley-davidson');
d.selects['model'].options['harley-davidson'].createOption('All Harley-Davidson® Models', 'All Harley-Davidson® Models');
d.selects['model'].options['harley-davidson'].createOption('FLH', 'FLH');
d.selects['model'].options['harley-davidson'].createOption('FLHPI', 'FLHPI');
d.selects['model'].options['harley-davidson'].createOption('FLHR', 'FLHR');
d.selects['model'].options['harley-davidson'].createOption('FLHRCI', 'FLHRCI');
d.selects['model'].options['harley-davidson'].createOption('FLHRI', 'FLHRI');
d.selects['model'].options['harley-davidson'].createOption('FLHRI-SH', 'FLHRI-SH');
d.selects['model'].options['harley-davidson'].createOption('FLHRPI', 'FLHRPI');
d.selects['model'].options['harley-davidson'].createOption('FLHRS', 'FLHRS');
d.selects['model'].options['harley-davidson'].createOption('FLHRSI', 'FLHRSI');
d.selects['model'].options['harley-davidson'].createOption('FLHSTC', 'FLHSTC');





d.selects['typeofunitid'].addOption('5');
d.selects['typeofunitid'].options['5'].createOption('All Cruisers', 'All Cruisers');
d.selects['typeofunitid'].options['5'].createOption('Harley-Davidson® Dyna Glide Models', 'Harley-Davidson® Dyna Glide Models');
d.selects['typeofunitid'].options['5'].createOption('Harley-Davidson® Softail Models', 'Harley-Davidson® Softail Models');
d.selects['typeofunitid'].options['5'].createOption('Harley-Davidson® Sportster Models', 'Harley-Davidson® Sportster Models');
d.selects['typeofunitid'].options['5'].createOption('Harley-Davidson® VRSC Models', 'Harley-Davidson® VRSC Models');
d.selects['typeofunitid'].options['5'].createOption('Starter Cruisers ... 600cc and Under', 'Starter Cruisers ... 600cc and Under');
d.selects['typeofunitid'].options['5'].createOption('Midrange Cruisers ... 750cc Class', 'Midrange Cruisers ... 750cc Class');
d.selects['typeofunitid'].options['5'].createOption('High End Cruisers ... 1000cc and Up', 'High End Cruisers ... 1000cc and Up');



d.selects['typeofunitid'].addOption('4');
d.selects['typeofunitid'].options['4'].createOption('All DualSport Models', 'All DualSport Models');
d.selects['typeofunitid'].options['4'].createOption('BMW Adventure Models', 'BMW Adventure Models');
d.selects['typeofunitid'].options['4'].createOption('KTM Adventure Models', 'KTM Adventure Models');
d.selects['typeofunitid'].options['4'].createOption('Under 250cc Models', 'Under 250cc Models');
d.selects['typeofunitid'].options['4'].createOption('Over 250cc Models', 'Over 250cc Models');


d.selects['typeofunitid'].addOption('3');
d.selects['typeofunitid'].options['3'].createOption('All Sportbike Models', 'All Sportbike Models');
d.selects['typeofunitid'].options['3'].createOption('Starter Sport Bikes ... 500cc and Under', 'Starter Sport Bikes ... 500cc and Under');
d.selects['typeofunitid'].options['3'].createOption('Midrange Sport Bikes ... 600cc to 750cc Class', 'Midrange Sport Bikes ... 600cc to 750cc Class');
d.selects['typeofunitid'].options['3'].createOption('High End Sport Bikes ... 750cc and Up', 'High End Sport Bikes ... 750cc and Up');



d.selects['typeofunitid'].addOption('2');
d.selects['typeofunitid'].options['2'].createOption('All Sport Touring Models', 'All Sport Touring Models');
d.selects['typeofunitid'].options['2'].createOption('BMW Sport Touring', 'BMW Sport Touring');
d.selects['typeofunitid'].options['2'].createOption('Ducati Sport Touring', 'Ducati Sport Touring');
d.selects['typeofunitid'].options['2'].createOption('Triumph Sport Touring', 'Triumph Sport Touring');
d.selects['typeofunitid'].options['2'].createOption('Japanese Sport Touring', 'Japanese Sport Touring');



d.selects['typeofunitid'].addOption('1');
d.selects['typeofunitid'].options['1'].createOption('All Standard Models', 'All Standard Models');
d.selects['typeofunitid'].options['1'].createOption('Starter Standard Models ... 500cc and Under', 'Starter Standard Models ... 500cc and Under');
d.selects['typeofunitid'].options['1'].createOption('Midrange Standard Models ... 600cc to 750cc Class', 'Starter Standard Models ... 600cc to 750cc Class');
d.selects['typeofunitid'].options['1'].createOption('High End Standard Models ... 750cc and Up', 'High End Standard Models ... 750cc and Up');



d.selects['typeofunitid'].addOption('6');
d.selects['typeofunitid'].options['6'].createOption('All Touring Models', 'All Touring Models');
d.selects['typeofunitid'].options['6'].createOption('BMW Touring Models', 'BMW Touring Models');
d.selects['typeofunitid'].options['6'].createOption('Harley-Davidson® Touring Models', 'Harley-Davidson® Touring Models');
d.selects['typeofunitid'].options['6'].createOption('Japanese Touring Models', 'Japanese Touring Models');



























//End setup [Edit above here]



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('Invalid selection.'); //For debugging while you set it up
			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);
	}
}

