function makeMonthArray() {

        this.length=12;

        this[1] = "Enero", this[2] = "Febrero"; this[3] = "Marzo";

        this[4] = "Abril", this[5] = "Mayo"; this[6] = "Junio";

        this[7] = "Julio", this[8] = "Agosto"; this[9] = "Septiembre";

        this[10] = "Octubre", this[11] = "Noviembre"; this[12] = "Diciembre";

        return(this);

}

function makeDayArray() {

        this.length=7;

        this[1] = "Domingo", this[2] = "Lunes"; this[3] = "Martes";

        this[4] = "Miércoles", this[5] = "Jueves"; this[6] = "Viernes";

        this[7] = "Sábado";

        return(this);

}

function writeDate() {

        alestradate = new Date();

        monthName = new makeMonthArray();

        dayName = new makeDayArray();

        day = alestradate.getDay() + 1;

        date = alestradate.getDate();

        month = alestradate.getMonth() + 1;

        year = alestradate.getYear();

        sec = alestradate.getSeconds()

        if (90 <= year && year < 2000) {

                year = "19" + year;

        }

        dateStr  = dayName[day];
		
		dateStr += " ";
		
		dateStr += date;
		
        dateStr += " de ";

        dateStr += monthName[month];

        dateStr += " de ";

        dateStr += year;

        document.write(dateStr);

}

//-->
