function muestramas() { window.open("agenda_enviar.asp", null,"scrollbars=yes,resizable=no,toolbar=no,location=no,directories=no,menubar=no,width=450,height=400"); } function calend(s,t) { calendario = window.open("/web/functions/calendario.asp?caso=1&fecha=" + t.value + "&campo=" + t.name + "&formulario=" + s.name,"calendario","width=300,height=250"); } function busca(t) { errores = ""; /*if(t.finRango.value!="" && t.inicioRango.value==""){ errores="La fecha de inicio tiene que estar rellena"; }*/ if(errores!=""){ alert("Por favor, corrija los siguientes fallos:" + errores); }else{ t.submit(); } //seleccionado(t.id_provincia,"PROVINCIA"); /* esta_vacio(t.fecha,"DIA"); if (chequea()) { t.submit(); } else { alert("Por favor, corrija los siguientes fallos:" + errores); }*/ } function registraCalendarios() { var este = new Date().getFullYear(); var rangeyears = [este-2, este+2]; setupCalendar(document.getElementById("inicioRango"), rangeyears); //setupCalendar(document.getElementById("finRango"), rangeyears); } if (window.addEventListener) { window.addEventListener("load", registraCalendarios, false); } else { window.attachEvent("onload", registraCalendarios); } function buscarAgendaEventos() { var form = document.getElementById('buscador'); errores = ""; var fechaEvento = document.getElementById("inicioRango"); var validDateEvento = isValidDate(fechaEvento.value); if(!validDateEvento && fechaEvento.value != "") { errores+="\n - El campo 'FECHA DE EVENTO' no es una fecha correcta. Recuerda que debe tener el formato dd/mm/yyyy"; } //Solo comprobamos si la fecha es valida if(errores == ""){ //Obtenemos fecha actual con horas minutos y segundos = 0 var tmpFecha = new Date(); dia_ini=tmpFecha.getDate(); mes_ini=tmpFecha.getMonth(); mes_ini+=1; anno_ini=tmpFecha.getFullYear(); fecha=anno_ini+"/"+mes_ini+"/"+dia_ini; var fechaActual = new Date(fecha); //Obtenemos fecha de la busqueda del evento y convertimos en fecha para poder comparar dia_ini=fechaEvento.value.substr(0,2); mes_ini=fechaEvento.value.substr(3,2); anno_ini=fechaEvento.value.substr(6,4); fecha=anno_ini+"/"+mes_ini+"/"+dia_ini; var fechaDate = new Date(fecha); dif = fechaDate - fechaActual; if(dif < 0) { errores="\n - El campo 'FECHA DE EVENTO' debe ser superior a la fecha actual."; } } if(chequea()) form.submit(); else alert("Por favor, corrija los siguientes fallos:" + errores); }