/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 *  <a class="boton" id="inicio"
                       onmouseover="this.id='botonSel'"
                       onmouseout="this.id='inicio'"
                       href="index.html">
                       Inicio
                   </a>
 */

function btOver(){
    this.id="botonSel";
}

function btOut(){
    this.id="bton";
}

function btClick(){
   var http=getHttp();
   http.open('GET', this.firstChild.textContent+".html", true);
   http.send("");
   var contenido=document.getElementById("contenido");
   http.onreadystatechange=change;
   //alert(this.firstChild.textContent);

   function change(){
    if(http.readyState==4){
        contenido.innerHTML=http.responseText;
    }
   }
}
function getPG(pag){
   var http=getHttp();
   http.open('GET', pag, true);
   http.send("");
   var contenido=document.getElementById("contenido");
   http.onreadystatechange=change;
   //alert(this.firstChild.textContent);

   function change(){
    if(http.readyState==4){
        contenido.innerHTML=http.responseText;
    }
   }
}

function addBotones(){
   var botones=document.getElementById("bt");
   var listado=["Inicio","Actividad","Galeria","Personal"," Localización"];
   for(var i=0; i<listado.length;i++){
       var nextBoton=document.createElement("div");
       nextBoton.className="boton";
       nextBoton.id="bt"+i;
      /* nextBoton.name=listado[i];*/
       nextBoton.onmouseover=btOver;
       nextBoton.onmouseout=btOut;
       nextBoton.onclick=btClick;
       nextBoton.appendChild(document.createTextNode(listado[i]));
       botones.appendChild(nextBoton);

   }
}
