  var get_subcategoria;
  
   
function getsubcategoria() 
{							
    var valorcampo = document.formCateg.cat.options[document.formCateg.cat.selectedIndex].value;
    // código para objeto nativo XMLHttpRequest
    if (window.XMLHttpRequest) {
        get_subcategoria = new XMLHttpRequest();
        get_subcategoria.onreadystatechange = recibir2;
        get_subcategoria.open("GET", "/anuncios/ajax/getsubcategoria.asp?cat="+valorcampo,true);
        get_subcategoria.send(null);
    // código para objeto ActiveX IE/Windows
    } else if (window.ActiveXObject) {
        get_subcategoria = new ActiveXObject("Microsoft.XMLHTTP");
        if (get_subcategoria) {
            get_subcategoria.onreadystatechange = recibir2;
            get_subcategoria.open("GET", "/anuncios/ajax/getsubcategoria.asp?cat="+valorcampo,true);
            get_subcategoria.send();
        }
    }
}


     
function recibir2() {   
	var strRes;       
    var arrValores;  
	var mivariable = new Array();
	if (get_subcategoria.readyState == 4) {	    
		strRes=get_subcategoria.responseText;
		arrValores=strRes.split("|");
		document.formCateg.subcat.options.length=0;		    
		for(i=0;i<arrValores.length;i++)
		{
			mivariable = arrValores[i].split(";");
			document.formCateg.subcat.options[document.formCateg.subcat.options.length]= new Option(mivariable[1],mivariable[0]); 
		}
	}
}

