function nuevoAjax(){var a=false;try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){if(!a&&typeof XMLHttpRequest!="undefined"){a=new XMLHttpRequest()}}}return a}var listadoSelects=new Array();listadoSelects[0]="select1";listadoSelects[1]="select2";listadoSelects[2]="select3";function buscarEnArray(c,b){var a=0;while(c[a]){if(c[a]==b){return a}a++}return null}function cargaContenido(d){var g=listadoSelects.indexOf(d)+1,e=$(d),h=e.getValue();if(h==0||h=="0"){listadoSelects.each(function(n,l){if(l<g){return}var k=$(n);k.options.length=0;var m=new Element("option",{value:0});m.update("Selecciona Opci&oacute;n...");k.insert(m);k.disabled=true})}else{if(listadoSelects.indexOf(d)!=(listadoSelects.size()-1)){var c=e.getValue(),b=listadoSelects[g],i=$(b),j=$("select1"),c=j.getValue(),a=["operations/select_dependientes_3_niveles_proceso.php?select=",b,"&opcion=",h,"&opcionInicial=",c].join("");loading(true,$(b));var f=new Ajax.Request(a,{method:"get",onSuccess:function(o){var k=function(q,p){var r=q.split("</option>");r.each(function(t){var u=t.split("=")[1].replace(/'/g,"").split(">"),s=new Element("option",{value:u[0]});p.appendChild(s.update(u[1]))})};var m=$(b);m.options.length=0;m.disabled=false;m.selectedIndex=0;m.observe("change",function(){cargaContenido(m.id)});if(d=="select1"){var n=$("select3");n.options.length=0;var l=new Element("option",{value:0});l.update("Selecciona Opci&oacute;n...");n.appendChild(l);n.disabled=true}loading(false);k(o.responseText,m)}})}}};