function FormBusca_ClearSelect(Select){
	for(var i = Select.length-1; i >= 0; i--){Select.remove(i);}
}
function loadBairro(CmbCidadeValue,CmbBairro,Funcao){
	if(CmbCidadeValue!=""){
		var SelectBairro = CmbBairro;
		FormBusca_ClearSelect(SelectBairro);
		
		// begin carregando
		optCarregando = document.createElement("option"); optCarregando.value = ""; optCarregando.text  = " Carregando... ";
		var selCarregando = SelectBairro.options[SelectBairro.firsh];
		try {SelectBairro.add(optCarregando,selCarregando); } catch(ex) {SelectBairro.add(optCarregando, SelectBairro.selectedIndex);}
		// end carregando
		jQuery.post("../_global/componentes/asp/gapo/sil/sil.asp", {command: Funcao, parameter: CmbCidadeValue},
			function(xml){
				FormBusca_ClearSelect(SelectBairro);
				var combobox = SelectBairro;
				
				if(CmbCidadeValue != '-1')
					combobox.disabled = '';
				else
					combobox.disabled = 'disabled';
				
				jQuery(xml).find('option').each(function(){
					selected = jQuery(this).attr('selected');
					value = jQuery(this).find('value').text();
					text = jQuery(this).find('text').text();
					opt = document.createElement("option"); opt.value = value; opt.text = text;
					if(selected == 'true'){opt.selected = true;}
					var sel = combobox.options[combobox.firsh];
					try{
						combobox.add(opt,sel);
					}catch(ex){
						combobox.add(opt, combobox.selectedIndex); // para o IE
					}
				});
		  }, "xml");
	}
}
