 function boton(a,modo) { 
  if ( modo==1 ) eval("c"+a+".style.backgroundColor='#800000'");
  if ( modo==0 ) eval("c"+a+".style.backgroundColor='#FFFFFF'");
   } 
 function ver_ayuda(lyr) { document.all[lyr].style.visibility="visible"; } 
 function ocultar_ayuda(lyr) { document.all[lyr].style.visibility="hidden"; }
 function ver_export(lyr) { document.all[lyr].style.visibility="visible"; }
 function ocultar_export(lyr) { document.all[lyr].style.visibility="hidden";  }
 function valido(){
     var uno=document.forms['p32_2'].elements['p32_2:niv1'].value;
     var dos=document.forms['p32_2'].elements['p32_2:niv2'].value;
     var OK=1;
     if ( uno==0 || dos==0 ){
         alert("Es obligatorio seleccionar algún nivel de agregado o nivel desagregado"); 
         OK=0; 
     }
     if ( (uno  > dos) && OK ) { 
         alert("El nivel más agregado debe ser inferior o igual al nivel más desagregado"); 
         OK=0; 
     }
      if(OK) return true;
      else return false;
 }
 function validar(){
     var Opcion_uno=document.forms['p4_5'].elements['p4_5:op1'].value;
     var Opcion_dos=document.forms['p4_5'].elements['p4_5:op2'].value;
     var niv1=document.forms['p4_5'].elements['p4_5:niv1'].value;
     var niv2=document.forms['p4_5'].elements['p4_5:niv2'].value;
     var OK=1;
     
     if ( Opcion_uno==0 && OK==1 ){
         alert("Es obligatorio seleccionar alguna Clasificación Origen"); 
         OK=0; 
     }
     if ( niv1==0 && OK==1){
         alert("Es obligatorio seleccionar Nivel Origen"); 
         OK=0; 
     }
     if ( Opcion_dos==0 && OK==1){
         alert("Es obligatorio seleccionar alguna Clasificación Destino"); 
         OK=0; 
     } 
     if ( niv2==0 && OK==1){
         alert("Es obligatorio seleccionar Nivel Destino"); 
         OK=0; 
     } 
     
      if(OK){ 
           document.forms['p4_5'].elements['p4_5_SUBMIT'].value=1;
           return true; 
      } else {  
           document.forms['p4_5'].elements['p4_5_SUBMIT'].value=0;
           return false; 
      }    
 }
 function start_ayuda(lyr) {
          var Xposi=0;
          var Yposi=0;
          var IE = navigator.appName;
         
          Xposi = document.getElementById('cajaAyuda').offsetLeft; 
          Yposi = document.getElementById('cajaAyuda').offsetTop;	
          if (IE=="Netscape") {
                Yposi=Yposi+168; 
                Xposi=Xposi+6;
                eval("document.all.ayuda.style.left='"+Xposi+"px'");
                eval("document.all.ayuda.style.top='"+Yposi+"px'");
                /*document.all.ayuda.style.top='177px';  */
          } else {
                Yposi=Yposi+178; 
                Xposi=Xposi+6;
                eval("document.all.ayuda.style.left='"+Xposi+"px'");
                eval("document.all.ayuda.style.top='"+Yposi+"px'"); 
                /* document.all.ayuda.style.top='190px'; */ 
           }
            document.all[lyr].style.visibility="visible";   
 }
 function start_imprime(lyr) {
          var Xpos=0;
          var IE = navigator.appName;
          var Xpos = document.getElementById("cajaImpre").offsetLeft+8; 
          document.all[lyr].style.visibility="visible";        
          if (IE=="Netscape") {
              eval("document.all.impre.style.left='"+Xpos+"px'");
              document.all.impre.style.top='89px';  
          } else {
              eval("document.all.impre.style.left='"+Xpos+"px'");
              document.all.impre.style.top='99px';  
           }
 }
 
function cerrar(){
  alert("cerrar");
  self.window.close();
  return true;
}
function cambiar_color_over(celda){ 
   celda.style.backgroundColor="#66ff33" 
} 
function cambiar_color_out(celda){ 
   celda.style.backgroundColor="#dddddd" 
} 
