	function getSelCombo(nomeCombo){
		//RETORNA O VALOR DO ID REF À OPÇÃO SELECIONADA
		var id = -1;
		var comboOrig = document.getElementById(nomeCombo);		
		if (comboOrig != null){
			tipo = comboOrig.type;
			if (tipo == 'select-multiple'){
				x=0;
				var arrResp = new Array();
				for(i=0;i<comboOrig.length;i++){
					opt = comboOrig.options[i];
					sel = opt.selected;
					if (sel){
						//A opção atual está selecionada
						//alert(opt.value);
						arrResp[x++]=opt.value;
					}
				}
				id = arrResp.join(',');
				//alert("ID: " + id);
			} else if('select-one') {
				var ind = comboOrig.selectedIndex;			
				if (ind >= 0) id = comboOrig.options[ind].value;
			}
			//alert(id);
		}
		return id;	
	}
	
	function getTextSelCombo(nomeCombo){
		//RETORNA O TEXTO ENTRE <OPTION></OPTION> REF À OPÇÃO SELECIONADA
		var text = '';
		var comboOrig = document.getElementById(nomeCombo);
		if (comboOrig != null){
			var ind = comboOrig.selectedIndex;			
			text = comboOrig.options[ind].text;
			//alert(id);
		}
		return text;	
	}
	
	function setCombo(nome,value){
		//Seleciona o valor value no combobox atual
		objField = document.getElementById(nome);
		if (objField != null) {
			//LIMPA AS OPÇÕES ATUAIS
			cb = objField.length;
			for(x=0;x<cb;x++){
				objField.options[x].selected = false;
			}//Fim do loop fo			
			tipo = objField.type;									
			if (tipo == 'select-one'){
				cb = objField.length;
				for(x=0;x<cb;x++){
					cbValue = objField.options[x].value;
					//alert(cbValue +" == "+ value);
					if (cbValue == value) {
						//alert('foi');
						objField.options[x].selected = true;
						break;
					}
				}//Fim do loop for
			} else if (tipo =='select-multiple'){
				arr = value.split(',');
				for(i=0;i<arr.length;i++){
					vl = arr[i];
					cb = objField.length;
					for(x=0;x<cb;x++){
						cbValue = objField.options[x].value;
						//alert(cbValue +" == "+ vl);
						if (vl.length > 0 && cbValue == vl) {
							//alert('foi');
							objField.options[x].selected = true;
						}
					}//Fim do loop for					
				}
			}//Fim do if tipo		
		}//Fim do if objField
	}
	
	
	function formataOption(nome,listaValor,cssFormat){
		//Formata os itens em listaValor com o css especificado
		objField = document.getElementById(nome);
		arrValores = listaValor.split(',');
		if (objField != null) {
			cb = objField.length;
			for(x=0;x<cb;x++){
				cbValue = objField.options[x].value;
				for(w=0;w<arrValores.length;w++){
					listValue = arrValores[w];
					if (listValue == cbValue) {
						objField.options[x].className=cssFormat;
						objField.options[x].value=0;
						objField.options[x].selected=false;
						//alert(cssFormat);
					}
				}
			}//Fim do loop for
		}//Fim do if objField
	}	
