function VeeSelect(form){

	this.basePath = 'php/obj.form.els.php';
	
	// CHAINED-SELECTOR OBJECT
	this.chainSel = [];
	this.chainSel[0] = new ChainedSelector('mode', 'cs_combo_mode');
	this.chainSel[1] = new ChainedSelector('make', 'cs_combo_make');
	this.chainSel[2] = new ChainedSelector('model', 'cs_combo_model');
	this.chainSel[3] = new ChainedSelector('year', 'cs_combo_year');
	this.chainSel[4] = new ChainedSelector('hiddens', null);
			
	this.ripple = function(next_index, this_obj){			
		mode 	= document.forms[form].mode.value;
		make 	= document.forms[form].make.value;
		model 	= document.forms[form].model.value;
		year 	= document.forms[form].year.value;
		
		var path = this.basePath + '?vs_action=' + this.chainSel[next_index].name;
		var path_post = '&mode=' + mode + '&make=' + make + '&model=' + model + '&year=' + year
		
		var ajiz = new AJAXClosure(path + path_post, function(response){this_obj.load(response, next_index)});		
		ajiz.doGet();	
	}
	
	this.load = function(response, next_index){
		if(next_index >= this.chainSel.length - 1){
			response = response.split("<d>");
			document.forms[form].type.value = response[0];
			document.forms[form].vehicle_id.value = response[1];
			return;
		}
		
		var selector = $(this.chainSel[next_index].combo_name);
		selector.empty();
		var els = response.split('|');
		for(var i = 0; i < els.length; i++){
			if(!els[i]) continue;
			
			var chain_el = new Element( 'option', { "value" : els[i] } ).setHTML( els[i] );
			
			selector.adopt(chain_el);
		}
		
		this.ripple(next_index + 1, this);
	}
}

function ChainedSelector(name, combo_name){
	this.name = name;
	this.combo_name = combo_name;
}
