function monthArray() {

	this[0] = "Enero";	this[1] = "Febrero";	this[2] = "Marzo";

	this[3] = "Abril";	this[4] = "Mayo";	this[5] = "Junio";

	this[6] = "Julio";	this[7] = "Agosto";	this[8] = "Septiembre";

	this[9] = "Octubre";	this[10] = "Noviembre";	this[11] = "Diciembre";

    return (this);

}



function dayArray() {

	this[0] = "Domingo";	this[1] = "Lúnes";	this[2] = "Martes";

	this[3] = "Miércoles";	this[4] = "Jueves";	this[5] = "Viernes";

	this[6] = "Sábado";

        return (this);

}





function formatYear(year)

{

  if (year > 1900) return year

  return year+1900;

}



function writeDate()

{

   days = new dayArray();

   months = new monthArray();

   d = new Date();

   day = d.getDate();

   month = d.getMonth();

   year = d.getYear();

   str = days[d.getDay()] + " " + day + " " + months[month] +" "+formatYear(year);

  document.writeln(str);

}



function writeTime()

{

   d = new Date();

   hour=d.getHours();

   min=d.getMinutes();

   sec=d.getSeconds();

   if (hour < 10) hour = "0"+hour;

   if (min < 10) min = "0"+min;

   if (sec < 10) sec = "0"+sec;

   str = hour+"h"+min;

   document.writeln(str);

}


