    function changeProvincia (tempMun, tempPro, temptipo)
    {
        
        //obtenemos las provcincias del municipo seleccionado
        
        $.ajax({
            type: "GET",
            url: "datos/scripts/app6/ajaxBuscaEmpresas.asp",
            cache: false,
            data: "destino=mundes&mundessel="+tempMun+"&thdes="+$("select#thdes").attr("value"),
            success: function(html){
                
                //document.getElementById("mundes").outerHTML  = unescape (html);
                $("#mundes").replaceWith ( unescape (html));
                
                changeMunicipio(tempPro,temptipo);
                }
        });
        //productos disponible en esas provincias
        $.ajax({
            type: "GET",
            url: "datos/scripts/app6/ajaxBuscaEmpresas.asp",
            cache: false,
            data: "destino=procod&thdes="+$("select#thdes").attr("value"),
            success: function(html){
                //document.getElementById("mundes").outerHTML  = unescape (html);
                $("#procod").replaceWith ( unescape (html));
                
                }
        });
         $.ajax({
            type: "GET",
            url: "datos/scripts/app6/ajaxBuscaEmpresas.asp",
            cache: false,
            data: "destino=tipo&thdes="+$("select#thdes").attr("value")+"&mundes="+$("select#mundes").attr("value")+"&procod="+$("select#procod").attr("value"),
            success: function(html){
                $("#tipo").replaceWith ( unescape (html));
                changeProducto (temptipo);
                }
        });
        
        
    }

    
 function changeMunicipio (temp,temptipo)
    {
        $.ajax({
            type: "GET",
            url: "datos/scripts/app6/ajaxBuscaEmpresas.asp",
            cache: false,
            data: "destino=procod&prosel="+temp+"&mundes="+$("select#mundes").attr("value")+"&thdes="+$("select#thdes").attr("value"),
            success: function(html){
                $("#procod").replaceWith ( unescape (html));
                changeProducto (temptipo);
                }
        });
    }
    
function changeProducto (temp)
{
    /*var url ="http://www.euskolabel.net/datos/scripts/app6/ajaxBuscaEmpresas.asp?";
    url = url + "destino=tipo&tipsel="+temp+"&thdes="+$("select#thdes").attr("value")+"&mundes="+$("select#mundes").attr("value")+"&procod="+$("select#procod").attr("value");
    window.open (url,"","");*/

    $.ajax({
            type: "GET",
            url: "datos/scripts/app6/ajaxBuscaEmpresas.asp",
            cache: false,
            data: "destino=tipo&tipsel="+temp+"&thdes="+$("select#thdes").attr("value")+"&mundes="+$("select#mundes").attr("value")+"&procod="+$("select#procod").attr("value"),
            success: function(html){
                $("#tipo").replaceWith ( unescape (html));
                }
        });
}
