function change_select(cid){
	if (cid.length==0) return;
	$("#category_select").empty();
    $("#category_select").append(select_html[cid]);
}

function SHCategoryList(type) {
	cat_list = $('.decissions-main-menu'); 
	for (i=0; i<cat_list.length; i++) {
		cur_cat_list = cat_list.eq(i);
		if (cur_cat_list.attr('id') == 'list_cat_' + type) {
			cur_cat_list.toggleClass('hide');
		} else {
			cur_cat_list.addClass('hide');
		}
	}
}

function SetCatVal(type, id, subid, redirect) {
	if (typeof(id) == "undefined") id=0;
	if (typeof(subid) == "undefined") subid=0;
	if (typeof(redirect) == "undefined") redirect=true;
	
	if (id==0) {
		$('#name_cat_' + type).text('');
		$('#cs_category_' + type).removeAttr('value');
	} else {
		$('#name_cat_' + type).text(category[type][id]['CHILD'][subid]);
		$('#cs_category_' + type).attr('value', subid);
		if (redirect == true) {
			SubmitDealerSCForm();
		}
	}
}
function SubmitDealerSCForm() {
	if ($('#cs_category_c').val().length <= 0) {
		alert('Выберите назначение'); return false;
	} else {
		document.dealerSCForm.submit();
	}
}
function change_filter(){
	if($('#letter_filter').css("display") == 'none'){
		$('#spher_filter').slideUp();
		$('#letter_filter').slideToggle();
		$('#spher_name').html('<a href="#" onclick="change_filter();return false;">Выбор дилеров по сфере деятельности</a>');
		
		$('#letter_name').html('Выбор дилеров по алфавиту');
	}else{
		$('#letter_filter').slideUp();
		$('#spher_filter').slideToggle();
		$('#letter_name').html('<a href="#" onclick="change_filter();return false;">Выбор дилеров по алфавиту</a>');
		
		$('#spher_name').html('Выбор дилеров по сфере деятельности');
	}
}