var count=0;
var aImageSources =new Array("PlantaSur01.png","PlantaSur02.png","PlantaSur03.png","PlantaSur04.png","PlantaSur05.png");
var aImageSourcesT =new Array("TransInf01.png","TransInf02.png","TransInf03.png","TransInf04.png","TransInf05.png");
function cargarNoticias(){   
    
    doAjax('controladorNoticias.php','','mostrarNoticias','get',0);
}
function cambiarImagen(){
         var obj = document.getElementById('imagenProyecto1');
         var obj2 = document.getElementById('imagenProyecto2');
         obj.src ="imagenes/"+aImageSources[count];
         obj2.src ="imagenes/"+aImageSourcesT[count];
        count++;
    if(count==5){
        count=0;
    }    
  setTimeout(cambiarImagen, 4000);
}

function  icoVinetaOn(link,obj){   
    obj.src ="imagenes/vineta_color.png";
    link.style.color="#ffffff";    
}
function  icoVinetaOff(link,obj){
    obj.src ="imagenes/vineta_gray.png";    
    link.style.color="#A3A3A3";
}

function  icoMatOn(){
    var objMat = document.getElementById('sociosMat');
    objMat.src ="imagenes/MAT.png";
}
function  icoMatOff(){
    var objMat = document.getElementById('sociosMat');
    objMat.src ="imagenes/MAT_gris.png";
}

function  icoCorpOn(){
    var objMat = document.getElementById('sociosCorp');
    objMat.src ="imagenes/CORPOZULIA.png";
}
function  icoCorpOff(){
    var objMat = document.getElementById('sociosCorp');
    objMat.src ="imagenes/CORPOZULIA_gris.png";
}
function  icoHidroOn(){
    var objMat = document.getElementById('sociosHidro');
    objMat.src ="imagenes/HIDROLAGO.png";
}
function  icoHidroOff(){
    var objMat = document.getElementById('sociosHidro');
    objMat.src ="imagenes/HIDROLAGO_gris.png";
}
function  icoIclamOn(){
    var objIcla = document.getElementById('sociosIcla');
    objIcla.src ="imagenes/ICLAM.png";
}
function  icoIclamOff(){
    var objIcla  = document.getElementById('sociosIcla');
    objIcla.src ="imagenes/ICLAM_gris.png";
}
function  icoMarOn(){
    var objMar = document.getElementById('sociosMar');
    objMar.src ="imagenes/MARN.png";
}
function  icoMarOff(){
    var objMar  = document.getElementById('sociosMar');
    objMar.src ="imagenes/MARN_gris.png";
}
function  icoGoberOn(){
    var objGober = document.getElementById('sociosGobernacion');
    objGober.src ="imagenes/GOBERNACION.png";
}
function  icoGoberOff(){
    var objGober   = document.getElementById('sociosGobernacion');
    objGober.src ="imagenes/GOBERNACION_gris.png";
}

function  icoOff(){
    var obj   = document.getElementById('sociosGobernacion');
    obj.src ="imagenes/GOBERNACION_gris.png";
    obj  = document.getElementById('sociosMar');
    obj.src ="imagenes/MARN_gris.png";
    obj  = document.getElementById('sociosIcla');
    obj.src ="imagenes/ICLAM_gris.png";
    obj = document.getElementById('sociosHidro');
    obj.src ="imagenes/HIDROLAGO_gris.png";
    obj = document.getElementById('sociosCorp');
    obj.src ="imagenes/CORPOZULIA_gris.png";
    obj = document.getElementById('sociosMat');
    obj.src ="imagenes/MAT_gris.png";


}
function dias(){
    var fechas=new Date();
    var cntC ="lunes";
    var notLunes = document.getElementById('container');
    var otxtLun = document.createTextNode('Lunes, 12'+' de Mayo de ' + fechas.getFullYear());
    notLunes.appendChild(otxtLun);
    /////////// del primer dia del lunes    
    var otxCuerpoLun = document.createElement('p');
    otxCuerpoLun.innerHTML="Trabajo de aporte social en el Proyecto Planta Sur";
    otxCuerpoLun.className= "notCuerpo0";
    notLunes.appendChild(otxCuerpoLun);       
    var oLinkVerLun = document.createElement('a');
    oLinkVerLun.setAttribute("href", "text.html");
    oLinkVerLun.innerHTML="(ver)";
    oLinkVerLun.className= "linkNoticias";
    otxCuerpoLun.appendChild(oLinkVerLun);
    

        /////////// del segundo dia del lunes
       otxCuerpoLun = document.createElement('p');
       otxCuerpoLun.innerHTML="Se realizó un Mercal con el propósito de servir a la comunidad del sector Sierra Maestra. ";
       otxCuerpoLun.className= "notCuerpo1";
       notLunes.appendChild(otxCuerpoLun);
       oLinkVerLun = document.createElement('a');
       oLinkVerLun.setAttribute("href", "noticiasLun"+1+".php")
       oLinkVerLun.innerHTML="(ver)";
       oLinkVerLun.className= "linkNoticias";
       otxCuerpoLun.appendChild(oLinkVerLun);

           /////////// del tercer dia del lunes
       otxCuerpoLun = document.createElement('p');
       otxCuerpoLun.innerHTML="Visita del Vice-Ministro de agricultura";
       otxCuerpoLun.className= "notCuerpo2";
       notLunes.appendChild(otxCuerpoLun);
       oLinkVerLun = document.createElement('a');
       oLinkVerLun.setAttribute("href", "noticiasLun"+2+".php")
       oLinkVerLun.innerHTML="(ver)";
       oLinkVerLun.className= "linkNoticias";
       otxCuerpoLun.appendChild(oLinkVerLun);
       
       var notMartes= document.getElementById('notMartes');
       var otxtMart = document.createTextNode('Martes, 13'+' de Mayo de ' + fechas.getFullYear());
       notMartes.appendChild(otxtMart);
       
       //// primer dia del martes
       var otxCuerpoMar = document.createElement('p');
       otxCuerpoMar.innerHTML="Cultivo de 200 ha bajo de riego en proyecto El Diluvio-Palmar";
       notMartes.appendChild(otxCuerpoMar);
       otxCuerpoMar.className= "notCuerpo0";
       var oLinkVerMar = document.createElement('a');
       oLinkVerMar.setAttribute("href", "noticiasMar"+0+".php");
       oLinkVerMar.innerHTML="(ver)";
       oLinkVerMar.className= "linkNoticias";
       otxCuerpoMar.appendChild(oLinkVerMar);
       //// segundo dia del martes
       otxCuerpoMar = document.createElement('p');
       otxCuerpoMar.innerHTML="Auditoria Interna de Calidad";
       notMartes.appendChild(otxCuerpoMar);
       otxCuerpoMar.className= "notCuerpo1";
       oLinkVerMar = document.createElement('a');
       oLinkVerMar.setAttribute("href", "noticiasMar"+1+".php");
       oLinkVerMar.innerHTML="(ver)";
       oLinkVerMar.className= "linkNoticias";
       otxCuerpoMar.appendChild(oLinkVerMar);
       //// tercer dia del martes
       otxCuerpoMar = document.createElement('p');
       otxCuerpoMar.innerHTML="Auditoria Interna de Calidad";
       notMartes.appendChild(otxCuerpoMar);
       otxCuerpoMar.className= "notCuerpo2";
       oLinkVerMar = document.createElement('a');
       oLinkVerMar.setAttribute("href", "noticiasMar"+2+".php");
       oLinkVerMar.innerHTML="(ver)";
       oLinkVerMar.className= "linkNoticias";
       otxCuerpoMar.appendChild(oLinkVerMar);

       var notMiercoles= document.getElementById('notMiercoles');
       var otxtMier = document.createTextNode('Miercoles, 14'+' de Mayo de ' + fechas.getFullYear());
       notMiercoles.appendChild(otxtMier);
       //// primer dia del miercoles
       var otxCuerpoMier = document.createElement('p');
       otxCuerpoMier.innerHTML="Finalizadas actividades en parcela demostrativa del proyecto Planta Sur";
       notMiercoles.appendChild(otxCuerpoMier);
       otxCuerpoMier.className= "notCuerpo0";
       var oLinkVerMier= document.createElement('a');
       oLinkVerMier.setAttribute("href", "noticiaMiers"+0+".php");
       oLinkVerMier.innerHTML="(ver)";
       oLinkVerMier.className= "linkNoticias";
       otxCuerpoMier.appendChild(oLinkVerMier);
       //// segundo dia del miercoles
       otxCuerpoMier = document.createElement('p');
       otxCuerpoMier.innerHTML="Inducción en uso del SIAC a alcaldia Simón Bolivar";
       notMiercoles.appendChild(otxCuerpoMier);
       otxCuerpoMier.className= "notCuerpo1";
       oLinkVerMier= document.createElement('a');
       oLinkVerMier.setAttribute("href", "noticiaMiers"+1+".php");
       oLinkVerMier.innerHTML="(ver)";
       oLinkVerMier.className= "linkNoticias";
       otxCuerpoMier.appendChild(oLinkVerMier);
       //// tercer dia del miercoles
       otxCuerpoMier = document.createElement('p');
       otxCuerpoMier.innerHTML="Realizada jornada de aporte social en proyecto Planta Sur";
       notMiercoles.appendChild(otxCuerpoMier);
       otxCuerpoMier.className= "notCuerpo2";
       oLinkVerMier= document.createElement('a');
       oLinkVerMier.setAttribute("href", "noticiaMiers"+2+".php");
       oLinkVerMier.innerHTML="(ver)";
       oLinkVerMier.className= "linkNoticias";
       otxCuerpoMier.appendChild(oLinkVerMier);

       var notJueves= document.getElementById('notJueves');
       var otxtJuev = document.createTextNode('Jueves, 16'+' de Mayo de ' + fechas.getFullYear());
       notJueves.appendChild(otxtJuev);

       //// primer dia del jueves
       var otxCuerpoJue= document.createElement('p');
       otxCuerpoJue.innerHTML="Liberado Módulo Transaccional del SIAC";
       notJueves.appendChild(otxCuerpoJue);
       otxCuerpoJue.className= "notCuerpo0";
       var oLinkVerJue = document.createElement('a');
       oLinkVerJue.setAttribute("href", "noticiasJue"+0+".php");
       oLinkVerJue.innerHTML="(ver)";
       oLinkVerJue.className= "linkNoticias";
       otxCuerpoJue.appendChild(oLinkVerJue);
       //// segundo dia del jueves
       otxCuerpoJue= document.createElement('p');
       otxCuerpoJue.innerHTML="Reunión con Alcaldia de Baralt";
       notJueves.appendChild(otxCuerpoJue);
       otxCuerpoJue.className= "notCuerpo0";
       oLinkVerJue = document.createElement('a');
       oLinkVerJue.setAttribute("href", "noticiasJue"+1+".php");
       oLinkVerJue.innerHTML="(ver)";
       oLinkVerJue.className= "linkNoticias";
       otxCuerpoJue.appendChild(oLinkVerJue);
       //// tercer dia del jueves
       otxCuerpoJue= document.createElement('p');
       otxCuerpoJue.innerHTML="Inicio de cursos de Inducción a Software Libre";
       notJueves.appendChild(otxCuerpoJue);
       otxCuerpoJue.className= "notCuerpo2";
       oLinkVerJue = document.createElement('a');
       oLinkVerJue.setAttribute("href", "noticiasJue"+2+".php");
       oLinkVerJue.innerHTML="(ver)";
       oLinkVerJue.className= "linkNoticias";
       otxCuerpoJue.appendChild(oLinkVerJue);

       var notViernes= document.getElementById('notViernes');
       var otxtVier = document.createTextNode('Viernes, 18'+' de Mayo de ' + fechas.getFullYear());
       notViernes.appendChild(otxtVier);
       //// primer dia del viernes
       var otxCuerpoVie= document.createElement('p');
       otxCuerpoVie.appendChild(document.createTextNode("Instaladas séis estaciones meteorológicas en municipios del estado Zulia"));
       notViernes.appendChild(otxCuerpoVie);
       var oLinkVerVie= document.createElement('a');
       oLinkVerVie.setAttribute("href", "noticiasVie"+0+".php");
       oLinkVerVie.innerHTML="(ver)";
       oLinkVerVie.className= "linkNoticias";
       otxCuerpoVie.appendChild(oLinkVerVie);
       otxCuerpoVie.className= "notCuerpo0";
               //// segundo dia del viernes
       otxCuerpoVie= document.createElement('p');
       otxCuerpoVie.appendChild(document.createTextNode("falta"));
       notViernes.appendChild(otxCuerpoVie);
       oLinkVerVie= document.createElement('a');
       oLinkVerVie.setAttribute("href", "noticiasVie"+1+".php");
       oLinkVerVie.innerHTML="(ver)";
       oLinkVerVie.className= "linkNoticias";
       otxCuerpoVie.appendChild(oLinkVerVie);
       otxCuerpoVie.className= "notCuerpo1";
       //// tercer dia del viernes
       otxCuerpoVie= document.createElement('p');
       otxCuerpoVie.appendChild(document.createTextNode("falta"));
       notViernes.appendChild(otxCuerpoVie);
       oLinkVerVie= document.createElement('a');
       oLinkVerVie.setAttribute("href", "noticiasVie"+2+".php");
       oLinkVerVie.innerHTML="(ver)";
       oLinkVerVie.className= "linkNoticias";
       otxCuerpoVie.appendChild(oLinkVerVie);
       otxCuerpoVie.className= "notCuerpo2";
}
function mostrarNoticias(resp){    
    var fechas=new Date();   
    var oNoticias = JSON.parse(resp);  
    var lrgC =oNoticias.diaSem['lunes'].dias.length;

    //------------ titulo del mensajes del Dia Lunes -----------------
    var cntC =oNoticias.diaSem['lunes'];
    var notLunes = document.getElementById('notLunes');
    var otxtLun = document.createTextNode('Lunes, '+ cntC.dias[0]+' de '+ cntC.mes[0] + ' de ' + fechas.getFullYear());
    notLunes.appendChild(otxtLun);
    //------------ Cuerpo del mensajes del Dia Lunes ------------------------
    for(var i=0;i<lrgC;i++ ){
       var otxCuerpoLun = document.createElement('p');
       otxCuerpoLun.innerHTML=cntC.descripcion[i]
       otxCuerpoLun.className= "notCuerpo"+i;
       notLunes.appendChild(otxCuerpoLun);
       var oLinkVerLun = document.createElement('a');
       oLinkVerLun.setAttribute("href", "noticiasLun"+i+".php")
       oLinkVerLun.innerHTML="(ver)";
       oLinkVerLun.className= "linkNoticias";
       otxCuerpoLun.appendChild(oLinkVerLun); 
   }// fin del cuerpo de noticias del dia lunes
   
   cntC =oNoticias.diaSem['martes'];
   lrgC =oNoticias.diaSem['martes'].dias.length;    
   //------------ titulo del mensajes del Dia Martes -----------------
   var notMartes= document.getElementById('notMartes');
   var otxtMart = document.createTextNode('Martes, '+ cntC.dias[0]+' de '+ cntC.mes[0] + ' de ' + fechas.getFullYear());
   notMartes.appendChild(otxtMart);
   //------------ Cuerpo del mensajes del Dia Martes ------------------------
   for(var i=0;i<lrgC;i++ ){
      var otxCuerpoMar = document.createElement('p');
      otxCuerpoMar.innerHTML=cntC.descripcion[i]
      notMartes.appendChild(otxCuerpoMar);
      otxCuerpoMar.className= "notCuerpo"+i;
      var oLinkVerMar = document.createElement('a');
      oLinkVerMar.setAttribute("href", "noticiasMar"+i+".php");
      oLinkVerMar.innerHTML="(ver)";
      oLinkVerMar.className= "linkNoticias";
      otxCuerpoMar.appendChild(oLinkVerMar);   
   } // fin del cuerpo de noticias del martes   
   cntC =oNoticias.diaSem['miercoles'];
   lrgC =oNoticias.diaSem['miercoles'].dias.length;      
   //------------ titulo del mensajes del Dia Miercoles -----------------
   var notMiercoles= document.getElementById('notMiercoles');
   var otxtMier = document.createTextNode('Miercoles, '+ cntC.dias[0]+' de '+ cntC.mes[0] + ' de ' + fechas.getFullYear());
   notMiercoles.appendChild(otxtMier);
   //------------ Cuerpo del mensajes del Dia Miercoles ------------------------
   for(var i=0;i<lrgC;i++ ){
    var otxCuerpoMier = document.createElement('p');
    otxCuerpoMier.innerHTML=cntC.descripcion[i]
    notMiercoles.appendChild(otxCuerpoMier);
    otxCuerpoMier.className= "notCuerpo"+i;
    var oLinkVerMier= document.createElement('a');
    oLinkVerMier.setAttribute("href", "noticiaMiers"+i+".php");
    oLinkVerMier.innerHTML="(ver)";
    oLinkVerMier.className= "linkNoticias";
    otxCuerpoMier.appendChild(oLinkVerMier);   
   } // fin del cuerpo de noticias del jueves
   cntC =oNoticias.diaSem['jueves'];
   lrgC =oNoticias.diaSem['jueves'].dias.length;
   //------------ titulo del mensajes del Dia Jueves -----------------
   var notJueves= document.getElementById('notJueves');
   var otxtJuev = document.createTextNode('Jueves, '+ cntC.dias[0]+' de '+ cntC.mes[0] + ' de ' + fechas.getFullYear());
   notJueves.appendChild(otxtJuev);
   //------------ Cuerpo del mensajes del Dia Jueves ------------------------
   for(var i=0;i<lrgC;i++ ){
    var otxCuerpoJue= document.createElement('p');
   otxCuerpoJue.innerHTML=cntC.descripcion[i]
   notJueves.appendChild(otxCuerpoJue);
   otxCuerpoJue.className= "notCuerpo"+i;
   var oLinkVerJue = document.createElement('a');
   oLinkVerJue.setAttribute("href", "noticiasJue"+i+".php");
   oLinkVerJue.innerHTML="(ver)";
   oLinkVerJue.className= "linkNoticias";
   otxCuerpoJue.appendChild(oLinkVerJue);   
   }//fin del cuerpo de noticias del dia jueves
   cntC =oNoticias.diaSem['jueves'];
   lrgC =oNoticias.diaSem['jueves'].dias.length;
   //------------ titulo del mensajes del Dia Viernes -----------------
   var notViernes= document.getElementById('notViernes');
   var otxtVier = document.createTextNode('Viernes, '+ cntC.dias[0]+' de '+ cntC.mes[0] + ' de ' + fechas.getFullYear());
   notViernes.appendChild(otxtVier);
   //------------ Cuerpo del mensajes del Dia Viernes ------------------------
   var txt;
   for(var i=0;i<lrgC;i++ ){
    var otxCuerpoVie= document.createElement('p');    
    otxCuerpoVie.appendChild(document.createTextNode(cntC.descripcion[i]));
    notViernes.appendChild(otxCuerpoVie);    
    var oLinkVerVie= document.createElement('a');
    oLinkVerVie.setAttribute("href", "noticiasVie"+i+".php");
    oLinkVerVie.innerHTML="(ver)";
    oLinkVerVie.className= "linkNoticias";
    otxCuerpoVie.appendChild(oLinkVerVie);
    otxCuerpoVie.className= "notCuerpo"+i;
   
  }// fin del cuerpo del mensaje
}// fin de la funcion mostrar noticias




