function objetoAjax()
{
	if (window.XMLHttpRequest) {
     req = new XMLHttpRequest();
   } else if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
   }
   return req;

}  

/*/function objetoAjaxDos(){
	
	var xmlhttp=false;
	var idAX = ["Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];
	for(var i=0; !xmlhttp && i<idAX.length; i++){
		try{ xmlhttp = new ActiveXObject(idAX[i]);
	}catch(ex){
		xmlhttp = false; 
	}
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}   
	if (!xmlhttp){
		alert('Falla :( No es posible crear una instancia XMLHTTP');
	}
	return xmlhttp;
	}
	}*/
	
/*function crearInstancia() {
XMLHttp = false;
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if (window.ActiveXObject) {
var versiones = ["Msxml2.XMLHTTP.7.0", "Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP", "Microsoft.XMLHTTP"];
for (var i=0;i<versiones.length;i++) {
try {
XMLHttp = new ActiveXObject(versiones[i]);
if (XMLHttp) {
return XMLHttp;
break;
}
} catch (e) {};
}
}
}*/

function agrega_options(combo_id, opt_val, opt_text){
	alert (combo_id);
	combo_llenado = document.getElementById(combo_id);
	option_agregado = document.createElement('OPTION');
	option_agregado.value = opt_val;
	option_agregado.text = opt_text;
	try{ combo_llenado.add(option_agregado); }
	catch(ex){ combo_llenado.add(option_agregado,null); }
	return;
}

function selecciona_opcion(combo,opcion,inicio)
{
	for (i = inicio; i < combo.options.length; i++)
	{
		if (combo.options[i].value == opcion)
		{
			combo.options[i].selected = true;
			break;			
		}
		
	}
}

function limpia_combo(id_combo){
	combo = document.getElementById(id_combo);
	combo.id=id_combo;
	for(i=combo.options.length;i>0;i--){
		combo.remove(i);		
	}
	return true;
}
