//funcion encarga de crear el objeto
function ajaxInit(){
    try{
	xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch (e){
	try{
	     xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E){
	     xmlHttp = false;
	}
    }
    if (!xmlHttp && typeof XMLHttpRequest!='undefined'){
	xmlHttp = new XMLHttpRequest();
    }
    return xmlHttp;
}

function ejecutar(_url, _values, _divName, _show){
    ajax = ajaxInit();
    ajax.open("GET",_url+"?&"+_values,true);
    ajax.onreadystatechange=function(){
		if (ajax.readyState==1){
			if(_show){
				if (document.getElementById(_divName).style.display==""){
					document.getElementById(_divName).style.display="none";
				}else{
					document.getElementById(_divName).style.display="";
				}
			}else{
				document.getElementById(_divName).style.display="";
			}
	        document.getElementById(_divName).innerHTML = "Cargando...";
	    }else if (ajax.readyState==4){
		    if(ajax.status==200){
			document.getElementById(_divName).innerHTML=ajax.responseText;
		    }
		}
    }
    //alert(_url+"?&"+_values+" en "+_divName);
    ajax.send(null);
    return;
}
 
function hideShow(D_LI){
    //_id_cap=document.getElementById(D_A);
    _id_master=document.getElementById(D_LI);
    _id_master.style.display = (_id_master.style.display == "")?"none":"";
    //_id_master.style.fontWeight = (_id_cap.style.display == "")?"bold":"normal";
}

