// JavaScript Document
<!--
var pong;
function hacerArray(n){
  this.length = n;
  for (i=1;i<=n;i++){
    this[i]=0;
  }
  return this;
}
//---FUNCION PARA MOSTRAR LA FECHA ACTUAL---
function mostrarFecha() {
  var this_month = new hacerArray(12);
  this_month[0]  = "enero";
  this_month[1]  = "febrero";
  this_month[2]  = "marzo";
  this_month[3]  = "abril";
  this_month[4]  = "mayo";
  this_month[5]  = "junio";
  this_month[6]  = "julio";
  this_month[7]  = "agosto";
  this_month[8]  = "septiembre";
  this_month[9]  = "octubre";
  this_month[10] = "noviembre";
  this_month[11] = "diciembre";

  var this_day_e = new hacerArray(7);
  this_day_e[0]  = "Domingo";
  this_day_e[1]  = "Lunes";
  this_day_e[2]  = "Martes";
  this_day_e[3]  = "Miércoles";
  this_day_e[4]  = "Jueves";
  this_day_e[5]  = "Viernes";
  this_day_e[6]  = "Sábado";

  var today = new Date();
  var day   = today.getDate();
  var month = today.getMonth();
  var year  = today.getYear();
  var dia = today.getDay();
    if (year < 1000) {
       year += 1900; }
  return( " " + this_day_e[dia] + ", " + day + " de " + this_month[month] + " de " + year);
}

//---FUNCION PARA MOSTRAR LA FECHA ACTUAL EN INGLÉS---
function mostrarFechaIngles() {
  var this_month = new hacerArray(12);
  this_month[0]  = "January";
  this_month[1]  = "February";
  this_month[2]  = "March";
  this_month[3]  = "April";
  this_month[4]  = "May";
  this_month[5]  = "June";
  this_month[6]  = "July";
  this_month[7]  = "August";
  this_month[8]  = "September";
  this_month[9]  = "October";
  this_month[10] = "November";
  this_month[11] = "December";

  var this_day_e = new hacerArray(7);
  this_day_e[0]  = "Sunday";
  this_day_e[1]  = "Monday";
  this_day_e[2]  = "Tuesday";
  this_day_e[3]  = "Wednesday";
  this_day_e[4]  = "Thursday";
  this_day_e[5]  = "Friday";
  this_day_e[6]  = "Saturday";

  var today = new Date();
  var day   = today.getDate();
  var month = today.getMonth();
  var year  = today.getYear();
  var dia = today.getDay();
    if (year < 1000) {
       year += 1900; }
  return( " " + this_day_e[dia] +" "+ day + " "+this_month[month] + ", " + year);
}


/*VALIDACION DE FECHAS*/
var daysInMonth = makeArray(12);
daysInMonth[1] = 31;
daysInMonth[2] = 29;
daysInMonth[3] = 31;
daysInMonth[4] = 30;
daysInMonth[5] = 31;
daysInMonth[6] = 30;
daysInMonth[7] = 31;
daysInMonth[8] = 31;
daysInMonth[9] = 30;
daysInMonth[10] = 31;
daysInMonth[11] = 30;
daysInMonth[12] = 31;

function makeArray(n) {
   for (var i = 1; i <= n; i++) {
      this[i] = 0;
   } 
   return this;
}
//---CONTROL DEL NUMERO DE DIAS Y MESES---
function isDate(dd, mm, yyyy) {
if (!(mm > 0 && mm < 13))
{
return false;
}
if (!(dd > 0 && dd < 32))
{
return false;
}
if (dd > daysInMonth[eval(mm)])
{
return false;
}
return true;
}
//---FUNCION QUE EJECUTA EL BOTON HOY PARA OBTENER LA FECHA ACTUAL---
function Fecha_hoy(){
	var dia, mes, anio, hoy
	actual=new Date()
	dia= actual.getDate();
	mes=actual.getMonth()+1;
	anio=actual.getFullYear();
	hoy=dia + '/' + mes + '/' + anio
	document.form1.fecha.value=hoy;
}

//---FUNCION PARA ABRIR VENTANA DE USUARIO---
function Abrir_ventana(url){
	var ventana;
	ventana= window.open(url,'privado', 'screenX=10,screenY=10,location=no, menubar=no, scrollbars=no, status=no, toolbar=no, resizable=no, height=280, width=400');
	//ventana.document.open();
	ventana.document.location=url;
}

//----FUNCION PARA MOSTRAR LAS CAPAS DE MENUS EN AREA PRIVADA-----
function activaLayer(id,opc)
{
document.getElementById(id).style.visibility=(opc==0)? 'hidden' : 'visible';
}


function imprimir() {
if (window.print)
	window.print()
else
	alert("Error: su navegador no soporta esta opción.");
}

function ampliar_imagen(ruta)
{
   i1 = new Image;
   i1.src = ruta;
   html = '<html><head><title>Imagen</title></head>';
   html += '<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" bgcolor="#F5F2ED">';
   html += '<center><img src="'+ruta+'" border="0" name="Foto"';
   html += 'onLoad="window.resizeTo(document.Foto.width+30,document.Foto.height+32)">';
   html += '</center></body></html>';
   popupImage = window.open('','_blank','scrollbars=1,resizable=0,top=50,left=150');
   popupImage.document.open();
   popupImage.document.write(html);
   popupImage.document.close();
}
function abre_ventana(id,tabla,url){
	var ventana;
	ventana= window.open('','_blank', 'top=50,left=150,location=no, menubar=no, scrollbars=yes, status=no, toolbar=no, resizable=no, height=300, width=500');
	ventana.document.location=url + "?id=" + id + "&tabla=" + tabla;
	ventana.document.focus();
	ventana.document.close();
}
function Mostrar_cartel(nombre){
		 if (document.all) 
		 		eval ("document.all." + nombre + ".style.visibility='visible'");
		 else if (document.getElementById) 
				eval ("document.getElementById('" + nombre + "').style.visibility='visible'");
}
//-->
