// JavaScript Document Funciones Portal 27 de mayo




function tributos(ventana1) { 
window.open(ventana1,
'NuevaVentana',
'menubar=no,scrollbars=yes,'+ 'resizable=no,' +
'width=600,height=295,left=100,top=139' + 'toolbar=no,directories=no,status=no,scrollbars=no'); 
} 





function archivopdf(ventana2) { 
window.open(ventana2,
'NuevaVentana',
'menubar=no,scrollbars=yes,'+ 'resizable=yes,' +
'width=700,height=400,left=50,top=121' + 'toolbar=no,directories=no,status=no,scrollbars=yes'); 
} 





var win=null;
function popup(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
win.focus();}





function historialnoticias(ventana1) { 
window.open(ventana1,
'NuevaVentana',
'menubar=no,scrollbars=yes,'+ 'resizable=no,' +
'width=620,height=350,left=80,top=150' + 'toolbar=no,directories=no,status=no,scrollbars=yes'); 
} 





var before=""
var current=""
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function cuentaregresiva(yr,m,d){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy
var futurestring=montharray[m-1]+" "+d+", "+yr
var difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)
if (difference==0)
document.write(current)
else if (difference>0)
document.write(" "+difference+" "+before)
}

//Funciones que estaban antes en portal en el html

function AbrirVentana(documento) {
  window.open(documento,'NuevaVentana',
               'menubar=no,scrollbars=yes,' +'resizable=yes');
}
                      

function abrirVentanaBrowser(ventana) { 
window.open(ventana,
'NuevaVentana',
'menubar=yes,scrollbars=yes,'+ 'resizable=yes,' +
'width=800,height=600'); 
}


function abrirVentana(ventana) { 
window.open(ventana,
'NuevaVentana',
'menubar=no,scrollbars=yes,'+ 'resizable=yes,' +
'width=800,height=600'); 
} 
                 


     function abrirCertificado(ventana) {  
          window.open(ventana,
                      'NuevaVentana', 
                      'menubar=no,scrollbars=yes,'+                               'resizable=no,width=300,' +
                      'height=130');
     }
     function abrirRif(ventana) {  
          window.open(ventana,
                      'NuevaVentana',
                      'menubar=no,scrollbars=yes,'+                                'resizable=no,' +
                      'width=400,height=395');  
      }  
      function abrirPlanilla(ventana) {  
          window.open(ventana,
                      'NuevaVentana',
                      'menubar=no,scrollbars=yes,'+                                'resizable=yes,' +
                      'width=350,height=395');  
      }  
                  

var titulopordefecto = "Galeria de Imagenes";
var ventana;
var cont=0;

function afoto(cual,titulo)
{
if(cont==1){ventana.close();ventana=null}
if(titulo==null){titulo=titulopordefecto}
ventana=window.open('','ventana','resizable=yes,scrollbars=no')
ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" onUnload="opener.cont=0"><img src="' + cual + '" onLoad="opener.redimensionar(this.width, this.height)">');
ventana.document.close();
cont++;
}
function redimensionar(ancho, alto)
{
ventana.resizeTo(ancho+12,alto+28);
ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2);
}


function abrirEstadistica(ventana) { 
window.open(ventana,
'SENIAT',
'menubar=no,scrollbars=yes,'+ 'resizable=yes,' +
'width=800,height=530' ); 
} 
                    