



function inicializarconocenos()
{ 
  
   cargaencabezado("barra.html");
   cargapiedepagina("piedepagina.html");
   cargapublicidad("propaganda.html");
   cargamenu("menu.html");
   Menu(Divconocenos, "conocenos");
   
   
  
    
}

function inicializardirectorio()
{ 
  
   cargaencabezado("barra.html");
   cargapiedepagina("piedepagina.html");
   cargapublicidad("propaganda.html");
   cargamenu("menu.html");
   Menu(Divdirectorio, 'directorio');
   
  
    
}


function inicializarsalud()
{ 
  
   cargaencabezado("barra.html");
   cargapiedepagina("piedepagina.html");
   cargapublicidad("propaganda.html");
   cargamenu("menu.html");
   Menu(Divsalud, 'salud');
   
  
    
}


function inicializarenlinea()
{ 
  
   cargaencabezado("barra.html");
   cargapiedepagina("piedepagina.html");
   cargapublicidad("propaganda.html");
   cargamenu("menu.html");
   Menu(Divenlinea, 'enlinea');
   
  
    
}


function inicializardepartamentos()
{ 
  
   cargaencabezado("barra.html");
   cargapiedepagina("piedepagina.html");
   cargapublicidad("propaganda.html");
   cargamenu("menu.html");
  
   
  
    
}

function inicializarpagina(f)
{ 
  
   cargaencabezado("barra.html");
   cargamenu("menu.html");
   cargapublicidad("propaganda.html"); 
   cargapiedepagina("contador.php");
  
    
}

function inicializacalendario(f)
{ 
  
   cargaencabezado("barra.html");
   cargamenu("menu.html");
   cargapublicidad("propaganda.html"); 
   cargapiedepagina("piedepagina.html");
   thisMonth();
  
    
}



var conex;
function busqueda(url) 
{
  if(url=='')
  {
    return;
  }
  conex=crearXMLHttpRequest();
  conex.onreadystatechange = procesarEventosdetallesB;
  conex.open("GET", url, true);
  conex.send(null);
  inicializacalendario(f);
   
}

function procesarEventosdetallesB()
{

  var detalles = document.getElementById("resultadoBusqueda");
  
  if(conex.readyState == 4)
  { 
    detalles.innerHTML = conex.responseText;
    
  } 
  else 
  {
    detalles.innerHTML = ' <img src="espera.gif" width="32" height="32">';
  }
}




var conexmail;
function enviamail(url) 
{
  if(url=='')
  {
    return;
  }
  conexmail=crearXMLHttpRequest();
  conexmail.onreadystatechange = procesarEventosdetallesmail;
  conexmail.open("GET", url, true);
  conexmail.send(null);
    
}

function procesarEventosdetallesmail()
{

  var detalles = document.getElementById("resultado");
  
  if(conexmail.readyState == 4)
  { 
    detalles.innerHTML = conexmail.responseText;
	document.getElementById("nombre").value = "";
	document.getElementById("correo").value = "";
	document.getElementById("direccion").value = "";
	document.getElementById("telefono").value = "";
	document.getElementById("texto").value = "";
    
  } 
  else 
  {
    detalles.innerHTML = ' <center><img src="espera.gif" width="32" height="32"></center>';
  }
}





var conexiones;
function detallespaginas(url) 
{
  if(url=='')
  {
    return;
  }
  conexiones=crearXMLHttpRequest();
  conexiones.onreadystatechange = procesarEventosdetalles;
  conexiones.open("GET", url, true);
  conexiones.send(null);

}

function procesarEventosdetalles()
{

  var detalles = document.getElementById("contenido");
  
  if(conexiones.readyState == 4)
  { 
    detalles.innerHTML = conexiones.responseText;
    
  } 
  else 
  {
    detalles.innerHTML = ' <img src="espera.gif" width="32" height="32">';
  }
}




var conexion;
function cunero(url) 
{
  if(url=='')
  {
    return;
  }
  conexion=crearXMLHttpRequest();
  conexion.onreadystatechange = procesarEventoscunero;
  conexion.open("GET", url, true);
  conexion.send(null);

}

function procesarEventoscunero()
{

  var detalles = document.getElementById("login");
  
  if(conexion.readyState == 4)
  { 
    detalles.innerHTML = conexion.responseText;
    
  } 
  else 
  {
    detalles.innerHTML = '<img src="espera.gif" width="32" height="32">';
  }
}




var conexioncunero;
function cambiafoto(url) 
{
  if(url=='')
  {
    return;
  }
  conexioncunero=crearXMLHttpRequest();
  conexioncunero.onreadystatechange = procesarEventoscunerofoto;
  conexioncunero.open("GET", url, true);
  conexioncunero.send(null);

}

function procesarEventoscunerofoto()
{

  var detalles = document.getElementById("foto");
  
  if(conexioncunero.readyState == 4)
  { 
    detalles.innerHTML = conexioncunero.responseText;
    
  } 
  else 
  {
    detalles.innerHTML = ' <img src="espera.gif" width="32" height="32">';
  }
}



















var conexion1;
function cargapagina(url) 
{
  if(url=='')
  {
    return;
  }
  conexion1=crearXMLHttpRequest();
  conexion1.onreadystatechange = procesarEventos;
  conexion1.open("GET", url, true);
  conexion1.send(null);

}

function procesarEventos()
{

  var detalles = document.getElementById("detalles");
  
  if(conexion1.readyState == 4)
  { 
    detalles.innerHTML = conexion1.responseText;
    
  } 
  else 
  {
    detalles.innerHTML = '<img src="espera.gif" width="32" height="32">';
  }
}






var conexion2;
function cargaencabezado(url) 
{
  if(url=='')
  {
    return;
  }
  conexion2=crearXMLHttpRequest();
  conexion2.onreadystatechange = procesarEventos2;
  conexion2.open("GET", url, true);
  conexion2.send(null);

}

function procesarEventos2()
{

  var detalles = document.getElementById("encabezado");
  
  if(conexion2.readyState == 4)
  { 
    detalles.innerHTML = conexion2.responseText;
    
  } 
  else 
  {
    detalles.innerHTML = ' <img src="espera.gif" width="32" height="32">';
  }
}


var conexion3;
function cargamenu(url) 
{
  if(url=='')
  {
    return;
  }
  conexion3=crearXMLHttpRequest();
  conexion3.onreadystatechange = procesarEventos3;
  conexion3.open("GET", url, true);
  conexion3.send(null);

}

function procesarEventos3()
{

  var detalles = document.getElementById("menu");
  
  if(conexion3.readyState == 4)
  { 
    detalles.innerHTML = conexion3.responseText;
 
 
  } 
  else 
  {
    detalles.innerHTML = '<img src="espera.gif" width="32" height="32">';
  }
}



var conexion4;
function cargapublicidad(url) 
{
  if(url=='')
  {
    return;
  }
  conexion4=crearXMLHttpRequest();
  conexion4.onreadystatechange = procesarEventos4;
  conexion4.open("GET", url, true);
  conexion4.send(null);

}

function procesarEventos4()
{

  var detalles = document.getElementById("propaganda");
  
  if(conexion4.readyState == 4)
  { 
    detalles.innerHTML = conexion4.responseText;
    
  } 
  else 
  {
    detalles.innerHTML = '<img src="espera.gif" width="32" height="32">';
  }
}


var conexion5;
function cargapiedepagina(url) 
{
  if(url=='')
  {
    return;
  }
  conexion5=crearXMLHttpRequest();
  conexion5.onreadystatechange = procesarEventos5;
  conexion5.open("GET", url, true);
  conexion5.send(null);

}

function procesarEventos5()
{

  var detalles = document.getElementById("piedepagina");
  
  if(conexion5.readyState == 4)
  { 
    detalles.innerHTML = conexion5.responseText;
    
  } 
  else 
  {
    detalles.innerHTML = '<img src="espera.gif" width="32" height="32">';
  }
}










function addEvent(elemento,nomevento,funcion,captura)
{
  if (elemento.attachEvent)
  {
    elemento.attachEvent('on'+nomevento,funcion);
    return true;
  }
  else  
    if (elemento.addEventListener)
    {
      elemento.addEventListener(nomevento,funcion,captura);
      return true;
alert("3333");
    }
    else
      return false;
}





function crearXMLHttpRequest() 
{
  var xmlHttp=null;
  if (window.ActiveXObject) 
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  else 
    if (window.XMLHttpRequest) 
      xmlHttp = new XMLHttpRequest();
  return xmlHttp;
}




<!-- funcion para cambiar el nombre a la capa para hacerla visible - ocultarla -->

function Menu(id_Div,nombre) {
	if(id_Div.className == nombre + "Oculto") { 
		id_Div.className = nombre + "Visible";

	} else {
		id_Div.className = nombre + "Oculto";
	}
}


function Menuconocenos(id_Div,nombre) {
	if(id_Div.className == nombre + "Oculto") { 
		id_Div.className = nombre + "Visible";
                Divdirectorio.className = "directorio" + "Oculto";
                Divsalud.className = "salud" + "Oculto";
                Divenlinea.className = "enlinea" + "Oculto";
                




	} else {
		id_Div.className = nombre + "Oculto";
	}
}


function Menudirectorios(id_Div,nombre) {
	if(id_Div.className == nombre + "Oculto") { 
		id_Div.className = nombre + "Visible";
                Divconocenos.className = "conocenos" + "Oculto";
                Divsalud.className = "salud" + "Oculto";
                Divenlinea.className = "enlinea" + "Oculto";
               




	} else {
		id_Div.className = nombre + "Oculto";
	}
}



function Menusalud(id_Div,nombre) {
	if(id_Div.className == nombre + "Oculto") { 
		id_Div.className = nombre + "Visible";
                Divconocenos.className = "conocenos" + "Oculto";
                Divdirectorio.className = "directorio" + "Oculto";
                Divenlinea.className = "enlinea" + "Oculto";
               




	} else {
		id_Div.className = nombre + "Oculto";
	}
}


function Menuenlinea(id_Div,nombre) {
	if(id_Div.className == nombre + "Oculto") { 
		id_Div.className = nombre + "Visible";
                Divconocenos.className = "conocenos" + "Oculto";
                Divdirectorio.className = "directorio" + "Oculto";
                Divsalud.className = "salud" + "Oculto";
               




	} else {
		id_Div.className = nombre + "Oculto";
	}
}


function Menudepartamentos(id_Div,nombre) {
	if(id_Div.className == nombre + "Oculto") { 
		id_Div.className = nombre + "Visible";
                Divconocenos.className = "conocenos" + "Oculto";
                Divdirectorio.className = "directorio" + "Oculto";
                Divsalud.className = "salud" + "Oculto";
                Divenlinea.className = "enlinea" + "Oculto";




	} else {
		id_Div.className = nombre + "Oculto";
	}
}

<!-- funcion para cambiar dimanicamente la imagen de los botones -->


function efecto(boton,imagen) {
  var boton_ = new Image();
  boton_.src = imagen;
  document.images[boton].src = boton_.src;
}  




var nav = (document.layers) ? true : false

function RatonArriba(Boton){
   if (!nav && Boton) Boton.style.backgroundColor="43c6db"
}


function RatonAfuera(Boton){
   if (!nav && Boton) Boton.style.backgroundColor="skyblue"
}


function EnviandoTexto(Boton){
   if (!nav && Boton) Boton.style.backgroundColor="pink"
}



function cunero(password,usuario){

if ( usuario == "cunero" && password == "123"){

cargapagina("/cgi-bin/cgiip.exe/WService=wsprueba/administradordecunero.r?opcion=consultar");

}

if (usuario != "cunero" ||password != "123"){
alert("Datos incorrectos");
}

}



function busquedaEsp(datos){
	busqueda("/cgi-bin/cgiip.exe/WService=wsprueba/resultadoBusquedaEsp.r?parametros=" + datos );
}

var conexion10;
function pdf(url){

  conexion10=crearXMLHttpRequest();
  conexion10.open("GET", url, true);
  conexion10.send(null);
}





function habilitaboton(valor){
alert(valor);
document.fotos.foto.disabled = false;
}



function habilitarCondicion1(){
 


if(document.formulario.nombre_checkbox.checked == true){

    document.formulario.nombre_checkbox.value = "true";
    
   

   
   
    document.formulario.foto.disabled = false;
    document.formulario.gfoto.disabled = false;
    document.formulario.id.disabled = false; 

}else{

    document.formulario.nombre_checkbox.value = "false";

   

    
    document.formulario.foto.disabled = true;
    document.formulario.gfoto.disabled = true;
    document.formulario.id.disabled = true; 

   

    
}

    }






function habilitarCondicion(){
 
  
   
    document.formulario.foto.disabled = false;
    document.formulario.gfoto.disabled = false;
    document.formulario.id.disabled = false; 



    }


function setDate(str) {

 if (str == "   ") {
  return;
 }

 mnth1 = document.forms[0].month.value;
 mnth = mnth1;
 mnth++;
 
 if (mnth < 10){
	 mnth = "0" + mnth;
 }
 
 if (str < 10){
	 str = "0" + str;
 }
 
 year = document.forms[0].year.value;
 dateStr = str+"/"+mnth+"/"+year;

 dateStr = trim(dateStr);
 
 document.forms[1].dateField.value = dateStr;


}//setDate()

/**
 * The function removes spaces from the selected date.
 */

function trim(str) {

 res="";

 for(var i=0; i< str.length; i++) {
   if (str.charAt(i) != " ") {
     res +=str.charAt(i);
  }
 }
   
 return res;

}//trim()
 
/**
 * The method to get the Month name given the Month number of the year.
 */

function getMonthName(mnth) {

 if (mnth == 0) {
  name = "Enero";
 }else if(mnth==1) {
  name = "Febrero";
 }else if(mnth==2) {
  name = "Marzo";
 }else if(mnth==3) {
  name = "Abril";
 }else if(mnth==4) {
  name = "Mayo";
 } else if(mnth==5) {
  name = "Junio";
 } else if(mnth==6) {
  name = "Julio";
 } else if(mnth==7) {
  name = "Agosto";
 } else if(mnth==8) {
  name = "Septiembre";
 } else if(mnth==9) {
  name = "Octubre";
 } else if(mnth==10) {
  name = "Noviembre";
 } else if(mnth==11) {
  name = "Diciembre";
 }

 return name;

}//getMonthName()

/**
 * Get the number of days in the month based on the year.
 */

function getNoOfDaysInMnth(mnth,yr) {
 
 rem = yr % 4;

 if(rem ==0) {
   leap = 1;
 } else {
  leap = 0;
 }

 noDays=0;

 if ( (mnth == 1) || (mnth == 3) || (mnth == 5) ||
      (mnth == 7) || (mnth == 8) || (mnth == 10) ||
      (mnth == 12)) {
  noDays=31;
 } else if (mnth == 2) {
           noDays=28+leap;
        } else {
           noDays=30;
 }

 //alert(noDays);
 return noDays;
 
      
}//getNoOfDaysInMnth()
  
/**
 * The function to reset the date values in the buttons of the 
 * slots.
 */

function fillDates(dayOfWeek1,noOfDaysInmnth) {

 for(var i=1; i<43; i++) {
   str = "s"+i;
   document.forms[0].elements[str].value="   ";
 }


 startSlotIndx = dayOfWeek1;
 slotIndx = startSlotIndx;

 for(var i=1; i<(noOfDaysInmnth+1); i++) {
  slotName = "s"+slotIndx;

  val="";
  if (i<10) {
    val = " "+i+" ";
  } else {
    val = i;
  }

  document.forms[0].elements[slotName].value = val;
  slotIndx++;
 }
  
}//fillDates()
 

/**
 * The function that is called at the time of loading the page.
 * This function displays Today's date and also displays the 
 * the calendar of the current month.
 */

function thisMonth() {

  dt = new Date();
  mnth  = dt.getMonth(); /* 0-11*/
  dayOfMnth = dt.getDate(); /* 1-31*/
  dayOfWeek = dt.getDay(); /*0-6*/
  yr = dt.getFullYear(); /*4-digit year*/

  //alert("month:"+(mnth+1)+":dayofMnth:"+dayOfMnth+":dayofweek:"+dayOfWeek+":year:"+yr);

  mnthName = getMonthName(mnth)+ " ";
  document.forms[0].month.value = mnth;
  document.forms[0].year.value = yr;
  document.forms[0].currMonth.value = mnth;
  document.forms[0].currYear.value = yr;
  
  document.forms[0].monthYear.value = mnthName+yr;
  document.forms[1].dateField.value = dayOfMnth+"/"+(mnth + 1)+"/"+yr;
 /* document.forms[1].dateField.value = "Día/Mes/Año"; */
  startStr = (mnth+1)+"/1/"+yr;
  
  dt1 = new Date(startStr);
  dayOfWeek1 = dt1.getDay(); /*0-6*/

  noOfDaysInMnth = getNoOfDaysInMnth(mnth+1,yr);
  fillDates(dayOfWeek1+1,noOfDaysInMnth);
 

}//thisMonth()

/**
 * The function that will be used to display the calendar of the next month.
 */

function nextMonth() {

 var currMnth = document.forms[0].month.value;
 currYr = document.forms[0].year.value;

 if (currMnth == "11") {
    nextMnth = 0;
    nextYr = currYr;
    nextYr++;
 } else {
   nextMnth=currMnth;
   nextMnth++;
   nextYr = currYr;
 }

 mnthName = getMonthName(nextMnth);
 document.forms[0].month.value=nextMnth;
 document.forms[0].year.value=nextYr;
 document.forms[0].monthYear.value= mnthName+" "+nextYr;

 str = (nextMnth+1)+"/1/"+nextYr;
 dt = new Date(str);
 dayOfWeek = dt.getDay();

 noOfDays = getNoOfDaysInMnth(nextMnth+1,nextYr);

 fillDates(dayOfWeek+1,noOfDays);
 

}//nextMonth()

/**
 * The method to display the calendar of the previous month.
 */

function prevMonth() {

 var currMnth = document.forms[0].month.value;
 currYr = document.forms[0].year.value;

 if (currMnth == "0") {
    prevMnth = 11;
    prevYr = currYr;
    prevYr--;
 } else {
   prevMnth=currMnth;
   prevMnth--;
   prevYr = currYr;
 }

 str = (prevMnth+1)+"/1/"+prevYr;
 dt = new Date(str);
 dayOfWeek = dt.getDay();

 /***********************************************
  * Remove the comment if do not want the user to 
  * go to any previous month than this current month.
  ***********************************************/

 /*

 runningMonth = document.forms[0].currMonth.value;
 rMonth=runningMonth;
 rMonth++;
 runningYear = document.forms[0].currYear.value;
 rYear=runningYear;

 str = (rMonth)+"/1/"+rYear;
 dt1 = new Date(str);
 
 if (dt.valueOf() < dt1.valueOf()) {
   alert('Cannot Go Before Current Month');
   return;
 }
 
 */

 /**************************************************
 * End of comment
 **************************************************/

 mnthName = getMonthName(prevMnth);
 document.forms[0].month.value=prevMnth;
 document.forms[0].year.value=prevYr;
 document.forms[0].monthYear.value= mnthName+" "+prevYr;

 noOfDays = getNoOfDaysInMnth(prevMnth+1,prevYr);
 fillDates(dayOfWeek+1,noOfDays);
 
}//prevMonth()



