var anchoPreview=0; var altoPreview=0; if (window.screen){ anchoPreview = (screen.width - 780)/2; altoPreview = (screen.height - 580)/2; } function previewPortal(enlace,abrir){ var aux="./"; aux = aux + "p_3_final_Contenedor2.jsp" + "?seccion="; enlace=enlace.substring(2,enlace.length); if(aux.indexOf("?") == -1) aux = aux + enlace; else enlace = enlace.replace('?','&'); aux = aux + enlace; if(aux.indexOf("?") == -1) aux+="?codResi=1&language="+'ca'; else aux+="&codResi=1&language="+'ca'; if(abrir == "1") open(aux,"","toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes,width=800,height=600,top="+altoPreview+",left="+anchoPreview+""); else{ parent.location.href=aux; } } function formatearLongitudFecha(s) { if (s<10) { return '0'+s; } else { return s; } } var diferenciaHoras=0; function formatoHora() { d=new Date(); d = new Date(d.getTime()-diferenciaHoras); var dayArray = new Array('Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado', 'Domingo'); var monthArray = new Array('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto','Septiembre','Octubre','Noviembre','Diciembre'); var day = dayArray[d.getDay()]; var month = monthArray[d.getMonth()]; return d.getDate()+" de "+ month +" de "+d.getFullYear()+" "+formatearLongitudFecha(d.getHours())+":"+formatearLongitudFecha(d.getMinutes())+":"+formatearLongitudFecha(d.getSeconds()); } function ponHora() { $.ajax({ type : "POST", cache : false, url : 'se_fecha_servidor.jsp', data : $(this).serializeArray(), success: function(data) { var fechaHoraActual = parseInt(data); var d = new Date(fechaHoraActual); var fechaHoraCliente= new Date(); diferenciaHoras=fechaHoraCliente-d; actualizaHora(); } }); } function actualizaHora() { jQuery("#fechahora").html(formatoHora()); setTimeout("actualizaHora()", 1000); } function ponHoraFicha() { jQuery("#fechahoraficha").html(formatoHora()); setTimeout("ponHoraFicha()", 1000); }