        var objAjax;

        function getHTTPObject(){
                if(window.XMLHttpRequest){
                        return new XMLHttpRequest();
                } else
                if(window.ActiveXObject){
                        var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];
                        
                        for(var i = 0; i < prefixes.length; i++){
                                try{
                                    return new ActiveXObject(prefixes[i] + ".XMLHTTP");
                                } catch (e) {}
                        }
                }
        }


				function limpaProdutor() {
					 for (var i = document.fBusca.pr.options.length - 1; i >= 1; i--){
					   document.fBusca.pr.options[i] = null;
					 }					
				}


        function ativaProdutor( oId ){
                objAjax = getHTTPObject();
                limpaProdutor();
                objAjax.onreadystatechange = retornoProdutor;
                objAjax.open("GET","muda-busca.php?ac=pr&id=" + oId, true);
                objAjax.send(null);
        }

        function retornoProdutor(){
        	//alert(objAjax.responseText);
                if (objAjax.readyState == 4){

                                document.fBusca.pr.options[0].text = "Produtor";
                                eval(objAjax.responseText);
                                
                }
        }
        
        
				function limpaLinha() {
					 for (var i = document.fBusca.lp.options.length - 1; i >= 1; i--){
					   document.fBusca.lp.options[i] = null;
					 }					
				}


        function ativaLinha( oId ){
                objAjax = getHTTPObject();
                limpaLinha();
                objAjax.onreadystatechange = retornoLinha;
                objAjax.open("GET","muda-busca.php?ac=ln&id=" + oId, true);
                objAjax.send(null);
        }

        function retornoLinha(){
        	//alert(objAjax.responseText);
                if (objAjax.readyState == 4){

                                document.fBusca.lp.options[0].text = "Linha de produtos";
                                eval(objAjax.responseText);
                                
                }
        }
