function getXMLHTTPRequest() {

try {
req = new XMLHttpRequest(); /* p.e. Firefox */
} catch(e) {
  try {
  req = new ActiveXObject("Msxml2.XMLHTTP");
  /* algunas versiones IE */
  } catch (e) {
    try {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    /* algunas versiones IE */
    } catch (e) {
      req = false;
    }
  }
}
return req;

}
var http = getXMLHTTPRequest();

function carga_areas_serv(subsecc) {
	
	opcion=subsecc;
	
   var myurl = subsecc+'.php';
  
    myRand = parseInt(Math.random()*999999999999999);
    // saltarse la cache
   
   var modurl = myurl+"?rand="+myRand;

   http.open("GET", modurl, true);
   http.onreadystatechange = useHttpResponseArea;
   http.send(null);
}

function useHttpResponseArea() {
	
	
   //Selecciona el div donde ira todo el contenido que se obtenga
   //var area = document.getElementById("contenido");
   
   if (http.readyState == 4) {
	   if(http.status == 200) {
			
		//Mete en el div contenido, el contenido de la pagina consultada
	    document.getElementById("contenido").innerHTML = http.responseText;
		
		if (opcion=="correccion" || opcion=="paquetes")
		{
		new Accordian('basic-accordian',5,'header_highlight');
		}
	   }
	}
  else
  {
	  document.getElementById("contenido").innerHTML = '<img src="imagenes/cargando.gif" style="position:absolute;left:32%;top:40%;" />';
  }
}

function carga_opciones_redac(optredac) {
	
   var myurl = 'includes/'+optredac+'.php';
   /*var myurl = 'probando.php';*/
  
    myRand = parseInt(Math.random()*999999999999999);
    // saltarse la cache
   
   var modurl = myurl+"?rand="+myRand;

   http.open("GET", modurl, true);
   http.onreadystatechange = useHttpResponseRedac;
   http.send(null);
}

function useHttpResponseRedac() {
	
	
   //Selecciona el div donde ira todo el contenido que se obtenga
   var redac = document.getElementById('servcontent');
   
   if (http.readyState == 4) {
	   if(http.status == 200) {
		 
		/*Mete en el div contenido, el contenido de la pagina consultada*/
	    redac.innerHTML = http.responseText;
	   }
	}
  else
  {
	  redac.innerHTML = '<img src="imagenes/cargando.gif" style="position:absolute;left:32%;top:80%;" />';
  }
}
