// JavaScript Document



// Funciones de inclusión de archivos Dinamicos a paginas html

var xmlHttp //

function showHeader()
{ 
    xmlHttp=GetXmlHttpObject()
      var param="../../plantillas_php/Header_Maya.php";// aqui es donde ustedes escriben donde se encuentra su header.
    if (xmlHttp==null)
      {
      alert ("Browser does not support HTTP Request")
      return
      }     
    xmlHttp.onreadystatechange=stateChanged //esto se manda a llamar mas abajo..
    xmlHttp.open("GET",param,true)
    xmlHttp.send(null)
    
}
function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
   document.getElementById("Header").innerHTML= xmlHttp.responseText // en donde dice header deben poner el id del span donde quieren que su pagina lo muestre.
 } 
}
//luego todo lo de arriba se repite pero con distintos nombres... esta funcion se llama showFree().. y muestra la columna de Free Downloads.
var xmlHttp2
function showfree(){
xmlHttp2=GetXmlHttpObject()
var free="../../plantillas_php/Free_Downloads_Maya.php";
    if (xmlHttp2==null)
      {
      alert ("Browser does not support HTTP Request")
      return
      }         
        xmlHttp2.onreadystatechange=stateChanged2 
        xmlHttp2.open("GET",free,true)
        xmlHttp2.send(null)
}

function stateChanged2() 
{ 
if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
 { 
  document.getElementById("free").innerHTML= xmlHttp2.responseText
 } 
}

var xmlHttp3
function showSurvey(){
var Survey="../../plantillas_php/Free_Survey_Maya.php";
xmlHttp3=GetXmlHttpObject()
if (xmlHttp3==null)
      {
      alert ("Browser does not support HTTP Request")
      return
      }       
      xmlHttp3.onreadystatechange=stateChanged3 
      xmlHttp3.open("GET",Survey,true)
      xmlHttp3.send(null)
}

function stateChanged3() 
{ 
 if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete")
 { 
   document.getElementById("Survey").innerHTML= xmlHttp3.responseText
 } 
}

var xmlHttp4
function showLink(){
xmlHttp4=GetXmlHttpObject()
var Link="../../plantillas_php/Links_Maya.php";
    if (xmlHttp4==null)
      {
      alert ("Browser does not support HTTP Request")
      return
      }         
        xmlHttp4.onreadystatechange=stateChanged4
        xmlHttp4.open("GET",Link,true)
        xmlHttp4.send(null)
}
function stateChanged4() 
{ 
if (xmlHttp4.readyState==4 || xmlHttp4.readyState=="complete")
 { 
   document.getElementById("Link").innerHTML= xmlHttp4.responseText
 } 
}

var xmlHttp5
function showFooter(){
xmlHttp5=GetXmlHttpObject()
var Footer="../../plantillas_php/Footer_Maya.php";
    if (xmlHttp5==null)
      {
      alert ("Browser does not support HTTP Request")
      return
      }         
        xmlHttp5.onreadystatechange=stateChanged5
        xmlHttp5.open("GET",Footer,true)
        xmlHttp5.send(null)
}
function stateChanged5() 
{ 
if (xmlHttp5.readyState==4 || xmlHttp5.readyState=="complete")
 { 
   document.getElementById("Footer").innerHTML= xmlHttp5.responseText
 } 
}

// el ID de la columna extra necesario para que a partir de estas funciones se agregue en el futuro una columna extra es: columna-extra
// el nombre de la función que he colocado para activarlo en el html es showExtra().

/*var xmlHttp6
function showExtra()
{
	xmlHttp6=GetXmlHttpObject()
		var extra="../../plantillas_php/Free_Downloads_Maya_EthnoBotany.php";
    if (xmlHttp6==null)
      {
      alert ("Browser does not support HTTP Request")
      return
      }         
        xmlHttp6.onreadystatechange=stateChanged6
        xmlHttp6.open("GET",extra,true)
        xmlHttp6.send(null)
}
function stateChanged6() 
{ 
if (xmlHttp6.readyState==4 || xmlHttp6.readyState=="complete")
 { 
   document.getElementById("columnaextra").innerHTML= xmlHttp6.responseText
 } 
}*/

//

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest()
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
 }
return xmlHttp
}







//

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// 2da función creo que esta ya es obsoleta

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
