function Fecha(){
	this.f = new Date();
	this.semana = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	this.mes = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
	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.hora = function(objName, spanId){
		fTemp = new Date();
		hours = ( fTemp.getHours() > 9 ) ? fTemp.getHours() : "0"+fTemp.getHours();
		minutes = ( fTemp.getMinutes() > 9 ) ? fTemp.getMinutes() : "0"+fTemp.getMinutes();
		seconds = ( fTemp.getSeconds() > 9 ) ? fTemp.getSeconds() : "0"+fTemp.getSeconds();
		darId(spanId).innerHTML = hours+":"+minutes+":"+seconds;
		setTimeout(objName+".hora('"+objName+"','"+spanId+"')",1000);
	}
	this.todaLaFecha = function(){
		return this.dNombre+", "+this.mNombre+" "+this.dNumero+", "+this.aCompleto;
	}
}

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