    obj_XMLHTTP     = null;
    obj_CompFilho   = null;
    obj_CompPai     = null;
    str_PaginaAjax  = null;
    str_MsgErro     = null;
    str_CampoForm   = null;


    /************************** CÓDIGO DO CONSTRUTOR *************************/
    function ajaxInicializacao(  str_url, str_msg_erro, str_campo, str_msg1, str_msg2 )
    {
        str_PaginaAjax = str_url;
/*
        try
        {
            obj_CompPai = document.getElementById( str_id_campo_pai );
        }
        catch ( exception )
        {
            alert( "O componente \"MASTER\" " + str_id_campo_pai + " não foi reconhecido" );
        }

        try
        {
            obj_CompFilho = document.getElementById( str_id_campo_filho );
        }
        catch ( exception )
        {
            alert( "O componente \"SLAVE\" " + str_id_campo_filho + " não foi reconhecido" );
        }
*/
        str_MsgErro   = str_msg_erro;
        str_CampoForm = str_campo;
        str_Msg1      = str_msg1;
        str_Msg2      = str_msg2;
    }
    /*************************************************************************/


    /**
     * Interage com a página de acordo com o status do objeto XMLHTTP
     *
     * Esta função é utilizada para sobrescrever os métodos OnReadyStateChange,
     * OnLoad e OnError do objeto XMLHttp.
     *
     * @access public
     * @since 1.0
     */
    function ajaxStatusDados()
    {
        //enquanto estiver processando...emite a msg de carregando
        if ( obj_XMLHTTP.readyState == 1 )
        {
            obj_CompFilho.options[0].text     = "Carregando...";
            obj_CompFilho.options[0].selected = true;
        }

        //após ser processado - chama função ajaxProcessXML que vai varrer os dados
        if (   ( obj_XMLHTTP.readyState == 4 )
            || ( obj_XMLHTTP.readyState == "complete" ) )
        {
            if ( obj_XMLHTTP.responseXML )
            {
                ajaxProcessXML();
            }
            else
            {
                obj_CompFilho.options[0].text     = str_MsgErro;
                obj_CompFilho.options[0].selected = true;
            }
        }
    }


    /**
     * Instancia um objeto XMLHttp
     *
     * De acordo com o navegador, um objeto XMLHttp é instanciado e guardado
     * em uma variável membro da classe. Os métodos OnReadyStateChange,
     * OnLoad e OnError do objeto XMLHttp também são preenchidos
     *
     * @access public
     * @since 1.0
     */
    function ajaxGetXmlHttpObject( fnc_change )
    {
        if ( navigator.userAgent.indexOf( "MSIE" ) >= 0 )
        {
            var str_Nome = "Msxml2.XMLHTTP";

            if ( navigator.appVersion.indexOf( "MSIE 5.5" ) >= 0 )
            {
                str_Nome = "Microsoft.XMLHTTP";
            }

            try
            {
                obj_XMLHTTP = new ActiveXObject( str_Nome );
                obj_XMLHTTP.onreadystatechange = fnc_change;
            }
            catch ( e )
            {
                alert( "Error. Scripting for ActiveX might be disabled" );
            }
        }
        else
        {
            try
            {
                obj_XMLHTTP = new XMLHttpRequest();
            }
            catch ( e )
            {
                alert( "Seu navegador não suporte Ajax!" );
            }

            obj_XMLHTTP.onload  = fnc_change;
            obj_XMLHTTP.onerror = fnc_change;
        }
    }


    function ajaxDados(str_id_campo_pai, str_id_campo_filho)
    {
        obj_CompPai = str_id_campo_pai;
		obj_CompFilho = str_id_campo_filho;
		
		ajaxGetXmlHttpObject( ajaxStatusDados );

        var str_URL = str_PaginaAjax + "?" + str_CampoForm + "=" + obj_CompPai.value;

        obj_XMLHTTP.open( "GET", str_URL, true );
        obj_XMLHTTP.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded" );

        //Código do país
        obj_XMLHTTP.send( null );
    }


    function ajaxProcessXML()
    {
        //pega a tag cidade
        var arr_Dados = obj_XMLHTTP.responseXML.getElementsByTagName( "noh" );

        //Remove todos os <options> do <select>
        obj_CompFilho.options.length = 1;

        if ( arr_Dados.length > 0 )
        {
            for( var int_i = 0 ; int_i < arr_Dados.length; int_i++)
            {
                var obj_item = arr_Dados[int_i];

                //contéudo dos campos no arquivo XML
                var codigo    = obj_item.getElementsByTagName( "codigo" )[0].firstChild.nodeValue;
                var descricao = obj_item.getElementsByTagName( "descricao" )[0].firstChild.nodeValue;

                obj_CompFilho.options[0].text     = str_Msg1;
                obj_CompFilho.options[0].selected = true;

                //cria um novo option dinamicamente
                var obj_NovoItem = document.createElement( "option" );

                //atribui um ID a esse elemento
                //obj_NovoItem.setAttribute( "id", "opcoes" );

                //atribui um valor
                obj_NovoItem.value = codigo;

                //atribui um texto
                obj_NovoItem.text = descricao;

                //finalmente adiciona o novo elemento
                obj_CompFilho.options.add( obj_NovoItem );
            }
        }
        else
        {
            //caso o XML volte vazio, printa a mensagem abaixo
            obj_CompFilho.options[0].text     = str_Msg2;
            obj_CompFilho.options[0].selected = true;
        }
    }