var DOM = (document.getElementById) ? true:false
var IE4 = (document.all && !DOM) ? true:false
var NS4 = (document.layers) ? true:false

function darId(id) {
   if (DOM) return document.getElementById(id);
   if (IE4) return document.all[id];
   if (NS4) return document.layers[id];
}

function Fecha(){
	this.f = new Date();
	this.semana = new Array("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado");
	this.mes = new Array(
		"Enero","Febrero","Marzo",
		"Abril","Mayo","Junio",
		"Julio","Agosto","Septiembre",
		"Octubre","Noviembre","Diciembre"
	);
	this.dNombre = this.semana[this.f.getDay()];
	this.dNumero = this.f.getDate();
	this.mNombre = this.mes[this.f.getMonth()];
	this.aCompleto = this.f.getFullYear();

	this.todaLaFecha = function(){
		return this.dNombre+", "+this.dNumero+" de "+this.mNombre+" de "+this.aCompleto;
	}
}

function inicializador(){
	miFecha = new Fecha();
	darId("fecha").innerHTML = miFecha.todaLaFecha();
}