        var ii=0;
        var jj=0;
        var eventoControlado = false;
        window.onload = function(){document.onkeypress = cambioIm;}
        function cambioIm(evObject){
           var chr = String.fromCharCode(evObject.which);
           if(chr=="q"){
              var rx=getRI(ii)-1
              var qw=getR(rx)
              if(qw!=-1){ii=qw;show();}}
           else if(chr=="a"){
              var rx=getRI(ii)+1
              var qw=getR(rx)
              if(qw!=-1){ii=qw;show();}}
           else if(chr=="o"){
              if(0<jj){jj-=1; show();}}
           else if(chr=="p"){
              if(jj<3){jj+=1; show();}}
           else if(chr=="w"){
              var tag=document.getElementById('largeImg');
              tag.width =  tag.width *1.1;
              tag.height = tag.height*1.1;}
           else if(chr=="s"){
              var tag=document.getElementById('largeImg');
              tag.width =  tag.width /1.1;
              tag.height = tag.height/1.1;}
           eventoControlado=true;}
        function showImage(rr,cc) {
           ii=rr;
           jj=cc;
           show(ii,jj);}
        function show() {
           console.log(ii,jj)
           document.getElementById('largeImg').src = getF(ii,jj);
           document.getElementById('largeImgText').innerHTML = getT(ii,jj);
           document.getElementById('largeImgPanel').style.visibility = 'visible';
           if(document.selection) document.selection.empty();
           if(window.getSelection) window.getSelection().removeAllRanges();}
        function hideMe(obj) {
           obj.style.visibility = 'hidden';}
        function getRI(iii){
           var res=-1
           for(k=0;k<100;k++){
               if(iii==getR(k)){res=k;}}
           return res;}
        function includeHTML(){
           /*loop through a collection of all HTML elements: https://www.w3schools.com/howto/howto_html_include.asp*/
           var z, i, elmnt, file, xhttp;
           z = document.getElementsByTagName("*");
           for(i=0;i<z.length;i++){
               elmnt = z[i];
               /*search for elements with a certain atrribute:*/
               file = elmnt.getAttribute("w3-include-html");
               if (file) {
                  /*make an HTTP request using the attribute value as the file name:*/
                  xhttp = new XMLHttpRequest();
                  xhttp.onreadystatechange = function() {
                          if (this.readyState == 4) {
                             if (this.status == 200) {elmnt.innerHTML = this.responseText;}
                             if (this.status == 404) {elmnt.innerHTML = "Page not found.";}
                             /*remove the attribute, and call this function once more:*/
                             elmnt.removeAttribute("w3-include-html");
                             includeHTML();}}
                  xhttp.open("GET", file, true);
                  xhttp.send();
                  return;}}}
        function getF(rr,cc){
       if(rr==1 && cc==0){return 'cl0_tz_500.png';}
       if(rr==1 && cc==1){return 'cl1_tz_500.png';}
       if(rr==1 && cc==2){return 'cl2_tz_500.png';}
       if(rr==1 && cc==3){return 'cl3_tz_500.png';}
       if(rr==8 && cc==0){return 'cl0_t850_pnm_SIN.png';}
       if(rr==8 && cc==1){return 'cl1_t850_pnm_SIN.png';}
       if(rr==8 && cc==2){return 'cl2_t850_pnm_SIN.png';}
       if(rr==8 && cc==3){return 'cl3_t850_pnm_SIN.png';}
       if(rr==18 && cc==0){return '../../PCP/018/prob_tp_thr1_cl0.png';}
       if(rr==18 && cc==1){return '../../PCP/018/prob_tp_thr1_cl1.png';}
       if(rr==18 && cc==2){return '../../PCP/018/prob_tp_thr1_cl2.png';}
       if(rr==18 && cc==3){return '../../PCP/018/prob_tp_thr1_cl3.png';}
       if(rr==24 && cc==0){return '../../NIE/018/prob_sf_thr1_cl0.png';}
       if(rr==24 && cc==1){return '../../NIE/018/prob_sf_thr1_cl1.png';}
       if(rr==24 && cc==2){return '../../NIE/018/prob_sf_thr1_cl2.png';}
       if(rr==24 && cc==3){return '../../NIE/018/prob_sf_thr1_cl3.png';}
       if(rr==44 && cc==0){return 'stdev_z_500_cl0.png';}
       if(rr==44 && cc==1){return 'stdev_z_500_cl1.png';}
       if(rr==44 && cc==2){return 'stdev_z_500_cl2.png';}
       if(rr==44 && cc==3){return 'stdev_z_500_cl3.png';}
       if(rr==45 && cc==0){return 'spag_msl_0_cl0.png';}
       if(rr==45 && cc==1){return 'spag_msl_0_cl1.png';}
       if(rr==45 && cc==2){return 'spag_msl_0_cl2.png';}
       if(rr==45 && cc==3){return 'spag_msl_0_cl3.png';}
}
        function getT(rr,cc){
       if(rr==1 && cc==0){return '<strong>Temperatura (C) y Altura Geopotencial (m) en 500 hPa</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br><strong>control +<br>EPS</strong>';}
       if(rr==1 && cc==1){return '<strong>Temperatura (C) y Altura Geopotencial (m) en 500 hPa</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>1</strong> representante: <strong>49</strong> miembros: 20 <strong>control</strong><br>0,1,3,6,8,13,15,16,21,26,27,28,31,32,34,40,43,45,47,49';}
       if(rr==1 && cc==2){return '<strong>Temperatura (C) y Altura Geopotencial (m) en 500 hPa</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>2</strong> representante: <strong>19</strong> miembros: 18 <br>4,11,12,17,19,24,25,29,33,35,36,37,38,39,41,44,46,50';}
       if(rr==1 && cc==3){return '<strong>Temperatura (C) y Altura Geopotencial (m) en 500 hPa</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>3</strong> representante: <strong>14</strong> miembros: 13 <br>2,5,7,9,10,14,18,20,22,23,30,42,48';}
       if(rr==8 && cc==0){return '<strong>Temperatura en 850 hPa (C) y Presion en Superficie (hPa)</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br><strong>control +<br>EPS</strong>';}
       if(rr==8 && cc==1){return '<strong>Temperatura en 850 hPa (C) y Presion en Superficie (hPa)</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>1</strong> representante: <strong>49</strong> miembros: 20 <strong>control</strong><br>0,1,3,6,8,13,15,16,21,26,27,28,31,32,34,40,43,45,47,49';}
       if(rr==8 && cc==2){return '<strong>Temperatura en 850 hPa (C) y Presion en Superficie (hPa)</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>2</strong> representante: <strong>19</strong> miembros: 18 <br>4,11,12,17,19,24,25,29,33,35,36,37,38,39,41,44,46,50';}
       if(rr==8 && cc==3){return '<strong>Temperatura en 850 hPa (C) y Presion en Superficie (hPa)</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>3</strong> representante: <strong>14</strong> miembros: 13 <br>2,5,7,9,10,14,18,20,22,23,30,42,48';}
       if(rr==18 && cc==0){return '<strong>Probabilidad de precipitacion de 0 a 24 UTC superior a 1 mm</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br><strong>control +<br>EPS</strong>';}
       if(rr==18 && cc==1){return '<strong>Probabilidad de precipitacion de 0 a 24 UTC superior a 1 mm</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>1</strong> representante: <strong>49</strong> miembros: 20 <strong>control</strong><br>0,1,3,6,8,13,15,16,21,26,27,28,31,32,34,40,43,45,47,49';}
       if(rr==18 && cc==2){return '<strong>Probabilidad de precipitacion de 0 a 24 UTC superior a 1 mm</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>2</strong> representante: <strong>19</strong> miembros: 18 <br>4,11,12,17,19,24,25,29,33,35,36,37,38,39,41,44,46,50';}
       if(rr==18 && cc==3){return '<strong>Probabilidad de precipitacion de 0 a 24 UTC superior a 1 mm</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>3</strong> representante: <strong>14</strong> miembros: 13 <br>2,5,7,9,10,14,18,20,22,23,30,42,48';}
       if(rr==24 && cc==0){return '<strong>Probabilidad de nieve acumulada de 0 a 24 UTC superior a 1 mm de agua equivalente</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br><strong>control +<br>EPS</strong>';}
       if(rr==24 && cc==1){return '<strong>Probabilidad de nieve acumulada de 0 a 24 UTC superior a 1 mm de agua equivalente</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>1</strong> representante: <strong>49</strong> miembros: 20 <strong>control</strong><br>0,1,3,6,8,13,15,16,21,26,27,28,31,32,34,40,43,45,47,49';}
       if(rr==24 && cc==2){return '<strong>Probabilidad de nieve acumulada de 0 a 24 UTC superior a 1 mm de agua equivalente</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>2</strong> representante: <strong>19</strong> miembros: 18 <br>4,11,12,17,19,24,25,29,33,35,36,37,38,39,41,44,46,50';}
       if(rr==24 && cc==3){return '<strong>Probabilidad de nieve acumulada de 0 a 24 UTC superior a 1 mm de agua equivalente</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>3</strong> representante: <strong>14</strong> miembros: 13 <br>2,5,7,9,10,14,18,20,22,23,30,42,48';}
       if(rr==44 && cc==0){return '<strong>Desviacion estandar e isohipsas de altura geopotencial (m) en 500 hPa</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br><strong>control +<br>EPS</strong>';}
       if(rr==44 && cc==1){return '<strong>Desviacion estandar e isohipsas de altura geopotencial (m) en 500 hPa</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>1</strong> representante: <strong>49</strong> miembros: 20 <strong>control</strong><br>0,1,3,6,8,13,15,16,21,26,27,28,31,32,34,40,43,45,47,49';}
       if(rr==44 && cc==2){return '<strong>Desviacion estandar e isohipsas de altura geopotencial (m) en 500 hPa</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>2</strong> representante: <strong>19</strong> miembros: 18 <br>4,11,12,17,19,24,25,29,33,35,36,37,38,39,41,44,46,50';}
       if(rr==44 && cc==3){return '<strong>Desviacion estandar e isohipsas de altura geopotencial (m) en 500 hPa</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>3</strong> representante: <strong>14</strong> miembros: 13 <br>2,5,7,9,10,14,18,20,22,23,30,42,48';}
       if(rr==45 && cc==0){return '<strong>Spaguetti de presion en superficie (hPa)</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br><strong>control +<br>EPS</strong>';}
       if(rr==45 && cc==1){return '<strong>Spaguetti de presion en superficie (hPa)</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>1</strong> representante: <strong>49</strong> miembros: 20 <strong>control</strong><br>0,1,3,6,8,13,15,16,21,26,27,28,31,32,34,40,43,45,47,49';}
       if(rr==45 && cc==2){return '<strong>Spaguetti de presion en superficie (hPa)</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>2</strong> representante: <strong>19</strong> miembros: 18 <br>4,11,12,17,19,24,25,29,33,35,36,37,38,39,41,44,46,50';}
       if(rr==45 && cc==3){return '<strong>Spaguetti de presion en superficie (hPa)</strong><br><br><strong>20260505 a 12</strong> UTC HH+018 (rango:012-024)<br>grupo: <strong>3</strong> representante: <strong>14</strong> miembros: 13 <br>2,5,7,9,10,14,18,20,22,23,30,42,48';}
}
        function getR(rrw){
           cx=0;
       cx+=1;
       if(rrw==cx){return 1;}
       cx+=1;
       if(rrw==cx){return 8;}
       cx+=1;
       if(rrw==cx){return 18;}
       cx+=1;
       if(rrw==cx){return 24;}
       cx+=1;
       if(rrw==cx){return 44;}
       cx+=1;
       if(rrw==cx){return 45;}
return -1;}
