var selectedType;
//------------------------------------
	function setMake(type){
		var arr;
		selectedType=type;//save it for future use
		if(type=='ALL'){
			arr=combineDistinctArray(_search.getKey('USED').getAllKeysNames(),_search.getKey('NEW').getAllKeysNames());
		}else	if(type=='New'){
				arr=_search.getKey('NEW').getAllKeysNames();
		}else if(type=='Used'){
				arr=_search.getKey('USED').getAllKeysNames();
		}
		setOptions('make',arr,'Makes');
		setOptions('model',0,'Models');
	}
//-------------------------------------
	function setModel(make){
		var arr;
		if(selectedType=='ALL'){
			arr=combineDistinctArray(_search.getKey('NEW').getKey(make).getVals(),_search.getKey('USED').getKey(make).getVals());
		}else if(selectedType=='New'){
			arr=_search.getKey('NEW').getKey(make).getVals();
		}else if(selectedType=='Used'){
			arr=_search.getKey('USED').getKey(make).getVals();
		}
		setOptions('model',arr,'Models');
	}
//--------------------------------------