/**
 * limpa select
 *
 * apaga todos os options de um select
 *
 * @access  public
 * @param   object  objeto  Objeto Combobox
 */
function nm_clear_select(objeto)
{ 
	for (var i=(objeto.options.length-1); i>=0; i--) 
	{ 
		objeto.options[i] = null; 
	} 
	objeto.selectedIndex = -1; 
}

function nm_add_option(objeto,text,value,selected)
{
	if(text!="")
	{
		if (objeto!=null && objeto.options!=null)
		{
			objeto.options[objeto.options.length] = new Option(text, value, false, selected);
		}
	}
}
function nm_rem_option(objeto)
{
	var selIndex = objeto.selectedIndex;
	if (selIndex != -1) {
		for(i=objeto.length-1; i>=0; i--)
		{
			if(objeto.options[i].selected)
			{
				objeto.options[i] = null;
			}
		}
		if (objeto.length > 0) {
			objeto.selectedIndex = selIndex == 0 ? 0 : selIndex - 1;
		}
	}
}
